Page 2 of 3

Re: Nagios Service Output Displays Random Numbers

Posted: Wed Jun 07, 2017 2:48 pm
by dwhitfield
Thanks smith!

Also, please show us the check_nrpe command you are running for Core along with the output.

It's possible you'll find https://assets.nagios.com/downloads/nag ... e/NRPE.pdf useful.

Re: Nagios Service Output Displays Random Numbers

Posted: Wed Jun 07, 2017 3:09 pm
by tps27
Okay, I will try that. I ran cat for /etc/passwd and nagios is listed as:

Code: Select all

nagios:x:123:131::/var/lib/nagios:/bin/false
^On the remote machine

Could this have any affect on the issue?

Re: Nagios Service Output Displays Random Numbers

Posted: Wed Jun 07, 2017 3:51 pm
by dwhitfield
The following is the format I would like to see:

Code: Select all

root@nagios:/usr/local/nagios/libexec# ./check_nrpe -H REMOTEHOST -c inxi
output
Also, there's nothing referencing inxi in your nrpe.cfg, so that will need to be corrected.

Yes, the nagios user should have /bin/bash (or wherever bash is installed).

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 8:48 am
by tps27
I cannot su in the nagios user, after I entered its password I remain as the same user. Do I need to install Nagios Core on the remote machine? Or do I just need to add a user named nagios?

Also, is the line you created what I should have for the nagios command?

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 10:53 am
by dwhitfield
You need to change nagios:x:123:131::/var/lib/nagios:/bin/false to nagios:x:123:131::/var/lib/nagios:/bin/bash, or, again, wherever bash is installed. What is the output of which bash?

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 11:08 am
by tps27
The output is /bin/bash

How would I go about changing nagios:x:123:131::/var/lib/nagios:/bin/false to nagios:x:123:131::/var/lib/nagios:/bin/bash?

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 2:41 pm
by tgriep
You could run this command as root to change nagios login shell to /bin/bash.

Code: Select all

chsh -s /bin/bash nagios  

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 2:45 pm
by tps27
Thanks @tgriep, change successful.

@dwhitfield where do you want to see this?

Code: Select all

root@nagios:/usr/local/nagios/libexec# ./check_nrpe -H REMOTEHOST -c inxi
output

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 3:00 pm
by tgriep
I think he wants you to run the command on the Nagios server and replace REMOTEHOST with the IP address on the system you want to run the inxi command.
One thing, I did not see the command defined in the nrpe.cfg file. Did you define it in another config file?

Re: Nagios Service Output Displays Random Numbers

Posted: Thu Jun 08, 2017 3:14 pm
by tgriep
The inxi command is printing out different colors for the text and that is causing the issue.
Edit your command and add the following option to the command that is defined in nrpe and that should fix the issue.

Code: Select all

-c 0
The -c 0 option sets the color scheme to none.