nagios redis监控

默北 Nagios1 22,4617字数 2624阅读8分44秒阅读模式

最近都在弄些监控,换了份工作,一切从零开始,现有的监控都没有用上,有些配置和之前工作中遇到的不一样。废话少说,贴出实例,便于以后查阅。

实际环境如下:文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

10.0.0.167: 6380文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

10.0.0.165: 6379/6380文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

1. 下载redis监控插件文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

下载链接地址:文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

http://exchange.nagios.org/directory/Plugins/Databases/check_redis-2Epl/details文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

https://github.com/willixix/WL-NagiosPlugins文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

2. 定义监控命令文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

在commands.cfg添加下面内容:文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

# check redis
define command {
        command_name    check_redis
        command_line    $USER1$/check_redis.pl -H $HOSTADDRESS$ -p $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -f
}

3. 定义主机文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

define host{
        use             linux-server  ; Inherit default values from a template
        host_name       10.0.0.165    ; The name we're giving to this host
        alias           redis-linux    ; A longer name associated with the host
        address         10.0.0.165    ; IP address of the host
        }

define host{
        use             linux-server  ; Inherit default values from a template
        host_name       10.0.0.167    ; The name we're giving to this host
        alias           redis-linux    ; A longer name associated with the host
        address         10.0.0.167    ; IP address of the host
        }

4. 定义主机组文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

define hostgroup {
        hostgroup_name  Redis_Servers
        alias           Redis Servers
        members         10.0.0.165,10.0.0.167
}

5. 定义服务组文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

define servicegroup{
        servicegroup_name  Redisservices
        alias           Redis services
        }

6. 定义监控项文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

# vim redis-server.cfg
define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis Client
      check_command           check_redis!6379!'connected_clients,blocked_clients,client_longest_output_list,client_biggest_input_buf'!100,5,~,~!500,10,~,~
      host_name               !10.0.0.167
      servicegroups           Redisservices
}

define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis Client 6380
      check_command           check_redis!6380!'connected_clients,blocked_clients,client_longest_output_list,client_biggest_input_buf'!100,5,~,~!500,10,~,~
      servicegroups           Redisservices
}

define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis Memory
      check_command           check_redis!6379!'used_memory_human,used_memory_peak_human'!~,~!~,~
      host_name               !10.0.0.167
      servicegroups           Redisservices
}

define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis Memory 6380
      check_command           check_redis!6380!'used_memory_human,used_memory_peak_human'!~,~!~,~
      servicegroups           Redisservices
}

define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis CPU
      check_command           check_redis!6379!'used_cpu_sys,used_cpu_user,used_cpu_sys_children,used_cpu_user_children'!~,~,~,~!~,~,~,~ ;未定义监控报警阀值
      host_name               !10.0.0.167  ;排除10.0.0.167这台
      servicegroups           Redisservices
}

define service {
      use                     generic-service,nagiosgraph
      hostgroup_name          Redis_Servers
      service_description     Redis CPU 6380
      check_command           check_redis!6380!'used_cpu_sys,used_cpu_user,used_cpu_sys_children,used_cpu_user_children'!~,~,~,~!~,~,~,~
      servicegroups           Redisservices
}

7. 主机组图文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

nagios文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

8. 服务组图文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

nagios文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

9. 具体项文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

nagios文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/ 文章源自运维生存时间-https://www.ttlsa.com/nagios/nagios-redis-monitor/

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
默北
  • 本文由 发表于 23/04/2014 09:14:36
  • 转载请务必保留本文链接:https://www.ttlsa.com/nagios/nagios-redis-monitor/
评论  1  访客  0

    来自外部的引用

评论已关闭!