Closed cmmata closed 6 years ago
Very strange, provided JSON is fully valid, take a look
echo '{"data":[{"{#HOST}":"127.0.0.1","{#PORT}":"6379","{#INSTANCE}":"REDIS","{#RDB_PATH}":"/var/lib/redis/dump.rdb"}]}' | jq . { "data": [ { "{#HOST}": "127.0.0.1", "{#PORT}": "6379", "{#INSTANCE}": "REDIS", "{#RDB_PATH}": "/var/lib/redis/dump.rdb" } ] }
Any update? Considered as resolved.
Sorry, I had two very busy weeks at work and couldn't take another look at this. I have updated to the last version both the template in Zabbix web interface and the repository in the server path, and it's still the same. Value should be a JSON object
, although zbx_redis_discovery.sh general | jq .
outputs a valid JSON. How can I debug the process? Or do you know where can I look to find what's wrong?
please provide an output from following command:
zabbix_get -s YOUR_SERVER_NAME -k redis.discovery[general]
The command should be invoked from zabbix server or proxy.
Also it will be good to run following command under zabbix user on host itself where u try to discover redis instances:
zabbix_agentd -t redis.discovery[general]
Found it! I was getting a permission denied
error. I didn't know how to check from command line. The output was
$ zabbix_get -s SERVER_NAME -k "redis.discovery[general]"
{"data":[/etc/zabbix/scripts/zabbix-redis-template/zabbix_agentd.d/zbx_redis_discovery.sh: line 184: /tmp/redis-127.0.0.1-6379: Permission denied
The problem was that /tmp/redis-127.0.0.1-6379
file was created with root user / group
$ ls -l
-rw-rw-r-- 1 root root 3475 oct 17 10:06 redis-127.0.0.1-6379
-rw-rw-r-- 1 root root 6 oct 17 10:06 redis-127.0.0.1-6379-maxclients
-rw-rw-r-- 1 root root 2 oct 17 10:06 redis-127.0.0.1-6379-slowlog-len
-rw-rw-r-- 1 root root 1 oct 17 10:06 redis-127.0.0.1-6379-slowlog-raw
I changed group to redis
and added zabbix
user, and now it's working.
$ zabbix_get -s SERVER_NAME -k "redis.discovery[general]"
{"data":[{"{#HOST}":"127.0.0.1","{#PORT}":"6379","{#INSTANCE}":"REDIS","{#RDB_PATH}":"/var/lib/redis/dump.rdb"}]}
Thank you for your help! And of course for your work :)
Great thanks, considered resolved.
Hello,
I have installed your template, and I don't understand why it's not working.
Discover Redis Commands
andDiscover Redis Slaves
are working correctly, butDiscover Redis Instances
shows asNot supported
in Zabbix. The error message isValue should be a JSON object.
, but the output looks like a valid JSON.Here is my debug
I don't know if it's related, but I see
REDIS_MAX_CLIENTS
is blank in output message. If I execute the command I see there in the command line, it worksWhat can be wrong in my setup?
Thanks