Page 1 of 2
NRPE: Command 'check_mem' not defined
Posted: Wed Oct 02, 2019 7:16 am
by mahtabalam
I have installed NRPE in my server and created check_mem command in nrpe,cfg
The command is :
command[check_mem]=/usr/lib64/nagios/plugins/check_mem.sh -w 80 -c 90
Now when I create a active check in my nagios core which is
define service {
use vps-monitor ; Name of service template to use
host_name xxxxxxxx, xxxxxxxx
service_description RAM Memory
check_command check_nrpe!check_mem
}
it gives the output like below :
NRPE: Command 'check_mem' not defined
What should I do now?
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Oct 02, 2019 7:20 am
by scottwilkerson
Did you restart the nrpe service after modifying the nrpe.cfg?
If so can you show the output of
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Oct 09, 2019 2:49 am
by mahtabalam
scottwilkerson wrote:Did you restart the nrpe service after modifying the nrpe.cfg?
If so can you show the output of
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Oct 09, 2019 10:28 am
by scottwilkerson
Ok, also show the output of
Code: Select all
grep check_mem /etc/nagios/nrpe.cfg
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 11:20 am
by vkodanam
Hi, I've similar issue. I wanted to monitor the memory of the remote server, I've placed the check_mem.sh on the remote server at /usr/lib/nagios/plugins. Added the command command[check_mem]=/usr/local/nagios/libexec/check_mem.sh 85 95 to nrpe.conf on the remote server. And when I test it from the Nagios server, i still get the command not defined error. The check_mem.sh has appropriate permissions, Nagios server has access to the remote server, I'm able to run other check such as check_load without any problem. What am I doing wrong?:
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 11:37 am
by scottwilkerson
vkodanam wrote:Hi, I've similar issue. I wanted to monitor the memory of the remote server, I've placed the check_mem.sh on the remote server at /usr/lib/nagios/plugins. Added the command command[check_mem]=/usr/local/nagios/libexec/check_mem.sh 85 95 to nrpe.conf on the remote server. And when I test it from the Nagios server, i still get the command not defined error. The check_mem.sh has appropriate permissions, Nagios server has access to the remote server, I'm able to run other check such as check_load without any problem. What am I doing wrong?:
Did you restart nrpe after adding the command?
Can you show the output of the following on the remote server?
What command are you using from the Nagios server?
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 12:02 pm
by vkodanam
scottwilkerson wrote:vkodanam wrote:Hi, I've similar issue. I wanted to monitor the memory of the remote server, I've placed the check_mem.sh on the remote server at /usr/lib/nagios/plugins. Added the command command[check_mem]=/usr/local/nagios/libexec/check_mem.sh 85 95 to nrpe.conf on the remote server. And when I test it from the Nagios server, i still get the command not defined error. The check_mem.sh has appropriate permissions, Nagios server has access to the remote server, I'm able to run other check such as check_load without any problem. What am I doing wrong?:
Did you restart nrpe after adding the command?
Can you show the output of the following on the remote server?
What command are you using from the Nagios server?
The output for ps -ef|grep nrpe:
Code: Select all
ps -ef|grep nrpe
nagios 1548 1 0 Oct29 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
root 27449 25523 0 11:52 pts/0 00:00:00 grep --color=auto nrpe
Code: Select all
grep check_mem /etc/nagios/nrpe.cfg
Code: Select all
command[check_mem]=/usr/local/nagios/libexec/check_mem.sh 85 95
#command[check_mem]=/usr/lib/nagios/plugins/custom_check_mem -n $ARG1$
command used on the Nagios server :
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.xx.xx -c check_mem
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 12:16 pm
by scottwilkerson
Several problems, you said you put the plugin at
/usr/lib/nagios/plugins but your command path you set is
/usr/local/nagios/libexec/check_mem.sh That would be incorrect.
Also, based on this, nrpe hasn't been restarted and has been running since Oct29
Code: Select all
nagios 1548 1 0 Oct29 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
You need to restart nrpe for changes to take affect
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 2:55 pm
by vkodanam
scottwilkerson wrote:Several problems, you said you put the plugin at
/usr/lib/nagios/plugins but your command path you set is
/usr/local/nagios/libexec/check_mem.sh That would be incorrect.
Also, based on this, nrpe hasn't been restarted and has been running since Oct29
Code: Select all
nagios 1548 1 0 Oct29 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
You need to restart nrpe for changes to take affect
Sorry, looks like I've given the wrong path for where I've had placed the check_mem.sh script. I've restarted the nrpe service a couple of times and its till showed Oct 29. I had to force kill and reboot the VM. Now, I get the error Unable to read the output.
Command on NRPE.cfg is command[check_mem]=/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
Re: NRPE: Command 'check_mem' not defined
Posted: Wed Nov 20, 2019 3:08 pm
by scottwilkerson
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