您好,登录后才能下订单哦!
这篇文章主要讲解了“centos7下怎么通过zabbix监控redis状态”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“centos7下怎么通过zabbix监控redis状态”吧!
先准备两台服务器,已经部署好了zabbix-sever和zabbix-agent
zabbix-server 192.168.1.70 centos7.2
zabbix-agent 192.168.1.70 centos7.2
redis的部署过程就不介绍了,百度一大堆 安装好redis之后,用redis info命令查看redis信息
[root@localhost zabbix_agentd.d]# redis-cli -a ac123456 info # Server redis_version:4.0.6 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:c69914497129c95c redis_mode:standalone os:Linux 3.10.0-693.el7.x86_64 x86_64 arch_bits:64 multiplexing_api:epoll atomicvar_api:atomic-builtin gcc_version:4.8.5 process_id:16956 run_id:c9dc9487378a1dc42ee9e362c6bacae6dd8dcd3e tcp_port:6379 uptime_in_seconds:140 uptime_in_days:0 hz:10 lru_clock:14818741 executable:/usr/local/redis-4.0.6/src/redis-server config_file:/usr/local/redis-4.0.6/redis.conf # Clients connected_clients:1 client_longest_output_list:0 client_biggest_input_buf:0 blocked_clients:0 # Memory used_memory:885434 used_memory_human:864.68K used_memory_rss:2220032 used_memory_rss_human:2.12M used_memory_peak:935546 used_memory_peak_human:913.62K used_memory_peak_perc:94.64% used_memory_overhead:884956 used_memory_startup:835326 used_memory_dataset:478 used_memory_dataset_perc:0.95% total_system_memory:67240886272 total_system_memory_human:62.62G used_memory_lua:37888 used_memory_lua_human:37.00K maxmemory:0 maxmemory_human:0B maxmemory_policy:noeviction mem_fragmentation_ratio:2.51 mem_allocator:libc active_defrag_running:0 lazyfree_pending_objects:0 # Persistence loading:0 rdb_changes_since_last_save:0 rdb_bgsave_in_progress:0 rdb_last_save_time:1558322473 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_last_cow_size:0 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok aof_last_write_status:ok aof_last_cow_size:0 # Stats total_connections_received:146 total_commands_processed:278 instantaneous_ops_per_sec:3 total_net_input_bytes:5916 total_net_output_bytes:371281 instantaneous_input_kbps:0.08 instantaneous_output_kbps:4.93 rejected_connections:0 sync_full:0 sync_partial_ok:0 sync_partial_err:0 expired_keys:0 evicted_keys:0 keyspace_hits:0 keyspace_misses:0 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:0 migrate_cached_sockets:0 slave_expires_tracked_keys:0 active_defrag_hits:0 active_defrag_misses:0 active_defrag_key_hits:0 active_defrag_key_misses:0 # Replication role:master connected_slaves:0 master_replid:71b0ed4332fc4a6319ec9aca91bd6bd42feca56a master_replid2:0000000000000000000000000000000000000000 master_repl_offset:0 second_repl_offset:-1 repl_backlog_active:0 repl_backlog_size:1048576 repl_backlog_first_byte_offset:0 repl_backlog_histlen:0 # CPU used_cpu_sys:0.13 used_cpu_user:0.06 used_cpu_sys_children:0.00 used_cpu_user_children:0.00 # Cluster cluster_enabled:0 # Keyspace [root@localhost zabbix_agentd.d]#
参数讲解 -a ac123456是指定redis密码,如果redis没有密码 这个可以忽略
在zabbix-agent端创建redis监控项的配置文件
[root@localhost zabbix_agentd.d]# cat /etc/zabbix/zabbix_agentd.d/redis.conf UserParameter=redis[*],redis-cli -a ac123456 info | grep $1":" | cut -d ':' -f 2 UserParameter=redis-ping,redis-cli -a 123456 ping | grep -c PONG UserParameter=redis.version, redis-server --version | cut -d " " -f 3 | cut -d "=" -f 2 [root@localhost zabbix_agentd.d]#
[root@localhost zabbix_agentd.d]# systemctl restart zabbix-agent [root@localhost zabbix_agentd.d]#
zabbix-server端通过zabbix-get测试获取数据
以下信息可以看出能成功的获取redis的信息
[root@localhost zabbix_agentd.d]# zabbix_get -s 192.168.1.70 -k redis.version 4.0.6 [root@localhost zabbix_agentd.d]#
感谢各位的阅读,以上就是“centos7下怎么通过zabbix监控redis状态”的内容了,经过本文的学习后,相信大家对centos7下怎么通过zabbix监控redis状态这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。