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

NRPE give error on web interface but CLI will return result

Post by wleming »

Hello everyone and thank you for your time.

My nagios core 4.1.1 server is running on Ubuntu 14.04 and was compiled from source.

Client I am trying to monitor is running Ubuntu 14.04 and the NRPE package was used.

I created a command to check the state of the chrome web browser in /etc/nagios/nrpe.cfg command

Code: Select all

[check_chrome]=/usr/lib/nagios/plugins/check_procs -C chrome
On the nagios server I can run

Code: Select all

 ./check_nrpe -H 10.0.4.44 -c check_ chrome 
and I get the return

Code: Select all

PROCS OK: 4 processes with command name 'chrome' | procs=4;;;0;
Which is exactly what I want-BUT on the web interface I get

Code: Select all

(Return code of 255 is out of bounds)
On the nagios server I have the service in the configuration files as

Code: Select all

 
define host {
        use                             linux-server
        host_name                       <NOT REAL NAME>
        alias                            Room 102
        address                         10.0.4.44
        hostgroups                      XXX
        max_check_attempts              5
        check_period                    24x7
        notification_interval           30
        notification_period             24x7
}



        define service{
        use                             local-service
        host_name                       <NOT REAL NAME>
        service_description             Check Chrome 
        check_command                   check_nrpe!check_chrome
        check_interval                  1
        }
So I am confused as to why I can use the check_nrpe on the CLI, but when I try via the web interface I get an error. Can someone please point me in the correct direction? Thank you again for your time.
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 »

Could you post how your check_nrpe command is defined in your commands.cfg file on your Nagios server?
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 »

Yes, sorry for not including that.

Code: Select all

######### 'check_nrpe' command definition
define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTNAME$ -c $ARG1$
Thank you very much.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Can you try to run the same command from the command line as the 'nagios' user? I am assuming you ran the first check as root?
Former Nagios Employee.
me.
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 »

I will investigate this. For now I have been running as an admin user that has root settings.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Let us know what you come up with.

Thanks!
Former Nagios Employee.
me.
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 »

I don't have a set "nagios" user. I just compiled from source and made the "nagiosadmin" as in the instructions. Should I add this to the users of the system as well? Would this not create a possible security issue of having a user with "admin" rights?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Can I see what instructions you used?
Former Nagios Employee.
me.
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 »

These were the instructions that my co-worker used:

https://www.digitalocean.com/community/ ... untu-14-04
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-ubuntu-14-04 wrote: sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
What is the out put of a grep nag /etc/passwd command?
Former Nagios Employee.
me.
Locked