Page 1 of 1

Disk alert is not working properly

Posted: Fri May 28, 2021 1:09 am
by luiswolfcrm
Good morning everyone,

I have nagios installed and the disk alert does not appear in yellow (warning) and I do not know the reason.

In the server checked I have in the file nrpe
command [check_disk] = / usr / lib64 / nagios / plugins / check_disk / -w 40% -c 20%

In the nagios server I have the verification:
define service {
use generic-service
host_name XXXXX.XX
service_description Free space on / dev / sda1
check_command check_nrpe! check_disk -w 40% -c 20%
}

In nagios it appears as:
DISK OK - free space: / 39439 MiB (20.40% inode = 98%):

And a warning should be displayed.

What is wrong with me?

Re: Disk alert is not working properly

Posted: Tue Jun 01, 2021 6:01 am
by luiswolfcrm
The problem persist

Re: Disk alert is not working properly

Posted: Wed Jun 02, 2021 12:11 pm
by mcapra
Your format looks correct; Here are some sample disk checks, a few of which use the official nagios-plugins check_disk plugin:
https://support.nagios.com/kb/article/d ... percentage
luiswolfcrm wrote: In the server checked I have in the file nrpe
command [check_disk] = / usr / lib64 / nagios / plugins / check_disk / -w 40% -c 20%
This looks malformed. There should be no / after the check_disk binary.

Your NRPE command definition is also not accepting arguments -- you've hard-coded 40% and 20% here:

Code: Select all

command [check_disk] = / usr / lib64 / nagios / plugins / check_disk / -w 40% -c 20%
When, based on your Nagios service definition (I'm assuming some things about your check_nrpe command definition):

Code: Select all

define service {
use generic-service
host_name XXXXX.XX
service_description Free space on / dev / sda1
check_command check_nrpe! check_disk -w 40% -c 20%
}
The arguments you're passing to the check_disk command, as it exists in your NRPE configuration, will be discarded. NRPE accepts args for commands invoked via check_nrpe like so:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
See this knowledge base article for some examples:
https://support.nagios.com/kb/article/n ... s-759.html