when i try to run this command zabbix_get -s redis-master -k redis.ping, i was getting an error saying zabbix_get[11572]: Get value error: cannot resolve [redis-master]? what is this, how can i over come this
Ad Widget
Collapse
Discussion thread for official Zabbix Template Redis
Collapse
X
-
This seems to have been asked several times, but I have seen no definite answer yet. I configured several Redis instances on a test host, I can query all of them by
etc, but how do I monitor all of them on testhost? Should not the template discover the instances?Code:zabbix-get -s testhost -k 'redis.info[redis1] zabbix-get -s testhost -k 'redis.info[redis2]
Comment
-
hi guys, here is my solution.
For each Redis instance, i just add new host with different host-name on the same real HOST, then i adjust the "{$REDIS.CONN.URI}" macro to match with each instance name which configured in zabbix-agent2.conf.
Hope this can help you guys.Comment
-
Having installed the template (5.2 version) and checked with the current one, I would suggest to change the following:
toCode:item_prototypes: - name: 'Redis slave {#SLAVE_IP}:{#SLAVE_PORT}: Replication lag in bytes' type: DEPENDENT key: 'redis.replication.lag_bytes["{#SLAVE_IP}:{#SLAVE_PORT}"]' delay: '0' history: 7d units: B description: 'Replication lag in bytes' application_prototypes: - name: 'Redis: Slave {#SLAVE_IP}:{#SLAVE_PORT}' preprocessing: - type: JAVASCRIPT parameters: - | var repl = JSON.parse(value).Replication; var res = Object.keys(repl) .filter(function (v) {return v.match(/slave\d+/)}) .filter(function (v) {return (repl[v].ip === "{#SLAVE_IP}" && repl[v].port === "{#SLAVE_PORT}")}) .map(function (v) {return repl[v].offset})[0]; if (res === undefined) { throw 'Slave {#SLAVE_IP}:{#SLAVE_PORT} is no longer available.'; } return res; master_item: key: 'redis.info["{$REDIS.CONN.URI}"]'
Else the lag is not shown correctly. Works well for redis version 4.0.9 & Zabbix 5.2Code:item_prototypes: - name: 'Redis slave {#SLAVE_IP}:{#SLAVE_PORT}: Replication lag in bytes' type: DEPENDENT key: 'redis.replication.lag_bytes["{#SLAVE_IP}:{#SLAVE_PORT}"]' delay: '0' history: 7d units: B description: 'Replication lag in bytes' application_prototypes: - name: 'Redis: Slave {#SLAVE_IP}:{#SLAVE_PORT}' preprocessing: - type: JAVASCRIPT parameters: - | var repl = JSON.parse(value).Replication; var res_master = JSON.parse(value).Replication.master_repl_offset; var res_slave = Object.keys(repl) .filter(function (v) {return v.match(/slave\d+/)}) .filter(function (v) {return (repl[v].ip === "{#SLAVE_IP}" && repl[v].port === "{#SLAVE_PORT}")}) .map(function (v) {return repl[v].offset})[0]; if (res_slave === undefined) { throw 'Slave {#SLAVE_IP}:{#SLAVE_PORT} is no longer available.'; } res = res_master - res_slave return res; master_item: key: 'redis.info["{$REDIS.CONN.URI}"]'Comment
-
I think I found a concurrency issue when monitoring many (10+) redis using the multiple host method described by tanvlt
The Redis Ping tests seem to inconsistently get data. They will get no data for 10 to 45 minutes. I am going to look further into why this might be. Any Ideas?
(edit) I found out how it works but I still don't know why the template fails to gather the data when i run multiple hosts using methodology described above.
Real-time monitoring of IT components and services, such as networks, servers, VMs, applications and the cloud. - zabbix/zabbix
I was able to work around this by not using the template and creating a Redis Ping item for every Redis instance as individual items on the same Zabbix host. Then creating triggers to monitor these.
These check don't seem go offline for 10 to 45 minutes like the other ones mentioned.
IE
redis.ping[tcp://localhost:6378]
redis.ping[tcp://localhost:6379]
redis.ping[tcp://localhost:6380]
Last edited by gelowe; 16-09-2021, 15:19.Comment
-
Hello,
I hope that author is still checking this thread.
I used this template on several servers and it works nice.
Now I need to use for the servers behind zabbix proxy and no data are coming. The very same server that had a proper results is moved behind the proxy.
The other metrics are working as expected.
Logs are not so much helpful, only this entries:
Is there any other setting necessary ?HTML Code:Zabbix agent item "proc.num["{$REDIS.LLD.PROCESS_NAME}"]" on host "my-server" failed: first network error, wait for 15 secondsComment
-
Hello,
after upgrade from Zabbix 6.0 to Zabbix 6.4.2 I noticed that DB keys and Expires values are not collecting any more on all hosts with Agent2 Redis Template.
I imported 6.4 Template after upgrade without any luck.
Everything else is Working, all other data are collected.
Keystores are discovered.
Additional tests which I did:
I got info from command line: zabbix_agent2 -t "redis.info[Redis01]" -c /etc/zabbix/zabbix_agent2.conf - It should be stored in "Redis: Get info" Item
{"CPU":{"used_cpu_sys":"31.139694","used_cpu_sy s_c hildren":"0.000000","used_cpu_user":"40.104081","u sed_cpu_user_children":"0.000000"},"Clients":{"blo cked_clients":"0","client_recent_max_input_buffer" :"2",...........................
I used otput and tested "Redis: Get Keyspace info" Item Preprocessing which returned:
{"db5":{"expires":"262963","avg_ttl":"750169123 60" ,"keys":"262966"},"db6":{"expires":"534","avg_t tl" :"589570014","keys":"535"}}
it was OK
then I checked "DB db5: Get Keyspace info" and it looks WRONG !!!
It should have Master Item "Redis: Get info" instead of "Redis: Get Keyspace info" !!!
What to do to fix Template:
In Template -> Item "DB db5: Get Keyspace info" change Master Item from "Redis: Get Keyspace info" to "Redis: Get info"
I also added Memory Utilization Item in %, added Memory Utilization Graph and 2 Triggers for Memory Utilization.
Fixed and Upgraded Template is attached.Comment
-
Issue with Redis Item Graphs and Errors in Nginx/PHP Logs
Zabbix Version: 7.0.2
Problem Description:
I have configured the Redis template in Zabbix, and data collection works fine. However, when trying to generate any item graph for Redis, I encounter the following error:
HTML Code:incorrect value for field delay: invalid delay
Additionally, the Nginx logs show the following errors:
HTML Code:2024/12/03 11:43:37 [error] 2880636#2880636: *121309647 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "file" in /usr/share/zabbix/include/classes/debug/CProfiler.php on line 374; PHP message: PHP Warning: Undefined array key "line" in /usr/share/zabbix/include/classes/debug/CProfiler.php on line 374; PHP message: PHP Warning: Cannot modify header information - headers already sent in /usr/share/zabbix/include/classes/helpers/CCookieHelper.php on line 54; PHP message: PHP Warning: PHP Request Shutdown: Failed to write session data using user defined save handler. (session.save_path: /var/lib/php/sessions, handler: update_timestamp) in Unknown on line 0" while reading upstream, client: 10.18.140.130, server: zabbix.info, request: "GET /chart.php?from=now-1h&to=now&itemids%5B0%5D=903506&type=0&resolve_mac ros=1&profileIdx=web.item.graph.filter&profileIdx2 =903506&width=1734&height=200&_=wxx0rwj3 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "zabbix.info", referrer: "https://zabbix.info/history.php?itemids%5B0%5D=903506&action=showgraph "
Steps Taken So Far:- The Redis template has been checked — data collection is working without errors.
- The issue occurs only when generating graphs.
- PHP configuration: using php8.2-fpm, session.save_path is set correctly.
Questions:- What could be the cause of the error incorrect value for field delay: invalid delay?
I would greatly appreciate any advice or troubleshooting steps to resolve this issue.
Comment
-
-
Hey guys!
I have a problem with this redis plugin, please someone can help me?
I opened a thread about the problem, here is:
Comment
Comment