Page 1 of 2
negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 1:43 pm
by tecnalb
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
Re: negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 1:51 pm
by jolson
I would get an alert... until I upgraded to Centos 6.7 yesterday.
I assume you updated the Nagios XI box?
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 negate
Here is the output of my working box:
[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
After you run the negate check, what is the exit status?
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
It's likely that the output of your check_nrpe plugin will remain consistent while negate will influence the exit status.
Re: negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 2:17 pm
by tecnalb
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]#
Re: negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 2:25 pm
by jolson
Please run through the bottom part of my post:
After you run the negate check, what is the exit status?
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
echo $?
It's likely that the output of your check_nrpe plugin will remain consistent while negate will influence the exit status.
Re: negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 3:27 pm
by tecnalb
Code: Select all
./negate ./check_nrpe -H xxxx.xxx-a "e2fsck"
[root@nagios libexec]# ./negate ./check_nrpe -H xxx.xxx -a "e2fsck"
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
Posted: Mon Aug 10, 2015 4:02 pm
by jolson
Based on that output, negate is working properly.
Without negate
[root@nagios libexec]# ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
0
Note that without negate, you get an exit status of '0' - meaning 'OK' in Nagios.
[root@nagios libexec]# ./negate ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
2
Note that with negate, you have an exit status of '2' - meaning 'CRITICAL' in Nagios.
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
Posted: Mon Aug 10, 2015 6:37 pm
by tecnalb
tecnalb wrote:jolson wrote:Based on that output, negate is working properly.
Without negate
[root@nagios libexec]# ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
0
Note that without negate, you get an exit status of '0' - meaning 'OK' in Nagios.
[root@nagios libexec]# ./negate ./check_nrpe -H xxx.xxx -a "e2fsck"
NRPE v2.14
[root@nagios libexec]# echo $?
2
Note that with negate, you have an exit status of '2' - meaning 'CRITICAL' in Nagios.
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.
Re: negate no longer works after I update Centos 6
Posted: Mon Aug 10, 2015 8:55 pm
by Box293
Looking at this with a different set of eyes I can see we have asked you to do an incorrect command:
jolson wrote:Please run through the bottom part of my post:
After you run the negate check, what is the exit status?
Code: Select all
./negate ./check_nrpe -H xxxx.xxx -a "e2fsck"
echo $?
It's likely that the output of your check_nrpe plugin will remain consistent while negate will influence the exit status.
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.
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 $?
Also, can you please run this on the remote host:
Code: Select all
/usr/local/nagios/libexec/check_services -p e2fsck
echo $?
Re: negate no longer works after I update Centos 6
Posted: Tue Aug 11, 2015 9:12 am
by tecnalb
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
Re: negate no longer works after I update Centos 6
Posted: Tue Aug 11, 2015 9:44 am
by lmiltchev
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"?