Redhat配置nagios-配置交換機被監控機
作者:wonitazansa1
Redhat配置nagios:Nagios是監控系統,Nagios能監控所指定的本地或遠程主機以及服務,同時提供異常通知功能等。這篇文章講述的是Redhat配置nagios,配置交換機被監控機
配置交換機被監控機(客戶端)
本文講述的是:Redhat配置nagios。返回大綱。
這里的switch.cfg是交換機的一個監控模板,我保留這個cfg,復制為switch31.cfg編輯
- [root@localhost objects]# vi /usr/local/nagios/etc/nagios.cfg
- # Definitions for monitoring a router/switch
- #cfg_file=/usr/local/nagios/etc/objects/switch.cfg
- cfg_file=/usr/local/nagios/etc/objects/switch31.cfg
幾乎不用改,把host name和address改了,最后一個mrtg我沒用網絡里沒有注釋掉了
- [root@localhost objects]# vi switch31.cfg
- define host{
- use generic-switch ; Inherit default values from a template
- host_name g13a-dell5424-31 ; The name we're giving to this switch
- alias Linksys SRW224P Switch ; A longer name associated with the switch
- address 10.155.0.31 ; IP address of the switch
- hostgroups switches ; Host groups this switch is associated with
- }
- define hostgroup{
- hostgroup_name switches ; The name of the hostgroup
- alias Network Switches ; Long name of the group
- }
- define service{
- use generic-service ; Inherit values from a template
- host_name g13a-dell5424-31 ; The name of the host the service is associated with
- service_description PING ; The service description
- check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
- normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
- retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
- }
- # Monitor uptime via SNMP
- define service{
- use generic-service ; Inherit values from a template
- host_name g13a-dell5424-31
- service_description Uptime
- check_command check_snmp!-C chrswitch -o sysUpTime.0
- }
- # Monitor Port 1 status via SNMP
- define service{
- use generic-service ; Inherit values from a template
- host_name g13a-dell5424-31
- service_description Port 1 Link Status
- check_command check_snmp!-C chrswitch -o ifOperStatus.1 -r 1 -m RFC1213-MIB
- }
- # Monitor bandwidth via MRTG logs
- #define service{
- # use generic-service ; Inherit values from a template
- # host_name linksys-srw224p
- # service_description Port 1 Bandwidth Usage
- # check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10
- # }
Switch就完成,紅色見問題3(圖4)
【編輯推薦】
責任編輯:zhaolei
來源:
csdn