nrpe when host is down and accepting command line arguments

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
aramisbackwards
Posts: 13
Joined: Tue Nov 29, 2016 1:48 am

nrpe when host is down and accepting command line arguments

Post by aramisbackwards »

I have a remote host that accepts command line arguments from a remote server.

For example, I have a custom command called check_storage_devices and I pass in the name of a disk, say vda4 or vda5. The remote host then checks if there is a disk called vda4 or vda5 on it by running the check_storage_devices command installed on the remote host.

However I noticed that if I want it to be a service, I define the command in the commands.cfg as something like this:

Code: Select all

command check_storage_devices {
    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_storage_devices -a $ARG1$
Which means that it runs the check_storage_devices that belongs to the remote host, and in my service I simply define the check command as

Code: Select all

define service {
    ...
    check_command check_storage_devices!vda5   
However, when the remote host goes down, I constantly get logs like this:

Code: Select all

Return code of 255 for check of service 'check_storage_devices' on host 'storage-test-instance' was out of bounds.
Probably because the host is down there isn't any way for the service to know. But isn't the service checking nrpe first and shouldn't the result of that trigger some kind of case where since NRPE isn't reachable that the check command isn't run? How do people usually handle these cases? If you need any more concise / specific configurations let me know. Thanks.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: nrpe when host is down and accepting command line argume

Post by tgriep »

There is a bug in an older version of the check_nrpe command when the host is unreachable, it will return the 255 out of bounds error.
You would have to upgrade check_nrpe command and the following link are instructions to do so.
https://support.nagios.com/kb/article.php?id=515

You also may want to look at this article about running NRPE - v3 and Compatibility With Previous Versions.
https://support.nagios.com/kb/article.php?id=516
Be sure to check out our Knowledgebase for helpful articles and solutions!
aramisbackwards
Posts: 13
Joined: Tue Nov 29, 2016 1:48 am

Re: nrpe when host is down and accepting command line argume

Post by aramisbackwards »

The article you linked doesn't seem to cover the case where the server has a previous version but the clients have a newer version. In my case

check_nrpe nagios server: NRPE v2.15
check_nrpe remote hosts: NRPE vnrpe-3.0

That probably means there shouldn't be a problem just updating nrpe on the server right?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: nrpe when host is down and accepting command line argume

Post by tgriep »

You should be able to upgrade the check_nrpe check on the XI server but if the checks have issues contacting the remote sites running the older NRPE Agent, you will have to create commands for them like the KB article "NRPE - v3 Compatibility With Previous Versions" suggests.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked