Disk alert is not working properly

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Disk alert is not working properly

Postby luiswolfcrm » Fri May 28, 2021 1:09 am

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

Postby luiswolfcrm » Tue Jun 01, 2021 6:01 am

The problem persist
luiswolfcrm
 
Posts: 2
Joined: Fri May 28, 2021 1:03 am

Re: Disk alert is not working properly

Postby mcapra » Wed Jun 02, 2021 12:11 pm

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/
User avatar
mcapra
 
Posts: 3661
Joined: Thu May 05, 2016 3:54 pm


Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 51 guests