check_open_files.pl plugin not working/ not taking threshold

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

check_open_files.pl plugin not working/ not taking threshold

Post by srikgali »

I can not able to use check_open_files.pl plugin in RHEL 6.8 , I getting below error

[root@<hostname> libexec]# ./check_open_files.pl -w 500 -c 1000
OK: open files (2176) is below threshold (1933510/3867020)|open_files=2176;1933510;3867020

even though i gave warning threshold 500 & critical 1000, It is taking different thresholds and giving me output is ok.

I want to know how this plugin works?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_open_files.pl plugin not working/ not taking thres

Post by mcapra »

I'm not sure which version you're using, but the --warning and --critical arguments seem to be in terms of percentages and not absolute counts of "open files":

Code: Select all

[root@nagios libexec]# ./check_open_files.pl -h
 v$Revision: 1.1 $ (nagios-plugins 2.2.1)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 2007 Christophe Thiesset

Usage:  -w <warn> -c <crit> [-t <timeout>] [-v version] [-h help]

   Checks the open files number against the max autorized
-w (--warning)   = Percentage of opened files to generate warning alert
-c (--critical)  = Percentage of opened files to generate critical( w < c )
-t (--timeout)   = Plugin timeout in seconds (default = 15)
-h (--help)
-v (--version)
This plugin seems to reference the following file:

Code: Select all

/proc/sys/fs/file-nr
Which, from this RedHat article, contains the following:
The file-nr file displays three parameters:
  • the total allocated file handles.
  • the number of currently used file handles (with the 2.4 kernel); or the number of currently unused file handles (with the 2.6 kernel).
  • the maximum file handles that can be allocated (also found in /proc/sys/fs/file-max).
So what the plugin appears to do is looks at the total allocated file handles, checks it against the maximum file handles that can be allocated, and uses the --warning and --critical arguments to represent some percentage of maximum file handles / allocated file handles.

I could be wrong though. This is the first time I've ever heard of this plugin.
Former Nagios employee
https://www.mcapra.com/
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

Re: check_open_files.pl plugin not working/ not taking thres

Post by srikgali »

Thanks for your reply, the plugin version that i am using.

[root@wsvmlnlhp01 libexec]# ./check_open_files.pl --version
v$Revision: 1.1 $ (nagios-plugins 2.0.3)

So I do need to calculate what threshold i need to set, This is plugin is working as expected in AIX.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_open_files.pl plugin not working/ not taking thres

Post by tgriep »

Yes, to use that plugin, you would have to calculate the percentage of open files and use that for the thresholds.
Or, you can search the exchange site for a plugin that checks the absolute number of open files.
https://exchange.nagios.org/
Be sure to check out our Knowledgebase for helpful articles and solutions!
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

Re: check_open_files.pl plugin not working/ not taking thres

Post by srikgali »

I got the solution, it is checking the file in/proc filesystem for max open files. so i gave thresholds according to it.

thanks.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_open_files.pl plugin not working/ not taking thres

Post by tgriep »

Your welcome. Shall I close and lock the post as solved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

Re: check_open_files.pl plugin not working/ not taking thres

Post by srikgali »

YEs, You can close, thanks
Locked