4.3 Troubleshoot with logging: local, syslog, debugs, conditional debugs, timestamps and telemetry

ENARSI 300-410 v1.1 · 4.0 Infrastructure Services

Logs and debugs are how a router tells you what happened. ENARSI expects you to set where messages go (console, buffer, syslog host), which severity reaches each, accurate timestamps, and to use debugs safely, with conditional debugging on busy routers. Model-driven telemetry is the streaming alternative to polling.

What you must know

Severities and destinations

LevelKeywordExample
0emergenciesSystem unusable
1alertsTemperature critical
2criticalMemory allocation failure
3errorsInterface errors
4warningsConfig changed with a warning
5notifications%LINEPROTO-5-UPDOWN, %OSPF-5-ADJCHG
6informationalACL log entries, %SYS-6-LOGGINGHOST_STARTSTOP
7debuggingDebug output

A level sends that severity and everything more severe (a lower number). logging trap 5 sends 0–5 to syslog hosts; ACL log messages (level 6) are then not sent.

service timestamps log datetime msec localtime show-timezone
service timestamps debug datetime msec localtime
service sequence-numbers
logging buffered 64000 debugging
logging console warnings
logging monitor debugging
logging host 10.0.99.30
logging trap informational
logging source-interface Loopback0

Debugging safely

R1# debug condition interface GigabitEthernet0/0
Condition 1 set
R1# debug ip ospf hello
R1# show debugging
OSPF:
  OSPF hello debugging is on
Condition 1: interface Gi0/0 (1 flags triggered)
R1# terminal monitor           ! on vty sessions
R1# undebug all

Only Gi0/0's packets are printed (1); Gi0/1 is ignored (2). Debugs run at high priority on the CPU: send them to the buffer (logging buffered … debugging), not the console, and use conditions (interface, ip, mac-address, username) on production routers.

Timestamps and telemetry

Commands

show loggingBuffer contents, destinations and levels, and counters per host.
show debuggingActive debugs and conditions.
show debug conditionConfigured conditions.
terminal monitorShow logs and debugs on this vty session.
undebug allTurn every debug off.

Exam traps

Check yourself

logging trap warnings. Is %LINK-3-UPDOWN sent? Is %OSPF-5-ADJCHG?
LINK-3 yes (3 ≤ 4); OSPF-5 no (5 > 4).
You are on SSH and see no debug output. Why?
terminal monitor is not enabled on the session (or logging monitor is too low).
What does a debug condition do?
Limits debug output to packets or sessions that match it, such as one interface.
Dial-in vs dial-out telemetry?
Dial-in: the collector connects and subscribes. Dial-out: the device connects and pushes.

Labs

Try it live: Logging, timestamps, conditional debugs and model-driven telemetry

More topics in 4.0 Infrastructure Services