Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks

Rich

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Quoting kernel/Documentation/sysctl/fs.txt

Nr_inodes stands for the number of inodes the system has allocated, this can be slightly more than inode-max because Linux allocates them one pageful at a time.

Nr_free_inodes represents the number of free inodes (?) and preshrink is nonzero when the nr_inodes > inode-max and the system needs to prune the inode list instead of allocating more.

So your assumption is rather incorrect.

You can use "df -i" instead to get inode utilization.

Thanks, Piotr

share|improve this answer
    
Thanks, so is there actually any benefit in monitoring /proc/sys/fs/inode-nr ? –  Rich Sep 3 '10 at 7:03
    
inode-max parameter was removed from kernel? –  c4f4t0r Nov 16 '13 at 23:18

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:

-W, --iwarning=PERCENT% Exit with WARNING status if less than PERCENT of inode space is free

-K, --icritical=PERCENT% Exit with CRITICAL status if less than PERCENT of inode space is free

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.