NRPE: Command 'check_mem' not defined
-
- Posts: 9
- Joined: Mon Sep 23, 2019 1:30 am
NRPE: Command 'check_mem' not defined
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?
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?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
Did you restart the nrpe service after modifying the nrpe.cfg?
If so can you show the output of
If so can you show the output of
Code: Select all
ps -ef|grep nrpe
-
- Posts: 9
- Joined: Mon Sep 23, 2019 1:30 am
Re: NRPE: Command 'check_mem' not defined
scottwilkerson wrote:Did you restart the nrpe service after modifying the nrpe.cfg?
If so can you show the output ofCode: Select all
ps -ef|grep nrpe
- Attachments
-
- Screenshot from 2019-10-09 13-48-15.png (11.44 KiB) Viewed 3604 times
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
Ok, also show the output of
Code: Select all
grep check_mem /etc/nagios/nrpe.cfg
Re: NRPE: Command 'check_mem' not defined
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?:
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
Did you restart nrpe after adding the command?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?:
Can you show the output of the following on the remote server?
Code: Select all
ps -ef|grep nrpe
Re: NRPE: Command 'check_mem' not defined
scottwilkerson wrote:Did you restart nrpe after adding the command?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?:
Can you show the output of the following on the remote server?What command are you using from the Nagios server?Code: Select all
ps -ef|grep nrpe
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$
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.xx.xx -c check_mem
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
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
You need to restart nrpe for changes to take affect
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
Re: NRPE: Command 'check_mem' not defined
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.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 Oct29You need to restart nrpe for changes to take affectCode: Select all
nagios 1548 1 0 Oct29 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
Command on NRPE.cfg is command[check_mem]=/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
You have changed the path and the arguments in the different commands you have shown
if this is in /etc/nagios/nrpe.cfg
can you also show again the output of
if this is in /etc/nagios/nrpe.cfg
Can 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
Code: Select all
/usr/local/nagios/libexec/check_mem.sh -w 85 -c 95
Code: Select all
ps -ef|grep nrpe