Nagios Monitoring ERROR/BUG

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.
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

Dear All,
I found an error while running nagios. The problem arise when i use check_nrpe!check_swap and the output is "(Return code of 255 is out of bounds)" giving status OK. On the other side when i use check_ssh, the output is "connect to address xxx.xxx.xxx.xxx and port 22: No route to host".

Assuming that the remote host is down in this situation. Following are two examples of my nagios service configuration.

define service{
use generic-service
host_name client2
service_description Swap Usage
check_command check_nrpe!check_swap
}

define service{
use generic-service
host_name client2
service_description SSH Monitoring
check_command check_ssh
}

Please help me, how to manage this isue. Snapshot attached.
mongoDB NRPE Error - Shutdown.jpg
Regards
RMA
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Monitoring ERROR/BUG

Post by Box293 »

Can you post the command definitions for check_nrpe and check_ssh
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Re: Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

Dear,
Following are my check_nrpe and check_ssh command definations.

define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}

define command{
command_name check_ssh
command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}

Regards
RMA
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Monitoring ERROR/BUG

Post by Box293 »

rmuhammadali wrote:define command{
command_name check_ssh
command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}

define service{
use generic-service
host_name client2
service_description SSH Monitoring
check_command check_ssh
}
With the host you are trying to test, in your host definition file is this a DNS name or an IP address?
From the command line of your nagios host can you ping the DNS name or an IP address?

rmuhammadali wrote:define service{
use generic-service
host_name client2
service_description Swap Usage
check_command check_nrpe!check_swap
}
On your remote host you will have the check_swap command defined in the file /usr/local/nagios/etc/nrpe.cfg OR in the file /usr/local/nagios/etc/nrpe/common.cfg
Is this the case, does an entry for check_swap exist?

Also, have you configured the only_from entry in/etc/xinetd.d/nrpe ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Re: Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

/etc/xinetd.d/nrpe Configuration
only from = nagiosserverip

/usr/local/nagios/etc/nrpe.cfg Configuration
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 40% -c 20%

Actually i have down the nrpe client machine to check added monitors.


Regards
RMA
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Monitoring ERROR/BUG

Post by scottwilkerson »

Can you show the permissions of the check_swap file on the remote system

Code: Select all

ls -l /usr/local/nagios/libexec/check_swap
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Re: Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

Dear,
As i mentioned earlier that assume the remote machine is down, in that case there is nothing concerns with check_swap permissions on remote host. Anyhow the permissions are

Code: Select all

ls -al /usr/local/nagios/libexec/check_swap 
-rwxr-xr-x. 1 root root 141169 Dec 20 11:48 /usr/local/nagios/libexec/check_swap
The question is how to manage "(Return code of 255 is out of bounds)" this error when remote host is down.

Regards
RMA
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Monitoring ERROR/BUG

Post by abrist »

If the host is down, nrpe should time out, not return 255.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Re: Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

Dear,
thats the situation, it show
Current Status: OK
Status Information: (Return code of 255 is out of bounds)

Rather then time out or some other status like warning or critical.

Regards
RMA
rmuhammadali
Posts: 27
Joined: Sat Dec 13, 2014 4:02 am

Re: Nagios Monitoring ERROR/BUG

Post by rmuhammadali »

Dear,
After keen observation, i found out the following statistics
1) When System is up and running

Code: Select all

[root@nagios myconf]# /usr/local/nagios/libexec/check_nrpe -H 192.168.2.7 -c check_swap
SWAP OK - 100% free (999 MB out of 999 MB) |swap=999MB;399;199;0;999
nrpe SystemUP 1.jpg
nrpe SystemUP 1.jpg (11.02 KiB) Viewed 4759 times
2) When System is down manually
First Result

Code: Select all

[root@nagios myconf]# /usr/local/nagios/libexec/check_nrpe -H 192.168.2.7 -c check_swap
CHECK_NRPE: Socket timeout after 10 seconds.
nrpe SystemDOWN 2.jpg
Then on the Second check

Code: Select all

[root@nagios myconf]# /usr/local/nagios/libexec/check_nrpe -H 192.168.2.7 -c check_swap
connect to address 192.168.2.7 port 5666: No route to host
connect to host 192.168.2.7 port 5666: No route to host
nrpe SystemDOWN 1.jpg
nrpe SystemDOWN 1.jpg (10.11 KiB) Viewed 4759 times
Regards
RMA
Locked