Page 1 of 1

Wrong Alerts

Posted: Mon Jan 06, 2020 8:20 am
by ivp2015
Hi Team,
We configured Disk alerts on Linux Machine for /, today disk space 100% full but Nagios did not send any email regarding disk alert also not showing on GUI, Please find out the attachment.


Thanks

Re: Wrong Alerts

Posted: Mon Jan 06, 2020 12:25 pm
by lmiltchev
Have you tested your check from the command line? Does it work fine when you run it in a terminal? It is possible that Nagios XI doesn't show you the expected output in the GUI, and doesn't notify you , because you have exceeded your license limits (as per your screenshot).

Re: Wrong Alerts

Posted: Tue Jan 14, 2020 7:16 am
by ivp2015
We configured Nagios on other Linux machine and the Linux machine total Drive size is 30GB and Nagios showing free space is 41GB, Please find out the attachment for the same. Also, we faced same issue with all Linux machines.

Re: Wrong Alerts

Posted: Tue Jan 14, 2020 11:02 am
by lmiltchev
Can you show us the actual command that you are using for this service, run from the command line, along with the output of it?

Also, log into the Nagios Core interface:

Code: Select all

http://ip address/nagios
find the "Check Disk" service and show us a screenshot of the page.

Re: Wrong Alerts

Posted: Mon Jan 20, 2020 4:52 am
by ivp2015
Please find out the attachment

Re: Wrong Alerts

Posted: Mon Jan 20, 2020 10:29 am
by lmiltchev
First off, you need to add a "%" sign to your thresholds. If you just use an integer, the check will look into the MB of free space, not percentages.
-w, --warning=INTEGER
Exit with WARNING status if less than INTEGER units of disk are free
-w, --warning=PERCENT%
Exit with WARNING status if less than PERCENT of disk space is free
-c, --critical=INTEGER
Exit with CRITICAL status if less than INTEGER units of disk are free
-c, --critical=PERCENT%
Second, the plugin generates an alert if free space is less than one of the threshold values. So, you would need to probably changes your check from this:

Code: Select all

/usr/local/nagios/libexec/check_disk -w 80 -c 95 -p /
to this:

Code: Select all

/usr/local/nagios/libexec/check_disk -w 20% -c 15% -p /
This way, if free space is less than 20% (but more than 15%), you would get a "WARNING". If the disk space is less than 15%, you would get a "CRITICAL".

Re: Wrong Alerts

Posted: Mon Jan 20, 2020 1:44 pm
by ivp2015
after changing the command
/usr/local/nagios/libexec/check_disk -w 20% -c 15% -p /

still getting the same wrong alerts. Please find out the attachment.

Re: Wrong Alerts

Posted: Mon Jan 20, 2020 2:08 pm
by scottwilkerson
This looks correct, it is returning OK as you have more than 20% free

Re: Wrong Alerts

Posted: Thu Jan 23, 2020 2:41 am
by ivp2015
It look not correct. Total disk size of "/" is 20GB only and output is free space of "/" is 41325MB almost 40GB

Re: Wrong Alerts

Posted: Thu Jan 23, 2020 7:42 am
by scottwilkerson
Oh I see, that is odd

what version of the plugin are you running?

/usr/local/nagios/libexec/check_disk -h |head -5