negate no longer works after I update Centos 6
negate no longer works after I update Centos 6
Hello,
I was using the following command to let me know when a file system check was running. It was working, and when I initiated an fsck I would get an alert... until I upgraded to Centos 6.7 yesterday.
$USER1$/negate $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_services -a "e2fsck"
I manually ran this from the nagios server now, and it seems the negate command no longer functions.
[root@nagios libexec]# ./check_nrpe -H xxxx.xxx -t 30 -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# ./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
e2fsck: 1
I was using the following command to let me know when a file system check was running. It was working, and when I initiated an fsck I would get an alert... until I upgraded to Centos 6.7 yesterday.
$USER1$/negate $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_services -a "e2fsck"
I manually ran this from the nagios server now, and it seems the negate command no longer functions.
[root@nagios libexec]# ./check_nrpe -H xxxx.xxx -t 30 -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# ./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
e2fsck: 1
Re: negate no longer works after I update Centos 6
I assume you updated the Nagios XI box?I would get an alert... until I upgraded to Centos 6.7 yesterday.
Lets check on the md5 of your negate plugin, as well as the permissions in question:
Code: Select all
cd /usr/local/nagios/libexec
ls -l negate
md5sum negateAfter you run the negate check, what is the exit status?[root@localhost libexec]# ls -l negate
-rwxr-xr-x 1 root root 131574 Jul 29 16:58 negate
[root@localhost libexec]# md5sum negate
fc00d48fbe55c7a2670a6bb21475b09e negate
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"Code: Select all
echo $?Re: negate no longer works after I update Centos 6
No, I updated the target host only. However it seems my negate and your negate are vastly different.
[root@nagios libexec]# ls -l negate
-rwxr-xr-x 1 root root 142110 Nov 23 2014 negate
[root@nagios libexec]# md5sum negate
45f489e6de337c821233634ecca98b67 negate
[root@nagios libexec]#
[root@nagios libexec]# ls -l negate
-rwxr-xr-x 1 root root 142110 Nov 23 2014 negate
[root@nagios libexec]# md5sum negate
45f489e6de337c821233634ecca98b67 negate
[root@nagios libexec]#
Re: negate no longer works after I update Centos 6
Please run through the bottom part of my post:
After you run the negate check, what is the exit status?
It's likely that the output of your check_nrpe plugin will remain consistent while negate will influence the exit status.
After you run the negate check, what is the exit status?
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
echo $?Re: negate no longer works after I update Centos 6
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"Code: Select all
echo $?NRPE v2.14
[root@nagios libexec]# echo $?
2
Without negate
[root@nagios libexec]# ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
0
Re: negate no longer works after I update Centos 6
Based on that output, negate is working properly.
If you set up your checks with the 'negate' command, they will alert you properly based on the results above.
Note that without negate, you get an exit status of '0' - meaning 'OK' in Nagios.Without negate
[root@nagios libexec]# ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
0
Note that with negate, you have an exit status of '2' - meaning 'CRITICAL' in Nagios.[root@nagios libexec]# ./negate ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
2
If you set up your checks with the 'negate' command, they will alert you properly based on the results above.
Re: negate no longer works after I update Centos 6
tecnalb wrote:jolson wrote:Based on that output, negate is working properly.
Note that without negate, you get an exit status of '0' - meaning 'OK' in Nagios.Without negate
[root@nagios libexec]# ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
0
Note that with negate, you have an exit status of '2' - meaning 'CRITICAL' in Nagios.[root@nagios libexec]# ./negate ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
2
If you set up your checks with the 'negate' command, they will alert you properly based on the results above.
But esfsck is not running, and not in the process table, so why would it be a 0? It wasn't before. That was the purpose of the negate... to prevent a RED indication from displaying in Nagios unless e2fsck was in memory. If I did run a file system check, then I would get a red indication. In fact, I believe it might have been a support question or old threat here that put me down that path in the first place.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: negate no longer works after I update Centos 6
Looking at this with a different set of eyes I can see we have asked you to do an incorrect command:
So trying this instead please:
Also, can you please run this on the remote host:
We've asked you to simply run check_nrpe against the host WITHOUT issuing a command using -c ... so that is why you are getting a response that includes the NRPE version.jolson wrote:Please run through the bottom part of my post:
After you run the negate check, what is the exit status?
It's likely that the output of your check_nrpe plugin will remain consistent while negate will influence the exit status.Code: Select all
./negate ./check_nrpe -H xxxx.xxx -a "e2fsck" echo $?
So trying this instead please:
Code: Select all
./check_nrpe -H xxx.xxx -c check_services -a "e2fsck"
echo $?
./negate ./check_nrpe -H xxx.xxx -c check_services -a "e2fsck"
echo $?Code: Select all
/usr/local/nagios/libexec/check_services -p e2fsck
echo $?As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: negate no longer works after I update Centos 6
Good AM!
Here is my output...
[root@nagios libexec]# ./check_nrpe -H xxxx.xxx -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# echo $?
0
[root@nagios libexec]# ./negate ./check_nrpe -H xxxx.xxx -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# echo $?
2
On the host:
[nagios@backup libexec]$ /usr/local/nagios/libexec/check_services -p e2fsck
e2fsck: 1
[nagios@backup libexec]$ echo $?
0
Here is my output...
[root@nagios libexec]# ./check_nrpe -H xxxx.xxx -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# echo $?
0
[root@nagios libexec]# ./negate ./check_nrpe -H xxxx.xxx -c check_services -a "e2fsck"
e2fsck: 1
[root@nagios libexec]# echo $?
2
On the host:
[nagios@backup libexec]$ /usr/local/nagios/libexec/check_services -p e2fsck
e2fsck: 1
[nagios@backup libexec]$ echo $?
0
Re: negate no longer works after I update Centos 6
Everything seems to be working now.
When you check it locally - the process is running and the check exits with "0". When you use "check_nrpe", the result is the same, which is expected. When you use "negate", the exit code is "2".
Can we close this topic and mark it as "resolved"?
When you check it locally - the process is running and the check exits with "0". When you use "check_nrpe", the result is the same, which is expected. When you use "negate", the exit code is "2".
Can we close this topic and mark it as "resolved"?
Be sure to check out our Knowledgebase for helpful articles and solutions!