1

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

2
  • are you running the plugin manually as the nagios (or nrpe) user?
    – Keith
    Oct 20, 2016 at 18:07
  • Both: manually on the Nagios core and through Nagios-Nrpe; they gives the output mentioned above.
    – l3_08
    Oct 20, 2016 at 18:37

2 Answers 2

0

Sounds like that plugin is crap. There are at least a dozen different check_memory variants out there.

Perhaps try this one.

1
  • I changed the plugin and things worked just fine. Wonder how it works on different boxes . Anyways, thanks for the tip.
    – l3_08
    Oct 24, 2016 at 14:12
0

Your command definition in NRPE seems wrong

command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10

Since check_mem does not seem to have a -f argument.

On the other side, check_mem seems to exit with 0 on wrong arguments, which is not a good behavior for Nagios plugins... (the should exit with 3 - UNKNOWN)

Nagios / Icinga only gets the "status" from the command's return code, the output is merely information for the user.

1
  • I tried removing the -f from the command and tried other arguments still no change. I'm not sure why would it work on 3 other remotes but not this one. Even with the same plugin, I copied the same file from the working one to this one and same results. Do you think there is a package or something missing on the server? I noticed different outputs on this one though...
    – l3_08
    Oct 20, 2016 at 12:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .