1. Adding cron Jobs
Find/-name REDIS-CLI
Using Crontab–e, add the following line to the cron configuration file:
*/1 * * * */USR/LOCAL/BIN/REDIS-CLI info >/tmp/redis.stat
Note: The performance data for the default port is obtained via REDIS-CLI, other similar.
2, Configuration Zabbix-agent
Edit/etc/zabbix/zabbix_agentd.conf, locate the following configuration information, and edit:
Unsafeuserparameters=1
Userparameter=redis.stat[*],cat/tmp/redis.stat | grep "$:" | Cut-d ":"-f2
Note: Unsafeuserparameters=1 is a command that allows Zabbix-agent to run userparameter with root privileges, userparameter is a way for Zabbix to provide extended performance data, multiple definitions can exist, Each definition corresponds to a
Performance data, followed by the command for each performance extract, and the corresponding performance counter name is passed over.
3. Data acquisition Process Verification
Once the above configuration is complete, it is necessary to check whether the environment is normal and whether the performance data can be loaded and passed properly.
1, Cron link
Cat/tmp/redis.stat
2. Zabbix-agent Link
Zabbix_agentd-t Redis.stat[hits]
3. Zabbix-server Link
Zabbix_get-s 127.0.0.1-k Redis.stat[hits]
Note: 1 and 2 run on Zabbix-agent machines and 3 run on the machine where the Zabbix-server is located. ZABBIX_GET–S Specifies the machine where the zabbix-agent is located.
Ps:
As root setup a cronjob:
* * * * * */USR/BIN/REDIS-CLI info >/tmp/redisstat
ADD a user parameter to Zabbix:
Userparameter=redis.stat[*],cat/tmp/redisstat | grep "$:" | Cut-d ":"-f2
Official Research documents: https://github.com/blacked/zbx_redis_template
This article is from the "joy1991" blog, make sure to keep this source http://joy1991.blog.51cto.com/8359406/1688998
Zabbix for Redis Monitoring