nagios cannot ping cisco switch
Posted: Sat Nov 12, 2016 6:38 pm
cisco small business switch
model SGE2010
IP 192.168.2.3
name ClientMasterSwitch
error history:
commands file:
switches.cfg file
model SGE2010
IP 192.168.2.3
name ClientMasterSwitch
error history:
Code: Select all
11-12-2016 15:08:42] SERVICE ALERT: ClientMasterSwitch;Port 1 Link Status;UNKNOWN;HARD;3;External command error: Timeout: No Response from 192.168.2.3:161.
Service Unknown[11-12-2016 15:06:42] SERVICE ALERT: ClientMasterSwitch;Port 1 Link Status;UNKNOWN;SOFT;2;External command error: Timeout: No Response from 192.168.2.3:161.
Service Unknown[11-12-2016 15:04:44] SERVICE ALERT: ClientMasterSwitch;Uptime;UNKNOWN;HARD;3;External command error: Timeout: No Response from 192.168.2.3:161.
Service Unknown[11-12-2016 15:04:42] SERVICE ALERT: ClientMasterSwitch;Port 1 Link Status;UNKNOWN;SOFT;1;External command error: Timeout: No Response from 192.168.2.3:161.
Service Critical[11-12-2016 15:04:38] SERVICE ALERT: ClientMasterSwitch;PING;CRITICAL;HARD;3;PING CRITICAL - Packet loss = 100%
Service Unknown[11-12-2016 15:02:44] SERVICE ALERT: ClientMasterSwitch;Uptime;UNKNOWN;SOFT;2;External command error: Timeout: No Response from 192.168.2.3:161.
Service Critical[11-12-2016 15:02:38] SERVICE ALERT: ClientMasterSwitch;PING;CRITICAL;SOFT;2;PING CRITICAL - Packet loss = 100%
Host Down[11-12-2016 15:01:08] HOST ALERT: ClientMasterSwitch;DOWN;SOFT;4;(Host check timed out after 30.01 seconds)
Service Unknown[11-12-2016 15:00:44] SERVICE ALERT: ClientMasterSwitch;Uptime;UNKNOWN;SOFT;1;External command error: Timeout: No Response from 192.168.2.3:161.
Service Critical[11-12-2016 15:00:38] SERVICE ALERT: ClientMasterSwitch;PING;CRITICAL;SOFT;1;PING CRITICAL - Packet loss = 100%
Code: Select all
################################################################################
80 #
81 # SAMPLE HOST CHECK COMMANDS
82 #
83 ################################################################################
84
85
86 # This command checks to see if a host is "alive" by pinging it
87 # The check must result in a 100% packet loss or 5 second (5000ms) round trip
88 # average time to produce a critical error.
89 # Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
90
91 # 'check-host-alive' command definition
92 define command{
93 command_name check-host-alive
94 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
95 }
172 define command{
173 command_name check_snmp
174 command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
175 }
199 # 'check_ping' command definition
200 define command{
201 command_name check_ping
202 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
203 }
switches.cfg file
Code: Select all
1 #############################################################################
2 # SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
3 #
4 #
5 # NOTES: This config file assumes that you are using the sample configuration
6 # files that get installed with the Nagios quickstart guide.
7 #
8 ###############################################################################
9 ###############################################################################
10 ###############################################################################
11 #
12 # HOST DEFINITIONS
13 #
14 ###############################################################################
15 ###############################################################################
16
17
18
19
20 # Define the switch that we'll be monitoring
21
22 define host{
23 use generic-switch ; Inherit default values from a template
24 host_name Sophos UTM ; The name we're giving to this switch
25 alias Sophos UTM Firewall ; A longer name associated with the switch
26 address 192.168.0.1 ; IP address of the switch
27 hostgroups switches ; Host groups this switch is associated with
28 icon_image switch40.png
29 statusmap_image switch40.gd2
30 }
31
32
33 define host{
34 use generic-switch ; Inherit default values from a template
35 host_name servswitch ; The name we're giving to this switch
36 alias Cisco SG300 52 Port Managed Switch ; A longer name associated with the switch
37 address 192.168.0.2 ; IP address of the switch
38 hostgroups switches ; Host groups this switch is associated with
39 parents Sophos UTM
40 icon_image switch40.png
41 statusmap_image switch40.gd2
42 }
43
44 define host{
45 use generic-switch ; Inherit default values from a template
46 host_name ClientMasterSwitch ; The name we're giving to this switch
47 alias Cisco SGE2010 48 Port Managed Switch ; A longer name associated with the switch
48 address 192.168.2.3 ; IP address of the switch
49 hostgroups switches ; Host groups this switch is associated with
50 icon_image switch40.png
51 statusmap_image switch40.gd2
52 }
53
54
55
56 ###############################################################################
57 ###############################################################################
58 #
59 # HOST GROUP DEFINITIONS
60 #
61 ###############################################################################
62 ###############################################################################
63
64 # Create a new hostgroup for switches
65
66 define hostgroup{
67 hostgroup_name switches ; The name of the hostgroup
68 alias Network Switches ; Long name of the group
69 }
70
71
72
73
74 ###############################################################################
75 ###############################################################################
76 #
77 # SERVICE DEFINITIONS
78 #
79 ###############################################################################
80 ###############################################################################
81
82 # Create a service to PING to switch
83
84 define service{
85 use generic-service
86 host_name servswitch
87 service_description PING
88 check_command check_ping!200.0,20%!600.0,60%
89 normal_check_interval 5
90 retry_check_interval 2
91 }
92
93 define service{
94 use generic-service
95 host_name ClientMasterSwitch
96 service_description PING
97 check_command check_ping!200.0,20%!600.0,60%
98 normal_check_interval 5
99 retry_check_interval 2
100 }
101
102 # Monitor uptime via SNMP
103
104 define service{
105 use generic-service ; Inherit values from a template
106 host_name servswitch
107 service_description Uptime
108 check_command check_snmp!-C public -o sysUpTime.0
109 }
110
111 # Monitor uptime via SNMP
112
113 define service{
114 use generic-service ; Inherit values from a template
115 host_name ClientMasterSwitch
116 service_description Uptime
117 check_command check_snmp!-C public -o sysUpTime.0
118 }
119
120 # Monitor Port 1 status via SNMP
121
122 define service{
123 use generic-service ; Inherit values from a template
124 host_name servswitch
125 service_description Port 1 Link Status
126 check_command check_snmp!-C public -o ifOperStatus.49 -r 1 -m RFC1213-MIB
127 }
128
129 # Monitor Port 1 status via SNMP
130
131 define service{
132 use generic-service ; Inherit values from a templat
133 host_name ClientMasterSwitch
134 service_description Port 1 Link Status
135 check_command check_snmp!-C public -o ifOperStatus.49 -r 1 -m RFC1213-MIB
136 }