Re: specify port on check_memcached.pl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 24/05/2015 15:36, Tim Dunphy wrote:
Hey guys,


I'm trying use check_memcached.pl to monitor a couple of memcached services
running on two ports.


I have my command definition setup like this:

# 'check_memcached' command definition

define command {

command_name check_memcached

command_line $USER1$/check_memcached.pl -H $HOSTADDRESS$ -p $ARG1$

}


And I have my service definitions setup like this:


# Define a service to check memcached on web1 (just the basics for right
now).


define service{

         use                             local-service         ; Name of
service template to use

         host_name                       web1

         service_description             Check Memcached 11211

         contact_groups                  linux-admins

         check_command                   check_memcached!web1.example.com
!11211

         notifications_enabled           1

         }


# Define a service to check memcached on web1 (just the basics for right
now).


define service{

         use                             local-service         ; Name of
service template to use

         host_name                       web1

         service_description             Check Memcached 11212

         contact_groups                  linux-admins

         check_command                   check_memcached!web1.example.com
!11212

         notifications_enabled           1

         }

And if I run both checks manually they succeed:

[root@monitor1:/usr/local/nagios/etc/objects/servers] #../../../libexec/
check_memcached.pl  -H web1.example.com -p 11211

MEMCACHE OK: memcached 1.4.22 on web1.example.com:11211, up 22 minutes 52
seconds

[root@monitor1:/usr/local/nagios/etc/objects/servers] #../../../libexec/
check_memcached.pl  -H web1.example.com -p 11212

MEMCACHE OK: memcached 1.4.22 on web1.example.com:11212, up 12 minutes 2
seconds

Yet, in my nagios web interface, I'm getting this error:


       Check Memcached 11211
<https://nagios.jokefire.com/nagios/cgi-bin/extinfo.cgi?type=2&host=web1&service=Check+Memcached+11211>


    CRITICAL

05-24-2015 14:28:31

0d 0h 10m 19s

4/4

CRITICAL ERROR - Can not connect to '162.243.60.6' on port 0


       Check Memcached 11212
<https://nagios.jokefire.com/nagios/cgi-bin/extinfo.cgi?type=2&host=web1&service=Check+Memcached+11212>


    CRITICAL

05-24-2015 14:29:12

0d 0h 11m 8s

4/4

CRITICAL ERROR - Can not connect to '162.243.60.6' on port 0


I thought I could specify the command in the service definition like this:

check_memcached!web1.example.com!11211

To reproduced the command as it's executed on the command line. How can I
specify the port correctly here?


Thanks,

Tim



Hi Tim,

Your command specification is wrong. It will get the -H attribute from the host_name you should not specify it on the check_command and By doing so what you have effectively done is write:
check_memcached.pl  -H web1.example.com -p web1.example.com 11211
if you enable debug_level=2048 you should be able to see the commands that Nagios is creating.

Tris


*************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@xxxxxxxx

The views expressed within this email are those of the individual, and not necessarily those of the organisation
*************************************************************
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux