SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
AI, and Network Operations and Management

CCNA SNMP and Syslog: SNMPv3, Traps, Informs and Syslog Severity Levels

16 min readCCNA · AI, and Network Operations and ManagementUpdated

<p>SNMP and syslog are the two protocols network devices use to report on themselves: <strong>SNMP</strong> (Simple Network Management Protocol) lets a management station poll devices for counters and status and receive event notifications, while <strong>syslog</strong> carries human-readable event messages, each tagged with a severity level and facility, to the console, a buffer, remote sessions or a central server. This lesson covers the CCNA 200-301 exam objectives to describe the function of SNMP in network operations and to interpret syslog message content, severity levels and facilities: managers, agents, MIBs and OIDs, SNMP operations and ports, traps versus informs, v2c versus v3 security, the eight severity levels, reading <code>%FACILITY-SEVERITY-MNEMONIC</code> messages, logging thresholds and destinations, the local7 facility and PRI value, and timestamps with NTP.</p>

What you’ll learn
  • Describe the roles of the SNMP manager, agent, MIB and OIDs, and why an NMS needs vendor MIB files
  • Match SNMP operations (Get, GetNext, GetBulk, Set, trap, inform) to their direction, UDP port and SNMP version
  • Compare SNMPv1/v2c community strings with SNMPv3 security levels and read an SNMPv3 group and user configuration
  • Restrict SNMP access with RO/RW communities and an ACL, and choose between polling, notifications and syslog
  • Name the eight syslog severity levels in order and interpret %FACILITY-SEVERITY-MNEMONIC messages
  • Predict which messages a logging threshold sends to each destination, including terminal monitor and logging host
  • Explain the syslog facility, decode a PRI value, and use timestamps, sequence numbers and NTP to correlate logs

What does SNMP do in network operations?

SNMP (Simple Network Management Protocol) lets a central network management system read and change management data on network devices and lets those devices report events to it. It is the standard way an operations team collects interface counters, CPU and memory load, and device status from hundreds of routers and switches, and the way devices raise an alarm when something changes.

SNMP has three building blocks:

  • SNMP manager — software on the NMS (network management station). It sends requests, receives notifications, stores the results and draws the graphs and alarms.
  • SNMP agent — a process on each managed device (router, switch, firewall, server). It answers the manager's requests and sends notifications. The agent, not the manager, holds the device's live values.
  • MIB (Management Information Base) — the structured set of objects the agent exposes, such as interface status, byte counters, CPU load and the hostname.

Every MIB object is identified by an OID (object identifier), a dotted number in a global tree, for example 1.3.6.1.2.1.2.2.1.10 for interface inbound octets (ifInOctets). Standard objects live under the mib-2 branch (1.3.6.1.2.1); vendor-specific objects live under the private enterprises branch 1.3.6.1.4.1, with each vendor holding its own number (Cisco's is 9).

The OID alone is just a number. To show an object by name, with its type and meaning, the NMS needs the MIB file that defines it. Standard MIBs ship with every NMS; for vendor objects you load (compile) the vendor's MIB files into the NMS. A value that comes back as a bare numeric OID still proves that polling works: naming and interpreting objects is purely a job of the MIB files loaded on the NMS, while communities, versions and notification settings decide only whether the exchange happens at all.

Which SNMP operations exist, and which UDP ports do they use?

The manager reads and writes with Get, GetNext, GetBulk and Set on UDP port 161 of the agent; the agent sends notifications (traps and informs) to the manager on UDP port 162. SNMP normally runs over UDP.

MessageDirectionPortPurpose
GetManager → agentUDP 161Read the value of one or more named OIDs
GetNextManager → agentUDP 161Read the next OID in the tree; repeated GetNext requests "walk" a table one object per exchange
GetBulk (SNMPv2c and v3)Manager → agentUDP 161Read many successive objects in one request, cutting the number of exchanges for a large table
SetManager → agentUDP 161Change a writable object (needs read-write access)
ResponseAgent → manager(reply)Returns the values or the result of a request
TrapAgent → managerUDP 162Unsolicited, unacknowledged event notification
Inform (SNMPv2c and v3)Agent → managerUDP 162Event notification that the manager acknowledges

Two consequences matter in practice:

  • Firewall rules. Polling is a flow the NMS starts toward the device on UDP 161; a stateful firewall lets the responses back automatically. Notifications are a separate flow the device starts toward the NMS on UDP 162, so they need their own rule. UDP 514 is syslog, not SNMP.
  • Walking big tables. SNMPv1 has only Get and GetNext, so walking the interface table of a large switch costs one exchange per object. GetBulk, added in SNMPv2, retrieves many rows at once, so the number of request/response exchanges needed to read a table depends on the operation used, which in turn depends on the SNMP version; the polling interval only changes how often that work is repeated.

What is the difference between an SNMP trap and an inform?

A trap is sent once with no acknowledgment; an inform is acknowledged by the manager and resent by the agent until it is acknowledged or its retries run out. Both are notifications from agent to manager on UDP 162.

TrapInform
Acknowledged by the managerNoYes (the manager returns a response)
Resent if lostNo — a lost trap is goneYes, the agent keeps it in memory and retries
SNMP versionsv1, v2c, v3v2c and v3 only
Cost on the deviceLowestMemory for pending informs, extra traffic for retries

On Cisco IOS you enable the notification types with snmp-server enable traps and name each receiver with snmp-server host. The keyword after the address chooses the message type; traps is the default when it is left out.

snmp-server enable traps
! v1 traps (the default type)
snmp-server host 10.9.9.9 version 1 NOC-STR
! acknowledged notifications need informs, which need v2c or v3
snmp-server host 10.9.9.9 informs version 2c NOC-STR

If notifications are being lost over a congested link and must be confirmed, two things have to change together: the message type (informs) and, if the host is set to version 1, the version (2c or 3), because SNMPv1 has no inform message. The snmp-server host command only defines where notifications go; it does not grant or control polling access.

How do SNMP versions 1, 2c and 3 differ in security, and how do you restrict access?

SNMPv1 and SNMPv2c authenticate requests only with a community string sent in clear text, while SNMPv3 uses named users with optional message authentication and encryption. Anyone who captures v1 or v2c traffic can read the community string and every value polled.

VersionIdentityAuthenticationEncryptionNotable features
SNMPv1Community stringNone beyond the clear-text stringNoneGet, GetNext, Set, Trap; 32-bit counters
SNMPv2cCommunity stringNone beyond the clear-text stringNoneAdds GetBulk, informs and 64-bit counters
SNMPv3User (user-based security model)Optional HMAC (for example SHA)Optional (for example AES)Same operations as v2c plus per-user security levels

SNMPv3 has three security levels:

Security levelIOS keywordAuthenticates messagesEncrypts payload
noAuthNoPrivnoauthNo (username match only)No
authNoPrivauthYes (HMAC)No — OIDs and values are readable in a capture
authPrivprivYes (HMAC)Yes

A capture tells you the level: an authentication parameter with readable OIDs and values means authNoPriv; unreadable data means authPriv. Community-string hygiene limits who can use the string and what they can do with it, but the string and the data still cross the wire in clear text; only SNMPv3 at authPriv provides authenticated and encrypted SNMP.

On IOS, v3 is configured in two parts. The group sets the minimum security level and the views (what may be read, written or sent in notifications); the user belongs to a group and carries the keys:

snmp-server group NMS-RO v3 priv
snmp-server user nms1 NMS-RO v3 auth sha Auth#Key1 priv aes 128 Priv#Key2

A group configured with priv requires authPriv, so its users need both an auth algorithm and key and a priv algorithm and key. A group with no write view gives read-only access. A group with auth stops at authNoPriv, and a user defined as v2c or a snmp-server community line provides no per-user authentication or encryption at all.

Restricting access with communities and ACLs

A community string grants either read-only (RO) or read-write (RW) access, and a standard ACL attached to it limits which NMS source addresses the agent will answer.

access-list 15 permit host 10.10.5.20
snmp-server community Ops-Read RO 15
  • RO allows Get, GetNext and GetBulk. RW also allows Set, which can change the configuration — give it out sparingly, if at all.
  • The number after RO or RW applies that ACL to the community. Requests from addresses the ACL permits are answered; anything else hits the implicit deny and is silently dropped, so the NMS sees a timeout, not an error.
  • Because the drop is silent, a timeout from one source while other sources are answered points to the ACL attached to the community: every NMS address that should poll needs its own permit.
  • snmp-server host lines only name notification receivers. A missing host line stops traps or informs reaching that address; it does not stop the address polling the device.

The ACL limits who can talk to the agent but does not hide the community string on the wire, so it complements, rather than replaces, SNMPv3.

When should you use SNMP polling, SNMP notifications or syslog?

Use SNMP polling for values that change continuously and must be trended, and use event-driven messages — SNMP notifications or syslog — when you need to know quickly that something happened.

NeedBest fitWhy
Interface utilisation, CPU or memory graphs over monthsSNMP polling of countersUtilisation is computed from octet counters read at regular intervals; events cannot produce a time series
Know within seconds that a link went downSNMP notification (trap or inform) or syslog to a serverThe device pushes the event as it happens; detection does not depend on the poll interval
Confirmed delivery of an eventSNMP informAcknowledged and retransmitted
A searchable record of what happened and who changed whatSyslog to a central serverHuman-readable messages with timestamps, kept off the device

The two methods are usually combined. The general rule: polling detects a change no sooner than the next poll, and polling faster multiplies the load on every device, so fast detection comes from the device pushing the event rather than from a shorter interval. Pushing only helps if the message actually leaves the device — a local log buffer records events but alerts nobody.

What are the eight syslog severity levels?

Syslog has eight severity levels numbered 0 to 7, where a lower number means a more serious condition: 0 emergencies is the worst and 7 debugging the least severe.

LevelKeywordMeaningExample
0emergenciesSystem is unusableDevice about to crash
1alertsImmediate action neededTemperature limit exceeded
2criticalCritical conditionHardware or memory failure
3errorsError condition%LINK-3-UPDOWN interface down
4warningsWarning condition%CDP-4-NATIVE_VLAN_MISMATCH
5notificationsNormal but significant%LINEPROTO-5-UPDOWN, %SYS-5-CONFIG_I, %OSPF-5-ADJCHG
6informationalInformational message%SEC-6-IPACCESSLOGP ACL log hit
7debuggingDebug outputOutput of debug commands

A common memory aid is "Every Awesome Cisco Engineer Will Need Ice-cream Daily". Be careful with the order of the top three: alerts (1) is more severe than critical (2), even though "critical" sounds worse. Also note that the examples are typical IOS levels, not fixed rules: the severity is whatever number the message carries.

How do you read a Cisco IOS syslog message?

A Cisco IOS log message is made of an optional sequence number, an optional timestamp, a %FACILITY-SEVERITY-MNEMONIC tag and a description of the event.

000123: *Mar  1 00:12:45.331: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
PartExampleMeaning
Sequence number000123Added by service sequence-numbers; orders messages from this one device
Timestamp*Mar 1 00:12:45.331Set by service timestamps; a leading * means the clock is not authoritative
FacilityLINEPROTOThe subsystem or feature that generated the message (LINK, LINEPROTO, OSPF, SYS, SEC, CDP…)
Severity50–7 severity level (5 = notifications)
MnemonicUPDOWNA short code that names the specific message
DescriptionLine protocol … changed state to downThe event in plain text, with the details (interface, neighbor, user, address)

"Facility" therefore has two meanings in syslog work: the IOS message facility in the tag (the subsystem, such as OSPF), and the syslog protocol facility (such as local7) that a server uses for filing — covered below.

Reading a sequence of messages

Messages tell a story when read together. Knowing a few common ones lets you tell an administrative action from a fault:

  • %SYS-5-CONFIG_I: Configured from console by jsmith on vty0 (10.2.2.8) — a configuration change; vty0 with an address means a remote session (Telnet/SSH), while console as the line means the physical console port.
  • %LINK-5-CHANGED: … changed state to administratively down — someone entered shutdown on the interface.
  • %LINK-3-UPDOWN: … changed state to down — the physical link was lost (cable, far end, optics); note the higher severity (3) for a fault.
  • %LINEPROTO-5-UPDOWN — the line protocol followed the link state.
  • %OSPF-5-ADJCHG: … from FULL to DOWN, Neighbor Down: Interface down or detached — the adjacency dropped because its interface went down; a dead-timer expiry gives a different reason ("Dead timer expired").

Read a sequence in time order and ask what each message implies about the next: a configuration message names who changed the device and from which line, a link message says whether the interface was shut or failed, and protocol messages that follow are usually consequences of that link change rather than separate faults.

How does the logging severity threshold work, and where can log messages go?

Each logging destination has a severity threshold: the device sends that level and every more severe (lower-numbered) level, and drops the rest. Setting logging trap warnings sends levels 0–4 to the server and holds back 5, 6 and 7.

IOS can send log messages to four destinations, each with its own command and threshold:

DestinationCommandNotes
Console portlogging console <level>On by default; everything up to debugging appears on the console line
Local memory bufferlogging buffered [size] <level>Read with show logging; lost on reload
Remote terminal sessions (vty)logging monitor <level>A Telnet/SSH user sees messages only after entering terminal monitor in that session
Syslog serverlogging host <address> + logging trap <level>Sent over UDP 514; the default server threshold is informational (6), so debug output is not sent unless you raise it
logging host 10.1.1.50
logging trap notifications

With this configuration an OSPF adjacency change (level 5) reaches the server but ACL log hits (level 6) do not — a simple way to stop a noisy informational message flooding the server while keeping significant events. Note which command controls which destination: logging trap is the server threshold (the name is historical and has nothing to do with SNMP traps); changing logging buffered or logging console does not change what the server receives.

Two practical points:

  • When you run a debug command over SSH and see nothing while a colleague on the console does, enter terminal monitor in your session. logging synchronous under the line only stops messages breaking up what you are typing.
  • Debug output is level 7, so it reaches a destination only if that destination's threshold is debugging.

What is the syslog facility (local0–local7) and the PRI value?

The syslog protocol facility is a header field that tells the receiving server what kind of sender produced the message, and IOS stamps messages it sends to a server with facility local7 by default. Servers commonly sort or file messages by facility, so if routers and firewalls both arrive as local7 they end up together.

  • Change it with logging facility local5 (any of local0–local7, the facilities reserved for local use, plus a few system facilities).
  • The facility is a separate setting from which severities are sent to the server and from which address they are sent from; changing the facility changes only how the receiving server classifies the messages.

On the wire, facility and severity are combined into one PRI (priority) value at the start of the message, in angle brackets:

PRI = facility number × 8 + severity

The local facilities are numbered 16 (local0) to 23 (local7). To decode a PRI, divide by 8: the quotient is the facility and the remainder is the severity.

PRI÷ 8FacilitySeverity
<189>23 remainder 5local75 notifications
<187>23 remainder 3local73 errors
<171>21 remainder 3local53 errors

How do timestamps, sequence numbers and NTP make logs usable?

Logs from several devices can only be compared when every device stamps messages with calendar time, from a clock synchronised to a common source, at enough precision to separate events.

  • service timestamps log datetime msec stamps log messages with date and time to the millisecond. Without datetime a device can stamp with time since boot (uptime, such as 2w3d:), which cannot be placed in calendar time. Without msec the stamp stops at whole seconds, so events in the same second cannot be ordered. Optional keywords localtime and show-timezone use the configured time zone.
  • service timestamps debug … is the separate command for debug output; it does not change normal log messages.
  • A leading * on the timestamp means the clock is not authoritative — it has not been set from a reliable source. A date such as Mar 1 on a device that was never set is a typical sign. (A leading . means the clock was synchronised but has lost synchronisation.) Times from such clocks cannot be compared across devices.
  • NTP fixes accuracy: pointing every device at the same NTP time source makes their clocks agree, so their log times line up.
  • service sequence-numbers numbers messages on each device. It orders messages from one device (and shows if any were lost), but the numbers are per device and say nothing about time, so they cannot order events across devices.

To order events across two switches you therefore need both: a common NTP source for accuracy and millisecond datetime stamps for precision.

Tip. Questions on this topic are mostly evidence-based scenarios: a log message or a sequence of messages, a snmp-server or logging configuration, or a description of a packet capture is shown, and you are asked what it means, what reaches a destination, or which command meets a requirement. Expect to decode %FACILITY-SEVERITY-MNEMONIC tags and timestamps, rank severity levels, work out which messages pass a logging threshold, choose the right logging destination command, decode a PRI value, and order events across devices. On the SNMP side, expect to place the agent, manager and MIB, match operations to ports and versions, choose between traps and informs or between polling and notifications under a stated constraint, identify an SNMPv3 security level, and spot why an NMS times out. Some items ask you to select two answers.

Key takeaways
  • The SNMP manager (NMS) polls; the agent on each device answers from its MIB, where every object has an OID. Vendor objects sit under 1.3.6.1.4.1 and need the vendor's MIB loaded into the NMS to be named.
  • Get, GetNext, GetBulk and Set go from manager to agent on UDP 161; traps and informs go from agent to manager on UDP 162. GetBulk arrived in SNMPv2 and cuts exchanges when walking tables.
  • Traps are sent once with no acknowledgment; informs are acknowledged and resent, and need SNMPv2c or v3.
  • SNMPv1/v2c send the community string in clear text. SNMPv3 uses users and three levels: noAuthNoPriv, authNoPriv (HMAC, data readable) and authPriv (authenticated and encrypted).
  • An ACL on a community (snmp-server community NAME RO 15) silently drops requests from unlisted addresses, so the NMS times out; snmp-server host only names notification receivers.
  • Poll counters to trend utilisation; rely on pushed notifications or syslog to learn quickly that something happened.
  • Severity runs 0 emergencies, 1 alerts, 2 critical, 3 errors, 4 warnings, 5 notifications, 6 informational, 7 debugging; lower is worse.
  • A threshold sends its own level and every lower-numbered level. logging trap sets the server threshold (default informational); terminal monitor shows logs in an SSH/Telnet session.
  • IOS sends server messages with facility local7 by default (change with logging facility); PRI = facility × 8 + severity.
  • An asterisk on a timestamp means a non-authoritative clock. Use a common NTP source plus service timestamps log datetime msec to order events across devices.

Frequently asked questions

What is the difference between an SNMP trap and an SNMP inform?

Both are notifications an SNMP agent sends to the manager on UDP 162. A trap is sent once and never acknowledged, so if it is lost the manager never learns of the event. An inform asks the manager to acknowledge it, and the agent resends it until it is acknowledged or its retries run out. Informs exist only in SNMPv2c and SNMPv3, not SNMPv1.

Which ports does SNMP use?

SNMP uses UDP. The manager sends Get, GetNext, GetBulk and Set requests to the agent on UDP port 161, and the agent sends traps and informs to the manager on UDP port 162. Syslog is a different protocol and uses UDP port 514.

What are the three SNMPv3 security levels?

noAuthNoPriv matches only a username, with no authentication or encryption. authNoPriv authenticates each message with an HMAC (such as SHA) but leaves the data readable. authPriv authenticates and also encrypts the payload (such as with AES). On Cisco IOS the group keywords are noauth, auth and priv.

What are the syslog severity levels in order?

From most to least severe: 0 emergencies, 1 alerts, 2 critical, 3 errors, 4 warnings, 5 notifications, 6 informational and 7 debugging. A lower number is more serious, and alerts (1) ranks above critical (2).

What does logging trap warnings send to the syslog server?

It sets the syslog server threshold to level 4, so the device sends messages at levels 0 to 4 (emergencies, alerts, critical, errors and warnings) and does not send notifications, informational or debugging messages. Without a logging trap command, Cisco IOS sends levels 0 to 6 (informational) to the server.

Why do I not see log or debug messages in my SSH session on a Cisco router?

Cisco IOS sends log messages to the console by default, but a remote vty session (SSH or Telnet) displays them only after you enter the terminal monitor command in that session. The level shown in vty sessions is set with logging monitor.

What does the asterisk before a Cisco log timestamp mean?

A leading asterisk means the device's clock is not authoritative: it has not been set from a reliable time source such as NTP, so the time may be wrong and cannot be compared with other devices. Pointing devices at a common NTP source fixes this.

What is the default syslog facility on Cisco IOS and how is the PRI value calculated?

Cisco IOS sends messages to a syslog server with facility local7 by default, changeable with logging facility local0 to local7. The PRI value at the start of each message is facility number times 8 plus severity; local7 is facility 23, so an errors message (3) from local7 has PRI 187.

Source

This lesson covers the "AI, and Network Operations and Management" domain of the official CCNA exam guide. Vendors revise their guides — check the source for the current version.

Test yourself on this topic
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?