A new check_all_fs_used function?

22 views
Skip to first unread message

Ole Holm Nielsen

unread,
Apr 21, 2021, 8:50:30 AM4/21/21
to n...@lbl.gov
In my site-wide nhc.conf file I have a lot of file systems that must be
checked by NHC to see if more than 90% is used. In nhc.conf I have 79
lines with check_fs_used, for example:

panda2.fysik.dtu.dk || check_fs_used /u/opt 90%

It has become a pain to remember to create a new NHC rule every time I add
a new file system on any one of our servers. AFAIK, there is no NHC
function doing a "check all local mounted file systems", and wild-carding
the filesystem name doesn't work.

Question: Could we add a new function, for example named
check_all_fs_used? Such a function could do "df -Tklx tmpfs" and invoke
check_fs_used for each of the filesystems listed by df.

Would such a function make sense, and would others find it useful? I
think it could make sense to apply this for all hosts in nhc.conf like:

* || check_all_fs_used 90%

One might restrict the filesystem type with "df -Tklt <fstype>" and add a
filesystem type argument like:

* || check_all_fs_used xfs 90%

Thanks,
Ole

--
Ole Holm Nielsen
PhD, Senior HPC Officer
Department of Physics, Technical University of Denmark

Ole Holm Nielsen

unread,
Apr 24, 2021, 7:56:53 AM4/24/21
to n...@lbl.gov
I've created a pull request https://github.com/mej/nhc/pull/101
proposing these new functions:
* check_all_fs_used, check_all_fs_inodes, check_all_fs_ifree,
check_all_fs_iused
which are used to check all filesystems of a particular "fstype".
This may be helpful when you have many servers with many different
filesystems. Example nhc.conf:

# Checking all XFS filesystems on all servers:
* || check_all_fs_used xfs 90%

/Ole
Reply all
Reply to author
Forward
0 new messages