Page 1 of 2

nagios cannot ping cisco switch

Posted: Sat Nov 12, 2016 6:38 pm
by sa77if
cisco small business switch
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%
commands file:

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         }

Re: nagios cannot ping cisco switch

Posted: Mon Nov 14, 2016 10:57 am
by rkennedy
Could you please describe more of the issue? If you can indeed ping the machine normally, then my guess is that the Nagios machine was overloaded.

Re: nagios cannot ping cisco switch

Posted: Tue Nov 15, 2016 1:01 pm
by sa77if
rkennedy wrote:Could you please describe more of the issue? If you can indeed ping the machine normally, then my guess is that the Nagios machine was overloaded.
yes i can ping normally , nothing wrong with the switch
thanks

Re: nagios cannot ping cisco switch

Posted: Tue Nov 15, 2016 2:07 pm
by rkennedy
See my comment then -
If you can indeed ping the machine normally, then my guess is that the Nagios machine was overloaded.
How many hosts / services do you have, and what amount of resources?

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 1:21 pm
by sa77if
rkennedy wrote:See my comment then -
If you can indeed ping the machine normally, then my guess is that the Nagios machine was overloaded.
How many hosts / services do you have, and what amount of resources?
i disabled the notification related to that host to check it later and since that time i have added many hosts with no problem
number of current hosts is 32

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 2:33 pm
by dwhitfield
Is this a new setup or did this previously work?

Can you post the output of top -bcn1|head -n20?

Thanks!

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 3:47 pm
by sa77if
dwhitfield wrote:Is this a new setup or did this previously work?

Can you post the output of top -bcn1|head -n20?

Thanks!
it happened after a power outage results in resetting the switch to default, then i changed the IP back to what it was and this happened

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 3:50 pm
by sa77if
dwhitfield wrote:Is this a new setup or did this previously work?

Can you post the output of top -bcn1|head -n20?

Thanks!

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
29336 root      20   0 15164 1280  876 R  1.8  0.1   0:00.07 top -bcn1
    1 root      20   0 19232 1492 1224 S  0.0  0.1   2:15.50 /sbin/init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 [kthreadd]
    3 root      RT   0     0    0    0 S  0.0  0.0   0:01.85 [migration/0]
    4 root      20   0     0    0    0 S  0.0  0.0   0:05.17 [ksoftirqd/0]
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [stopper/0]
    6 root      RT   0     0    0    0 S  0.0  0.0   0:10.19 [watchdog/0]
    7 root      RT   0     0    0    0 S  0.0  0.0   0:29.81 [migration/1]
    8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [stopper/1]
    9 root      20   0     0    0    0 S  0.0  0.0   0:34.19 [ksoftirqd/1]
   10 root      RT   0     0    0    0 S  0.0  0.0   0:08.90 [watchdog/1]
   11 root      RT   0     0    0    0 S  0.0  0.0   0:03.83 [migration/2]
   12 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [stopper/2]

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 3:51 pm
by dwhitfield
On the switch, can you run nmap and make sure port 161 is open? Thanks!

Re: nagios cannot ping cisco switch

Posted: Wed Nov 16, 2016 5:34 pm
by sa77if
dwhitfield wrote:On the switch, can you run nmap and make sure port 161 is open? Thanks!
i am sorry, its a cisco small business switch SGE2010 i am trying to find a way to check the port but not all the CLI commands are working, i am trying to configure the snmp from the gui but still no progress