Nagios Service Output Displays Random Numbers

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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Service Output Displays Random Numbers

Post 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.
tps27
Posts: 9
Joined: Tue Jun 06, 2017 10:18 am

Re: Nagios Service Output Displays Random Numbers

Post 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?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Service Output Displays Random Numbers

Post 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).
tps27
Posts: 9
Joined: Tue Jun 06, 2017 10:18 am

Re: Nagios Service Output Displays Random Numbers

Post 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?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Service Output Displays Random Numbers

Post 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?
tps27
Posts: 9
Joined: Tue Jun 06, 2017 10:18 am

Re: Nagios Service Output Displays Random Numbers

Post 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?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Service Output Displays Random Numbers

Post 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  
Be sure to check out our Knowledgebase for helpful articles and solutions!
tps27
Posts: 9
Joined: Tue Jun 06, 2017 10:18 am

Re: Nagios Service Output Displays Random Numbers

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Service Output Displays Random Numbers

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Service Output Displays Random Numbers

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked