What's Changed in 1.5
New Features
- New command-line options:
-V- Display version information; may be specified multiple times for increasing detail-j- Use JSON object format forsyslog()payload-mhost- Masquerade ashost; i.e., force use ofhostas the hostname rather than the canonical hostname.-p- Permanently offline nodes; nodes taken offline will be ignored by futurenhcruns and will require admin intervention to return to service-rresmgr- Specifyresmgras the resource manager (e.g.,slurm) or "none" for standalone operation.
- Several new checks are available out-of-the-box, including ones for NVIDIA GPUs via SMI and DCGM, Kubernetes, and more!
nhc-wrappercan now wrap co-located executables that need not be in the default/current$PATH.- Default permissions have been adjusted in the RPM specfile to allow normal users to access the
scriptsdirectory and the check modules within. This is build-time configurable (viarpmbuild --without useraccess ...). - The subprocess management and watchdog timer subsystems have been completely revamped to provide reliable and consistent oversight of child processes and to fix a timer conflict bug in previous versions.
- By popular demand, concurrency handling via a runtime process ID (PID) file has been implemented. PID files are context-specific and stored in
${RUNDIR}/nhc/NHC.context.pidby default. (The value for$RUNDIRis automatically detected.) - When running in "verbose" mode (
-v,VERBOSE=1), check numbers and totals are displayed as each check is run. check_file_stat()now supports the "birth timestamp" if available (via-B/-b) as well as the SELinux context (via-c, only available on Linux and when enabled).- NHC's configuration file, specified via
-cor the$CONFFILEsetting, no longer needs to point to a regular file; valid values now include named pipes/FIFOs,AF_UNIXsockets, PTYs/TTYs, process substitutions, etc. (Example:nhc -avl- -c <( egrep -hv '^[[:space:]]*(#|$)' /etc/nhc/nhc*.conf )) - Support was added for taking certain directory/path settings from namespaced environment variables:
- High-Level Settings
NHC_CFG_GLOBAL- The complete path- and filename to a global settings file, used instead of/etc/sysconfig/nhcNHC_CFG_PREFIX- Assumeautoconf-style layout with--prefix=<value>NHC_HOST- Override default$HOSTNAMEvalue (/etc/hostnameor/proc/sys/kernel/hostname)
- Individual Directories
NHC_CFG_CONFDIR- Override defaultCONFDIRvalue (/etc/nhc)NHC_CFG_INCDIR- Override defaultINCDIRvalue ($CONFDIR/scripts)NHC_CFG_HELPERDIR- Override defaultHELPERDIRvalue ($LIBEXECDIR/nhc)NHC_CFG_LIBEXECDIR- Override defaultLIBEXECDIRvalue (OS-dependent)NHC_CFG_LOGDIR- Override defaultLOGDIRvalue ($STATEDIR/log)NHC_CFG_RUNDIR- Override defaultRUNDIRvalue ($STATEDIR/run/nhc)NHC_CFG_STATEDIR- Override defaultSTATEDIRvalue (OS-dependent)NHC_CFG_SYSCONFIGDIR- Override defaultSYSCONFIGDIRvalue (OS-dependent)
- High-Level Settings
check_cmd_output()andcheck_file_contents()now support conditionals, additional expressions that can be used to fine-tune or supplement match strings, along with a whole slew of other new options. See README file for details.
Fixes/Improvements
- Resource consumption checks now differentiate between system and non-system users.
- Improved handling for Slurm node states and transitions
- Logs successful completion, not just failure
- More informative and customizable
syslog()labeling and tagging - Hardware checks reading from
procfs/sysfsfiles have been refactored to allow immensely greater flexibility as well as to address performance issues on some systems (e.g., many-core Knights Landing CPUs). Data sources are now completely user-configurable and can be cached copies, files in other locations, or even subcommands/pipelines. - Node online/offline helpers are now invoked in a subshell for greater data integrity protection.
- BREAKING CHANGE:
check_file_stat()now uses 2 distinct option sets that examine the file'smode. In previous versions,-M/-mlooked solely at the permissions bits (i.e.,mode & 00007777), whereas in NHC 1.5, this is done by the-P/-p"permissions" options. The-M/-m"mode" options now look at the file type bits (mode & 00170000). - Options to
check_file_test()can now be bundled. - When attempting to automatically fix a missing mount point, NHC will now accurately report the success or failure of the
mkdirattempt. - After loading checks from the config file, if the resulting check list is empty, a warning is now logged rather than
nhcjust exiting silently. - Special handling of Bash exit codes
126and127has been added to help point admins to the most likely causes. - When running under Slurm, the online helper will no longer attempt to resume nodes in the
maintstate;slurmctldrejects this as an invalid state change. check_file_contents()now uses the same backend processing/matching functionality thatcheck_cmd_output()uses, enabling use of all the same options and arguments.
Merged PRs
- Add csc_nvidia_smi.nhc to Makefile to get into RPM by @treydock in #114
- Numerous improvements to Slurm reboot handling and planned node state by @treydock in #115
- Fix unsafe string array conversion for passwd file parsing by @lebonez in #117
- lbnl_hw: Fixes/speedups for procfs file reads by @mej in #121
- nhc: Use subshell syntax for offline/online ops by @mej in #131
- lbnl-nhc.spec.in: Allow for normal user access by @mej in #133
- nhc: Refactor watchdog timer code for reuse by @mej in #132
- nhc: Add concurrency checking via PID file by @mej in #140
- nhc: Print check numbers in verbose mode (#124) by @mej in #142
- lbnl_cmd.nhc: Remove line numbers from dmesg check by @mej in #144
- Resuming node from state maint is an invalid node state transition by @papamoose in #176
New Contributors
- @lebonez made their first contribution in #117
- @papamoose made their first contribution in #176
The Gory Details
- Full Release Notes: RELEASE_NOTES.md
- Full Changelog: 1.4.3...1.5