Table of Contents

Network Monitoring

Lze provádět pomocí:

Syslog

Formát zprávy (logu):

Logy se mohou:

Logování do konzole

Switch(config)# logging console severity(číslo 0-7 nebo slovo)

Zobrazování logů v terminálu připojeném Telnetem / SSH:

Switch# terminal monitor

Logování do interního bufferu

Switch(config)# logging buffered severity (0-7 nebo slovo)
Switch(config)# logging buffered size (4096 - 2147483647)
Switch# show logging

Logování na vzdálený syslog server

Switch(config)# logging host
Switch(config)# logging trap severity(0-7)

Na access portech je dobré vypnout logování up/down stavu portů (nezajímá nás každé vypnutí/zapnutí PC). Každá změna stavu linky totiž vyvolá Error 3 a každá změna stavu line protocolu vyvolá Notification 5.

>Switch(config-if)# no logging event link-status

Timestamps

Defaultně switche používají jako timestamp uptime, což je nepřehledné. Viz. příklad:

20w2d: %LINK-3-UPDOWN: Interface FastEthernet1/0/27, changed state to down
21w3d: %SYS-5-CONFIG_I: Configured from console by vty0 (172.25.15.246)
Switch# show clock
Switch# show clock
*00:54:09.691 UTC Mon Mar 1 1993
Switch#

Nastavení časové zóny a času:

Switch(config)# clock timezone name offset-hours [offset-minutes]
Switch(config)# clock summer-time name date start-month day year hh:mm end-month day year hh:mm [offset-minutes]

NEBO:

Switch(config)# clock summer-time name recurring [start-week day month hh:mm end-week day month hh:mm [offset-minutes]]
Switch(config)# exit
Switch# clock set hh:mm:ss

Nastavení NTP serveru:

Switch(config)# ntp server server-ip
Switch# show ntp status

Požití času jako timestamp v syslog zprávách:

Switch(config)# service timestamps log datetime [localtime] [show-timezone] [msec] [year]
Switch(config)# service timestamps log datetime localtime show-timezone msec
Switch(config)# exit
Switch# show logging
*May 2 02:39:23.871 EDT: %DIAG-SP-6-DIAG_OK: Module 1: Passed Online Diagnostics
*May 2 02:39:27.827 EDT: %HSRP-5-STATECHANGE: Vlan62 Grp 1 state Standby -> Active
*May 2 02:41:40.431 EDT: %OIR-SP-6-INSCARD: Card inserted in slot 9, interfaces are now online
*May 3 08:24:13.944 EDT: %IP-4-DUPADDR: Duplicate address 10.1.2.1 on Vlan5, sourced by 0025.64eb.216f
*May 13 09:55:57.139 EDT: %SYS-5-CONFIG_I: Configured from console by herring on vty0 (10.1.1.7)

SNMP

MIB

Typy požadavků

Trapy

Verze SNMP

SNMPv1

SNMPv2C

SNMPv3

Bezpečnost

Konfigurace SNMP

SNMPv1

Switch(config)# access-list acl-number permit ip-addr
Switch(config)# snmp-server community string [ro | rw] [acl-number]
Switch(config)# snmp-server host host-address community-string [trap type]

SNMPv2C

Switch(config)# access-list acl-number permit ip-addr
Switch(config)# snmp-server community string [ro | rw] [acl-number]
Switch(config)# snmp-server host host-address [informs] version 2c community-string

SNMPv3

Switch(config)# access-list acl-number permit ip-addr
Switch(config)# snmp-server group group-name v3 {noauth | auth | priv}
Switch(config)# snmp-server user user-name group-name v3 auth {md5 | sha} auth-password priv {des | 3des | aes {128 | 192 | 256}} priv-password [acl-number]
Switch(config)# snmp-server host host-address [informs] version 3 {noauth | auth | priv} username [trap-type]

IP SLA

ICMP test

Switch# show ip sla statistics aggregated
Round Trip Time (RTT) for     Index 1
Type of operation: icmp-echo
Start Time Index: 15:10:17.665 EDT Fri May 21 2010
RTT Values
        Number Of RTT: 24
        RTT Min/Avg/Max: 1/1/4 ms
Number of successes: 24
Number of failures: 0

Typy testů

Test Type DescriptionIP SLA Required on Target?
icmp-echo ICMP Echo response timeNo
path-echo Hop-by-hop and end-to-end response times over path discovered from ICMP EchoNo
path-jitterHop-by-hop jitter over ICMP Echo pathYes
dns DNS query response timeNo
dhcp DHCP IP address request response timeNo
ftp FTP file retrieval response timeNo
http Web page retrieval response timeNo
udp-echo End-to-end response time of UDP echoNo
udp-jitter Round trip delay, one way delay, one way jitter, one way packet loss, and connectivity using UDP packetsYes
tcp-connectResponse time to build a TCP connection with a hostNo

Pokročilé testy

IP SLA umí navíc:

Konfigurace IP SLA

Switch(config)# ip sla responder
Switch(config)# ip sla operation-number
(Switch(config)# ip sla monitor operation-number —OLD Syntax)
Switch(config-ip-sla)# test-type parameters …
(Switch(config-ip-sla)# test test-type — OLD Synatx)

Switch(config-ip-sla)# icmp echo dest-ip [src-ip]
Switch(config-ip-sla)# udp-jitter destination-ip-addr dest-udp-port [source-ip source-ip-addr] [source-port source-udp-port] [num-packets number-of-packets (def.10)] [interval packet-interval(def.20ms)]
Switch(config-ip-sla)# udp-jitter destination-ip-addr dest-udp-port codec {g711alaw | g711ulaw | g729a} (def.1000 paketů / 20ms )

Switch(config)# ip sla schedule operation-number [life {forever | seconds(def.3600)}] [start-time {hh:mm[:ss] [month day | day month] | pending | now | after hh:mm:ss}] [ageout seconds] [recurring]
(Switch(config)# ip sla monitor schedule operation-number … — OLD Syntax)
Switch# show ip sla configuration
Switch# show ip sla configuration
IP SLAs, Infrastructure Engine-II
Entry number: 100
Owner:
Tag:
Type of operation to perform: echo
Target address: 172.25.226.1
Source address: 0.0.0.0
Request size (ARR data portion): 28
Operation timeout (milliseconds): 5000
Type Of Service parameters: 0x0
Verify data: No
Vrf Name:
Schedule:
     Operation frequency (seconds): 5
     Next Scheduled Start Time: Start Time already passed
     Group Scheduled : FALSE
     Randomly Scheduled : FALSE
     Life (seconds): Forever
     Entry Ageout (seconds): never
     Recurring (Starting Everyday): FALSE
     Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 5000
Distribution Statistics:
     Number of statistic hours kept: 2
     Number of statistic distribution buckets kept: 1
     Statistic distribution interval (milliseconds): 20
     History Statistics:
     Number of history Lives kept: 0
     Number of history Buckets kept: 15
     History Filter Type: None
Enhanced History:
Switch# show ip sla statistics 100
Switch# show ip sla statistics 100
Round Trip Time (RTT) for	Index 100
	Latest RTT: 1 ms
Latest operation start time: 15:52:00.834 EDT Fri May 28 2010
Latest operation return code: OK
Number of successes: 117
Number of failures: 0
Operation time to live: Forever
Switch# show ip sla statistics aggregated 100
Switch# show ip sla statistics aggregated 100
Round Trip Time (RTT) for	Index 100
Type of operation: icmp-echo
Start Time Index: 15:43:55.842 EDT Fri May 28 2010
RTT Values
	Number Of RTT: 121
	RTT Min/Avg/Max: 1/1/4 ms
Number of successes: 121
Number of failures: 0

HSRP tracking SLA

Switch(config)# track object-number ip sla operation-number {state | reachability}
Switch(config-if)# standby group track object-number decrement decrement-value