Page 1 of 1

Wrong alert with swap file

Posted: Wed Oct 07, 2020 12:59 pm
by supportcl
Why i have this alert?

SWAP CRITICAL - 67% free (5369 MB out of 8103 MB)

my "Monitor the service with this command"

check_nrpe!check_swap!-a '-w 95% -c 90%'!!!!!!

Re: Wrong alert with swap file

Posted: Wed Oct 07, 2020 3:12 pm
by dchurch
Hello and welcome to the forums!

The check_swap plugin acts a little differently from most plugins. The warning and critical thresholds represent the percentage of available swap, not the percentage of used swap.

The warning level means it's a warning state if less than that amount of swap is available. E.g. If it's set to "20%", then it's a warning state when more than 80% of the swap is being used.

This is also the reason why the warning threshold is typically always higher than the critical level.

The reason you're getting a critical alert is because your system's percentage free (67%) is lower than 90%, so it's in the critical range. The way you have it configured, if you use more than 10% of the swap, it's in the critical range.


Possible solution

If you're trying to configure your plugin to trigger warning if more than 90% is used, and critical if more than 95% is used, then use this configuration.

Code: Select all

check_nrpe!check_swap!-a '-w 10% -c 5%'!!!!!!
See also this topic: https://support.nagios.com/forum/viewto ... =7&t=43507