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!scottwilkerson wrote:You have changed the path and the arguments in the different commands you have shown
if this is in /etc/nagios/nrpe.cfgCan you run that from the command line on the remote server?vkodanam wrote:Code: Select all
command[check_mem]=/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
can you also show again the output ofCode: Select all
/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
Code: Select all
ps -ef|grep nrpe
NRPE: Command 'check_mem' not defined
Re: NRPE: Command 'check_mem' not defined
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
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
and that is the user/group that will be used
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
I also want to note that earlier you showed this
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....Code: Select all
ps -ef|grep nrpe nagios 1548 1 0 Oct29 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f