Disk alert is not working properly

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
luiswolfcrm
Posts: 2
Joined: Fri May 28, 2021 1:03 am

Disk alert is not working properly

Post 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?
luiswolfcrm
Posts: 2
Joined: Fri May 28, 2021 1:03 am

Re: Disk alert is not working properly

Post by luiswolfcrm »

The problem persist
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Disk alert is not working properly

Post 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
Former Nagios employee
https://www.mcapra.com/
Locked