Lane
Lane

Reputation: 1

Nagios, custom plugin doesn't work

Please, help! I can't handle the check_mem.sh plugin https://exchange.nagios.org/directory/Plugins/System-Metrics/Memory/Check-mem-%28by-Nestor%40Toronto%29/details

I used all guids which found, in nagios web-interface i see this "(No output returned from plugin)".

If I use this command local on remote machine all going fine:

root@ubuntu:/home/test0# /usr/local/nagios/libexec/check_mem.sh -w 80 -c 90
Memory: CRITICAL Total: 975 MB - Used: 937 MB - 96% used!|TOTAL=975;;;; USED=937;;;; CACHE=221;;;; BUFFER=14;;;;

In nrpe.cfg i wrote this:

command[check_mem]=/usr/local/nagios/libexec/check_mem.sh -w 80 -c 90

In Nagios-server test0.cfg (config file of remote machine) i wrote this:

define service {
 use                        generic-service
 host_name                  test0
 service_description        Memory Usege1
 check_command              check_nrpe!check_mem
}

In commands.cfg this:

define command{
 command_name   check_mem
 command_line   $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_mem 
}

Nrpe on remote machine works fine:

root@ubuntu:/etc/nagios-plugins/config# /usr/lib/nagios/plugins/check_nrpe -H 192.168.239.136
NRPE v2.15

When i use this command from nagios-server machine all looks fine:

root@ubuntu:/usr/lib/nagios/plugins# /usr/lib/nagios/plugins/check_nrpe -H 192.168.239.136 -c check_mem
Memory: WARNING Total: 975 MB - Used: 850 MB - 87% used!|TOTAL=975;;;; USED=850;;;; CACHE=305;;;; BUFFER=44;;;;

But in web-interface still problem

Sorry for bad english :)

Upvotes: 0

Views: 508

Answers (1)

Lane
Lane

Reputation: 1

I don't know which of these steps solved my problem, but it works!

  1. chmod +x to check_mem.sh
  2. i deleted the service description from test0.cfg
  3. added service description to services_nagios2.cfg with hostgroup debian-servers
  4. restarted service nagios3

Upvotes: 0

Related Questions