Configure check_redis.pl

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
alajangi
Posts: 5
Joined: Mon Jun 24, 2013 10:13 pm

Configure check_redis.pl

Post by alajangi »

Hi Experts,

I want to monitor redis on remote system, when I run the command mentioned below in nagios server it works fine, but I have no luck in configuring nagios configuration files to see in nagios web ui, the result its showing is as shown below, please help me how to configure.

When I run # /usr/local/nagios/libexec/WL-NagiosPlugins/check_redis.pl -H x.x.x.x -p xxxx from command line, the result is
OK: REDIS 2.8.6 on x.x.x.x:xxxx has 2 databases (db0,db15) with 1094 keys, up 16 days 17 hours

But when I configured in nagios configuration files to monitor the result is

Current Status:
UNKNOWN
(for 0d 14h 59m 12s)
Status Information: Total memory value $ can not be interpreted
Usage: /usr/local/nagios/libexec/WL-NagiosPlugins/check_redis.pl [-v [debugfilename]] -H <host> [-p <port>] [-x password
Performance Data: -C credentials_file] [-D <database>] [-a <statistics variables> -w <variables warning thresholds> -c <variables critical thresholds>] [-A <performance output variables>] [-T [conntime_warn,conntime_crit]] [-R [hitrate_warn,hitrate_crit]] [-m [mem_utilization_warn,mem_utilization_crit] [-M <maxmemory>[B|K|M|G]]] [-r replication_delay_time_warn,replication_delay_time_crit] [-f] [-T <timeout>] [-V] [-P <previous performance data in quoted string>] [-q (GET|LLEN|HLEN|SLEN|ZLEN|HGET:name|HEXISTS:name|SEXISTS:name|LRANGE:(AVG|SUM|MIN|MAX):start:end|ZRANGE:(AVG|SUM|MIN|MAX):start:end),query_type,query_key_name[:data_name][,ABSENT:WARNING|CRITICAL][,WARN:threshold,CRIT:threshold]] [-o <threshold specification with name or pattern>] For more details on options do: /usr/local/nagios/libexec/WL-NagiosPlugins/check_redis.pl --help

My configuration files looks

# vi /usr/local/nagios/etc/objects/localhost.cfg

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
}

define service{
use local-service,graphed-service ; Name of service template to use
host_name localhost
service_description Redis Monitoring
check_command check_redis!xxxx!"1,2"!"80,90"!blocked_clients,connected_clients!50,~!100,~
notifications_enabled 0
}
# vi /usr/local/nagios/etc/objects/commands.cfg

define command{
command_name check_redis
command_line $USER1$/WL-NagiosPlugins/check_redis.pl -H x.x.x.x -p xxxx -T $ARG2$ -R -A -M $_HOSTSYSTEM_MEMORY$ -m $ARG3$ -a $ARG4$ -w $ARG5$ -c $ARG6$ -f -P "$SERVICEPERFDATA$"
}

Thanks,
Kishore.
Last edited by alajangi on Wed Apr 16, 2014 9:02 am, edited 1 time in total.
alajangi
Posts: 5
Joined: Mon Jun 24, 2013 10:13 pm

Re: Configure check_redis.pl

Post by alajangi »

could anybody help me on this, atleast tell me in which group i could get the solution fast.

Thanks,
Kishore.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configure check_redis.pl

Post by abrist »

alajangi wrote:Status Information: Total memory value $ can not be interpreted
It looks like your custom macro is not getting populated. Where do you set: $_HOSTSYSTEM_MEMORY$ ?
I don't see the macro declared on any of your objects. . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
alajangi
Posts: 5
Joined: Mon Jun 24, 2013 10:13 pm

Re: Configure check_redis.pl

Post by alajangi »

Excellent Abris, the problem is solved when I Set _SYSTEM_MEMORY '8G'
in vi /usr/local/nagios/etc/objects/localhost.cfg

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
_SYSTEM_MEMORY '8G'
}
Thanks,
Kishore.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configure check_redis.pl

Post by abrist »

Great! I am locking the thread up. Cheers.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked