Page 2 of 2

Re: NRPE: Command 'check_mem' not defined

Posted: Thu Nov 21, 2019 9:19 am
by vkodanam
scottwilkerson wrote:You have changed the path and the arguments in the different commands you have shown
if this is in /etc/nagios/nrpe.cfg
vkodanam wrote:

Code: Select all

command[check_mem]=/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
Can you run that from the command line on the remote server?

Code: Select all

/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
can you also show again the output of

Code: Select all

ps -ef|grep nrpe
I got it to work by using another perl script. One question I do have is, when I restart the Nrpe service using the service xinetd start/ restart, it only starts the process under root/ logged in user and not under Nagios. I tried su into Nagios while I was root, and when I run the command it asks me for password for Nagios, which I know is not set. I hit return/ enter, and it says access denied. How can I fix this? Thanks for your help!

Re: NRPE: Command 'check_mem' not defined

Posted: Thu Nov 21, 2019 9:45 am
by scottwilkerson
If you have it running under xinetd, xinetd runs as root, but it will use the user you define in the xinetd configuration file for nrpe when launching the process

This file is usually located in /etc/xinetd.d/nrpe

In that file you should see something like

Code: Select all

        user            = nagios
        group           = nagios
and that is the user/group that will be used

Re: NRPE: Command 'check_mem' not defined

Posted: Thu Nov 21, 2019 9:47 am
by scottwilkerson
I also want to note that earlier you showed this

Code: Select all

ps -ef|grep nrpe
nagios    1548     1  0 Oct29 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
Which means this process was started a different way (other than xinetd), so you need to make sure you don't have 2 processes competing for the same port....