Return code out of bounds as an error

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.
Locked
huleuxm
Posts: 4
Joined: Wed Apr 09, 2014 1:40 am

Return code out of bounds as an error

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Return code out of bounds as an error

Post 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?
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.
huleuxm
Posts: 4
Joined: Wed Apr 09, 2014 1:40 am

Re: Return code out of bounds as an error

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Return code out of bounds as an error

Post 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
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
huleuxm
Posts: 4
Joined: Wed Apr 09, 2014 1:40 am

Re: Return code out of bounds as an error

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Return code out of bounds as an error

Post 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.
huleuxm
Posts: 4
Joined: Wed Apr 09, 2014 1:40 am

Re: Return code out of bounds as an error

Post by huleuxm »

OK then, there is no way to set all unknown return messages as critical...
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Return code out of bounds as an error

Post 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..
Locked