Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to monitor redis status through zabbix under centos7

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to monitor redis status through zabbix under centos7". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to monitor redis status through zabbix under centos7".

Prepare for

Prepare two servers first, zabbix-sever and zabbix-agent have been deployed

Zabbix-server 192.168.1.70 centos7.2

Zabbix-agent 192.168.1.70 centos7.2

Install and deploy redis on the zabbix-agent side

The deployment process of redis will not be introduced. After Baidu has installed a lot of redis, use the redis info command to check the redis information.

[root@localhost zabbix_agentd.d] # redis-cli-an ac123456 info# Serverredis_version:4.0.6redis_git_sha1:00000000redis_git_dirty:0redis_build_id:c69914497129c95credis_mode:standaloneos:Linux 3.10.0-693.el7.x86_64 x86_64arch_bits:64multiplexing_api:epollatomicvar_api:atomic-builtingcc_version:4.8.5process_id:16956run_id:c9dc9487378a1dc42ee9e362c6bacae6dd8dcd3etcp_port:6379uptime_in_seconds:140uptime_in_days:0hz:10lru_clock:14818741executable : / usr/local/redis-4.0.6/src/redis-serverconfig_file:/usr/local/redis-4.0.6/redis.conf# Clientsconnected_clients:1client_longest_output_list:0client_biggest_input_buf:0blocked_clients:0# Memoryused_memory:885434used_memory_human:864.68Kused_memory_rss:2220032used_memory_rss_human:2.12Mused_memory_peak:935546used_memory_peak_human:913.62Kused_memory_peak_perc:94.64 % used_memory_overhead:884956used_memory_startup:835326used_memory_dataset:478used_memory_dataset_perc:0.95%total_system_memory:67240886272total_system_memory_human:62.62Gused_memory_lua:37888used_memory_lua_human:37.00Kmaxmemory:0maxmemory_human:0Bmaxmemory_policy:noevictionmem_fragmentation_ratio:2.51mem_allocator:libcactive_defrag_running:0lazyfree_pending_objects:0# Persistenceloading:0rdb_changes_since_last_save:0rdb_bgsave_in_progress:0rdb _ last_save_time:1558322473rdb_last_bgsave_status:okrdb_last_bgsave_time_sec:-1rdb_current_bgsave_time_sec:-1rdb_last_cow_size:0aof_enabled:0aof_rewrite_in_progress:0aof_rewrite_scheduled:0aof_last_rewrite_time_sec:-1aof_current_rewrite_time_sec:-1aof_last_bgrewrite_status:okaof_last_write_status:okaof_last_cow_size:0# Statstotal_connections_received:146total_commands _ processed:278instantaneous_ops_per_sec:3total_net_input_bytes:5916total_net_output_bytes:371281instantaneous_input_kbps:0.08instantaneous_output_kbps:4.93rejected_connections:0sync_full:0sync_partial_ok:0sync_partial_err:0expired_keys:0evicted_keys:0keyspace_hits:0keyspace_misses:0pubsub_channels:0pubsub_patterns:0latest_fork_usec:0migrate_cached_sockets:0slave_expires_tracked_keys:0active_defrag_hits:0active_defrag_misses:0active _ defrag_key_hits:0active_defrag_key_misses:0# Replicationrole:masterconnected_slaves:0master_replid:71b0ed4332fc4a6319ec9aca91bd6bd42feca56amaster_replid2:0000000000000000000000000000000000000000master_repl_offset:0second_repl_offset:-1repl_backlog_active:0repl_backlog_size:1048576repl_backlog_first_byte_offset:0repl_backlog_histlen:0# CPUused_cpu_sys:0.13used_cpu_user:0.06used_cpu_sys_children:0.00used_cpu_user_children:0.00# Clustercluster_enabled:0# Keyspace [root@localhost zabbix_agentd.d] #

Parameter description-an ac123456 is the specified redis password, which can be ignored if redis does not have a password

Configuration file

Create a configuration file for redis monitoring items on the zabbix-agent side

[root@localhost zabbix_agentd.d] # cat / etc/zabbix/zabbix_agentd.d/redis.conf UserParameter=redis [*], redis-cli-an ac123456 info | grep $1 ":" | cut-d':'- f 2UserParameterbeauty ping-a 123456 ping | grep-c PONGUserParameter=redis.version Redis-server-- version | cut-d ""-f 3 | cut-d "="-f 2 [root@localhost zabbix_agentd.d] # restart the zabbix-agent service [root@localhost zabbix_agentd.d] # systemctl restart zabbix-agent [root@localhost zabbix_agentd.d] #

Zabbix-server side acquires data through zabbix-get test

The following information shows that the redis information can be obtained successfully.

[root@localhost zabbix_agentd.d] # zabbix_get-s 192.168.1.70-k redis.version4.0.6 [root@localhost zabbix_agentd.d] # Thank you for reading. The above is the content of "how to monitor redis status through zabbix under centos7". After the study of this article, I believe you have a deeper understanding of how to monitor redis status through zabbix under centos7, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report