nagios redis監控配置步驟詳解

來源:互聯網
上載者:User

實際環境如下:

10.0.0.167: 6380

10.0.0.165: 6379/6380

1. 下載redis監控外掛程式

下載連結地址:

http://exchange.nagios.org/directory/Plugins/Databases/check_redis-2Epl/details

https://github.com/willixix/WL-NagiosPlugins

2. 定義監控命令

在commands.cfg添加下面內容:
# 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. 定義主機
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. 定義主機群組
define hostgroup {
        hostgroup_name  Redis_Servers
        alias           Redis Servers
        members         10.0.0.165,10.0.0.167
}

5. 定義服務組
define servicegroup{
        servicegroup_name  Redisservices
        alias           Redis services
        }

6. 定義監控項
# 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. 主機群組圖

 

8. 服務組圖

9. 具體項

原文來自:ttlsa.com

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.