check_open_files.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

check_open_files.pl

Post by deek »

Hi Team ,

We are using a script check_open_files.pl to check the number of open files on a linux server ( Rhel 6 ) .
We are quite unsure on how the calculation is done here and what values to be given as warning and critical .

Right now this is the setup and we are not sure why it is throwing a critical error .

[nagios@xyz ~]$ /usr/local/nagios/libexec/check_nrpe -H server -t 120 -c check_open_files -a '-w 1.29 -c 1.55'
CRITICAL: open files (36064) exceeds (threshold=25111/25111)|open_files=36064;20899;25111

Please help us in understanding how the calculation works
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_open_files.pl

Post by gsmith »

Hi

The w and c parameters are the warning and critical levels expressed in %
of the max open file limit. So the settings you have are quite low.

Here is an example, I list the system setting for max open files and then I run the check_open_files.pl
command with warning at 80% and critical at 90%

Code: Select all

[root@gs-cent7-23-94 libexec]# cat /proc/sys/fs/file-max
183612
[root@gs-cent7-23-94 libexec]# ./check_open_files.pl -w 80 -c 90
OK: 2912 open files (1% of max 183612)|opened_files=2912;146889;165250
80% of 183612 = 146889
90% 0f 183612 = 165250


So you can see the command returning the actual %, warning % and critical % :
opened_files=2912;146889;165250

Please let me know if this makes sense to you or not.

Thanks
Locked