I'm trying to check the system memory by using check_memory.pl and the following command setup:
In the nrpe.cfg on the remote host
command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10
Service on the Nagios server:
define service{
use generic-service
host_name Hostname ;winserver
service_description Check Memory
check_command check_nrpe!check_mem
}
When I run the command on the remote host like this
/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10
I get:
OK - 73.6% (6013416 kB) free.|TOTAL=8175616KB;;;; USED=2162200KB;6540492;7358054;; FREE=6013416KB;;;; CACHES=2021812KB;;;;
When I run
/usr/local/nagios/libexec/check_nrpe -H host-ip -c check_mem
or
/usr/local/nagios/libexec/check_nrpe -H host-ip -c check_mem -a -w 20 -c 10
or any list of args
I receive :
Wrong Syntax: custom_check_mem
Usage: custom_check_mem [-w|--warning]<percent free> [-c|--critical]<percent free>
but the Web is showing Service is OK and a message like this:
(No output returned from plugin)
Wrong Syntax: custom_check_mem
Usage: custom_check_mem [-w–warning] [-c|–critical]
I tried this plugin on other servers it work well but I don't do what is missing in the setup for this one.
Any help is appreciated. Thanks
Best Answer
Sounds like that plugin is crap. There are at least a dozen different
check_memory
variants out there.Perhaps try this one.