As part of a general overhaul of some Nagios scripts, I am adding parameters to the scripts so that the thresholds can be determined on a machine-by-machine basis. As an example, we are specifying percentage of disk free at which to trigger the critical and warning alerts.
One of the scripts monitors /proc/sys/fs/inode-nr
- this has two values, nr_inodes
and nr_free_inodes
. I don't have much understanding of the innards of UNIX, so I'm not quite sure whether it's possible to set a threshold on this file based upon the values within it.
nr_inodes
and nr_free_inodes
would suggest that the number of in-use inodes can be calculated as (nr_inodes - nr_free_inodes)
. Therefore, at a guess, as the number in-use gets closer to X% and Y% of nr_inodes
, the script should be triggering warning and critical alerts respectively.
Does this seem like a correct kind of assumption to make?
Quoting kernel/Documentation/sysctl/fs.txt
So your assumption is rather incorrect.
You can use "df -i" instead to get inode utilization.
If you're looking to check disk inode usage (which is actually important for Virtuozzo/OpenVZ installs since we've had issues with that) the check_disk Nagios plugin has -iwarning and -icritical options: