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
- Know the eight syslog severities and how a level filters.
- Send logs to the buffer, the console, terminals and a syslog server with a source interface.
- Turn on
service timestampsand sequence numbers, with NTP for accurate time. - Run debugs with conditions and limits; know
undebug all. - Describe dial-in and dial-out telemetry.
Severities and destinations
| Level | Keyword | Example |
|---|---|---|
| 0 | emergencies | System unusable |
| 1 | alerts | Temperature critical |
| 2 | critical | Memory allocation failure |
| 3 | errors | Interface errors |
| 4 | warnings | Config changed with a warning |
| 5 | notifications | %LINEPROTO-5-UPDOWN, %OSPF-5-ADJCHG |
| 6 | informational | ACL log entries, %SYS-6-LOGGINGHOST_STARTSTOP |
| 7 | debugging | Debug 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 Loopback0Debugging 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 allOnly 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
- Without
service timestamps … datetime, messages show uptime, which cannot be correlated across devices. Sync clocks with NTP first. service sequence-numbersnumbers each message so you can spot gaps in a syslog server.- Telemetry streams data instead of waiting to be polled. Dial-in: the collector subscribes over NETCONF or gNMI. Dial-out: the device pushes to a configured receiver (
telemetry ietf subscription, gRPC). Data is YANG-modelled, sent periodically or on change.
Commands
show logging | Buffer contents, destinations and levels, and counters per host. |
show debugging | Active debugs and conditions. |
show debug condition | Configured conditions. |
terminal monitor | Show logs and debugs on this vty session. |
undebug all | Turn every debug off. |
Exam traps
- A level includes every more severe level:
logging trap 4drops notifications (5). - Logs on a vty session need
terminal monitor. - Debugs to the console can hang a busy router.
- Without a source interface, the syslog server sees the exit interface's address, which changes with routing.
service timestamps debugis separate fromservice timestamps log.
Check yourself
logging trap warnings. Is%LINK-3-UPDOWNsent? 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 monitoris not enabled on the session (orlogging monitoris 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