Page 1 of 1

Return code out of bounds as an error

Posted: Wed Apr 09, 2014 1:46 am
by huleuxm
Hi,

In some cases, a check gives back a out of bounds return message but that return code is mostly displayed as an OK status.

Is it possible to set all theses messages to a critical status?


Thanks,


Martin.

Re: Return code out of bounds as an error

Posted: Wed Apr 09, 2014 12:42 pm
by abrist
This is usually handled by the plugin itself, or potentially the agent. What plugin is failing? Can you post an example of the check and its failed output?

Re: Return code out of bounds as an error

Posted: Fri Apr 11, 2014 2:21 am
by huleuxm
A more detailed example here, I have some RaspberryPi (with Raspbian) connected to my network with openvpn and monitored with nrpe.

I got a downtime now, my RaspberryPi's internet connexion is down, I got an OK status with return message (Return code of 255 is out of bounds)


If I run the command manually, I got "No route to host" wich is correct because my vpn is down


./check_nrpe -H 192.168.221.65 -c check_load
connect to address 192.168.221.65 port 5666: No route to host
connect to host 192.168.221.65 port 5666: No route to host


Thanks,


Martin

Re: Return code out of bounds as an error

Posted: Fri Apr 11, 2014 11:36 am
by sreinhardt
Interesting, going to a host that does not exist but would be on my lan, or one that is on a lan I should not have a route to, both give a connection timeout message which should be correct. However I would agree a route error should cause a critical as well. Could you print your route table, while that pi is down and up, please?

Code: Select all

route

Re: Return code out of bounds as an error

Posted: Sun Apr 13, 2014 11:26 am
by huleuxm
The route is quite complicated, it goes by one cisco router (default gateway), then to other server.

It reaches the last server wich start the VPN with the remote raspberry. On that server the IP (for example 192.168.221.1) is routed to the VPN ip itself wich is not accessible because the VPN is down.

The plugin should just give back an error code and a message if possible when he cannot talk with remote client

Re: Return code out of bounds as an error

Posted: Mon Apr 14, 2014 9:23 am
by slansing
Well it is already telling you it cant reach the plugin, it is out of bounds from the core server. You could possibly edit the plugin to change this wording, or switch around the state it sends back to the Core server as well.

Re: Return code out of bounds as an error

Posted: Mon Apr 14, 2014 10:58 am
by huleuxm
OK then, there is no way to set all unknown return messages as critical...

Re: Return code out of bounds as an error

Posted: Mon Apr 14, 2014 12:16 pm
by slansing
Well, yes, as I said above you would need to edit the plugin and switch the exit code for for that particular one from a 3 to a 2. That won't cover all of your unknowns as they are produced by the plugins, you would need to change this on each plugin you want that behavior from..