-------------------------------Switch-------------------------------
Switch(config)#snmp-server enable traps
-------------------------------Monitoring Server-------------------------------
#rpm -ivh net-snmp-utils-5.3.2.2-17.el5.x86_64.rpm
#make install
#Add by Kingcraft define host{ use generic-switch,host-pnp ; Inherit default values from a template host_name linksys-srw224p ; The name we're giving to this switch alias Linksys SRW224P Switch ; A longer name associated with the switch address 192.168.60.16 ; IP address of the switch } define service{ use generic-service,srv-pnp ; Inherit values from a template host_name linksys-srw224p ; 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 } define service{ use generic-service,srv-pnp ; Inherit values from a template host_name linksys-srw224p service_description Uptime check_command check_snmp!-C first-switch -o sysUpTime.0 } define service{ use generic-service,srv-pnp ; Inherit values from a template host_name linksys-srw224p service_description Port 1 Link Status check_command check_snmp!-C first-switch -o ifOperStatus.10001 -r 1 } define service{ use generic-service,srv-pnp host_name linksys-srw224p service_description Port 24 Link Status check_command check_snmp!-C first-switch -o ifOperStatus.10024 -r 1 } define service{ use generic-service,srv-pnp host_name linksys-srw224p service_description ciscoMemoryPoolFree check_command check_snmp!-C first-switch -o .1.3.6.1.4.1.9.9.48.1.1.1.6.16 ; The size of the free memory } define service{ use generic-service,srv-pnp host_name linksys-srw224p service_description ciscoCPUTotal1min check_command check_snmp!-C first-switch -o .1.3.6.1.4.1.9.9.109.1.1.1.1.4.1 ; The overall CPU busy percentage in the last 1 minute period } define service{ use generic-service,srv-pnp host_name linksys-srw224p service_description flow check_command check_snmp!-C first-switch -o ifInOctets.10024 -w 5000000000-6000000000 -c 6000000000-8000000000 ; The total number of octets received on the interface,including framing characters }
Empowering for monitoring files:
#chown nagios:nagios /etc/nagios/objects/switch.cfg
cfg_file=/etc/nagios/objects/switch.cfg
#/usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
#service nagios restart
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。