zoukankan      html  css  js  c++  java
  • 基于zabbix的Redis、Sentinel、Slave多实例自动发现监控

    约定

    1. 保证whereis redis-cli 能够正确返回redis-cli程序的路径
    2. 保证 redis的配置文件在模板宏{$REDIS_SERVER_CONFIG_PATH}的路径,并且后缀名 为.conf
    3. 确保redis-server 配置文件配置:pidfile、requirepass 项,且有配置值
    不满足条件会产生告警通知(详细见模板配置)
    

    部署步骤

    zabbix_agent 端配置

    1. 在/usr/local/zabbix327/bin 下增加lld_redis.py,并配置可执行权限

    2. 增加 UserPrameter

       > UserParameter=redis-server_config[*],grep -r --include=*.conf -E '^pidfile' $1 2>/dev/null |wc -l 
       >  UserParameter=redis-cli_which[*],whereis redis-cli 2>/dev/null |wc -l
       >  UserParameter=redis.info.discovery[*],/usr/local/zabbix327/bin/lld_redis.py -t $1  -l $2
       >  UserParameter=redis.slave.discovery[*],/usr/local/zabbix327/bin/lld_redis.py -t $1  -l $2
        > UserParameter=redis.sentinel.discovery[*],/usr/local/zabbix327/bin/lld_redis.py -t $1
        > UserParameter=redis.info[*],/usr/local/zabbix327/bin/lld_redis.py -t $1 -k "$2" -d $3 -p $4 -c $5
        > UserParameter=redis.slave.info[*],/usr/local/zabbix327/bin/lld_redis.py -t $1 -k "$2" -d $3 -p $4 -c $5
        > UserParameter=redis.config[*],/usr/local/zabbix327/bin/lld_redis.py -t $1 -k "$2" -d $3 -p $4 -c $5 -s $6
        > UserParameter=redis.sentinel.info[*],/usr/local/zabbix327/bin/lld_redis.py -t $1 -k "$2" -d $3 -p $4
      
    3. 导入 template

      文件下载-Template

      文件下载-python script

  • 相关阅读:
    vue中插槽的使用场景
    css实现文字两端对齐
    es6 every的使用
    es6 filter方法应用
    es6 map的用法
    spring-servlet.xml
    Spring MVC过滤器HiddenHttpMethodFilter
    controller大全(推荐)
    目前接触到的UI
    jdk环境配置(windows版)
  • 原文地址:https://www.cnblogs.com/cpsing/p/10723556.html
Copyright © 2011-2022 走看看