Page 1 of 1

Check_redis HGET command

Posted: Thu Aug 28, 2014 10:05 am
by Hvalls
Hello,

I'm wondering if anyone has tried the HGET command with check_redis plugin. It's the first time I use it, as well as redis DB and I'm having problems to get data from it, here is what I'm trying to do:

./check_redis.pl -H MY_IP -D 0 --query HGET:input,16:name,ABSENT:WARNING,WARN:4,CRIT:5,DISPLAY:YES,PERF:NO

And the result:
WARNING: name data is missing - REDIS 2.8.4 on 192.168.50.89:6379 has 1 databases (db0) with 40 keys, up 3 hours 5 minutes

Checking the help I'm seeing this order:
HGET:name,query_type,query_key_name[:data_name][,ABSENT:WARNING|CRITICAL][,WARN:threshold,CRIT:threshold]]

But no matter how I put it it just doesn't find any data. Here is the data I want to obtain and compare: (from Redis server)
127.0.0.1:6379> hget "input:16" name
"3"

So there is indeed data in that key, but I'm doing it wrong somehow and I can't find where.

Many thanks in advance!!

Re: Check_redis HGET command

Posted: Thu Aug 28, 2014 1:25 pm
by slansing
Looks like you need something similar to your manual query:

hget "input:16" name
HGET:name,query_type,query_key_name[:data_name]
Try:

Code: Select all

./check_redis.pl -H MY_IP -D 0 --query HGET:name,input,16:name,ABSENT:WARNING,WARN:4,CRIT:5,DISPLAY:YES,PERF:NO
The plugin may expect that data in a slightly different fashion, you can immediately see the difference when you look at your command as opposed to your help output. I don't know how your hget's are structured, but that looks like the right track.

Re: Check_redis HGET command

Posted: Fri Aug 29, 2014 1:51 am
by Hvalls
Hi!

First of all thanks for answering. The thing is that I already tried several ways to put it, and this particular one gives me this answer:

Can not parse. Unknown threshold specification: 16:name,ABSENT:WARNING,WARN:4,CRIT:5,DISPLAY:YES,PERF:NO Threshold line should be either both warning and critical thresholds separated by ',' or new format of: WARN:threshold,CRIT:threshold,ABSENT:OK|WARNING|CRITICAL|UNKNOWN which allows to specify all 3 (CRIT,WARN,ABSENT) or any one of them in any order.

The usage is as follows:

Usage: ./check_redis.pl [-v [debugfilename]] -H <host> [-p <port>] [-x password | -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>]

So I need to identify:
HGET:name
query_type
query_key_name[:data_name]

I order to get it like you said:
./check_redis.pl -H <host> [-D <database>] [-q HGET:name,query_type,query_key_name[:data_name][,WARN:threshold,CRIT:threshold]]

But still it seems I'm unable to get it righ.

Thanks again!

Re: Check_redis HGET command

Posted: Fri Aug 29, 2014 4:04 am
by Hvalls
Hello,

First of all many thanks for your answer, but still no good results. I've tried several combinations and there is no way to get it working. I've tried as well to use a GET, because there is an example in the --help with it, and i'm not geting the right respone:

Command
./check_redis.pl -H MY_IP -D 0 -q GET,nodes:1,ABSENT:CRITICAL

In the example you can see: --query GET,MyKey:K1,ABSENT:CRITICAL
Respone:
CRITICAL: 1 data is missing - REDIS 2.8.4 on 192.168.50.89:6379 has 1 databases (db0) with 40 keys, up 21 hours 5 minutes

So I'm not sure if I'm doing something else wrong.

Many thanks!

Re: Check_redis HGET command

Posted: Tue Sep 02, 2014 4:32 pm
by sreinhardt
This last one is definitely communicating with the DB, I think the reason it gave you a warning was the 1 chunk missing, and that there was no warning\critical values it should use. It likely defaults to give a warning\critical if there are any errors in the result and no warning\critical thresholds have been set. I would suggest trying the same command but something like:

Code: Select all

./check_redis.pl -H MY_IP -D 0 -q GET,nodes:1,ABSENT:CRITICAL,WARN:5,CRIT,10

Re: Check_redis HGET command

Posted: Wed Sep 03, 2014 3:12 am
by Hvalls
Hello!

Thanks for you answer, I've already tried it with tresholds, but the ABSENT is always there, so for some reason it is not sending the correct check:

[root@localhost libexec]# ./check_redis.pl -H MY_IP -D 0 -q GET,nodes:1,ABSENT:CRITICAL,WARN:5,CRIT:10
CRITICAL: 1 data is missing - REDIS 2.8.4 on 192.168.50.89:6379 has 1 databases (db0) with 40 keys, up 5 days 20 hours

Data is always missing although there is data in that nodes:1 KEY, or any other KEY I try no matter if it's a hash, a string, an integer etc.

Many thanks for your help though!

Re: Check_redis HGET command

Posted: Thu Sep 04, 2014 4:57 pm
by Nagios Support
We're going to have to do some digging on this issue and will get back to you within 24 hours.

Re: Check_redis HGET command

Posted: Fri Sep 05, 2014 10:56 am
by slansing
Hello Hvalls,

We've looked at the code a bit and can't pin down why your returns are always coming in as critical. At this point, we're going to recommend you try to contact the developer of this plugin as it was not created, nor is it maintained, by us. We know the developer and he should be pretty good at responding to your questions, his information is located on the exchange listing here:

http://exchange.nagios.org/directory/Pl ... pl/details