NRPE give error on web interface but CLI will return result

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.
wleming
Posts: 7
Joined: Fri Nov 06, 2015 9:37 am

Re: NRPE give error on web interface but CLI will return res

Post by wleming »

From running:

Code: Select all

XXXX@support:~$ grep nag /etc/passwd
I get

Code: Select all

list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
nagios:x:1001:1001::/home/nagios:/bin/bash
So by your question and my result it is safe to assume that a nagios user has not been created.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE give error on web interface but CLI will return res

Post by tgriep »

The 255 error is returned when the check_nrpe command cannot connect to a host on the local network.
In your check_nrpe command, you are using $HOSTNAME$ and the description for $HOSTNAME$ is
Short name for the host (i.e. "biglinuxbox"). This value is taken from the host_name directive in the host definition.
So if your server cannot resolve the hostname in DNS, that could be causing the error. Make sure the hostname can be resolved on the system.

Or if you want to use the IP address that is defined in the host.cfg file, you would have to edit the check_nrpe command in your commands.cfg file and change this line from

Code: Select all

command_line    $USER1$/check_nrpe -H $HOSTNAME$ -c $ARG1$
to

Code: Select all

command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
Restart nagios and that should work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
wleming
Posts: 7
Joined: Fri Nov 06, 2015 9:37 am

Re: NRPE give error on web interface but CLI will return res

Post by wleming »

That worked!

Thank you so much for the explanation here! Know after reading everything it makes sense.

Thank you very much again.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE give error on web interface but CLI will return res

Post by rkennedy »

Glad to see this worked! I will now close this thread out, but feel free to open another if you ever need assistance in the future!
Former Nagios Employee
Locked