1. Download the Monitoring plugin
wget http://nagios-snmp.cvs.sourceforge.net/nagios-snmp/plugins/check_snmp_int.pl
2. First look at all the ports that the switch is currently opening
For i in ' seq 1 ';d o/usr/local/nagios/libexec/check_snmp_int.pl-h 192.168.0.254 -C PU Blic -N "^gigabitethernet1/0/$i $";d One
3. Add Monitoring
------------------------------------------------------------------------------------------
Vim Hosts.cfg
Define host {
Use Generic-switch
HOST_NAME 3750m-port
Alias 3750m-port
Address 192.168.0.254
}
Define host {
Use Generic-switch
HOST_NAME 3750s-port
Alias 3750s-port
Address 192.168.0.253
}
Define HostGroup {
Hostgroup_name 3750-port
Alias 3750 Port
Members 3750m-port,3750s-port
}
------------------------------------------------------------------------------------------
Vim Commands.cfg
Define Command{
Command_name Check_snmp_int
Command_line $USER 1$/check_snmp_int.pl-h $HOSTADDRESS $-C $ARG 1$-n $ARG 2$
}
------------------------------------------------------------------------------------------
Vim Switch.cfg
Define Service{
Use Generic-service
Hostgroup_name 3750-port
Service_description gigabitethernet1/0/0
Contact_groups Admins
Check_command check_snmp_int!public! ' ^gigabitethernet1/0/[12456789]$ '
}
Reference Documentation:
Http://nagios.proy.org/snmp_int.html
Nagios Monitoring Switch ports