Sending Syslog Messages As SNMP Traps and Informs
Problem
You want to send syslog messages as SNMP traps or informs.
Solution
You can configure the router to forward syslog messages to your network management server as SNMP traps instead of syslog packets with the following configuration commands:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#logging history informationalRouter(config)#snmp-server enable traps syslogRouter(config)#snmp-server host172.25.1.1 ORATRAPsyslogRouter(config)#endRouter#
To forward syslog messages as SNMP informs, use the following configuration commands:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#logging history informationalRouter(config)#snmp-server enable informsRouter(config)#snmp-server host172.25.1.1informs version 2cORATRAPsyslogRouter(config)#endRouter#
Discussion
Cisco routers normally forward syslog messages via the syslog facility by using UDP port 514. However, in networks that support SNMP traffic only, Cisco routers can encapsulate their syslog messages into SNMP traps before sending them.
This feature is most useful if your network management software doesn’t support the syslog protocol. However, since routers can produce many more syslog messages than SNMP traps, we recommend using syslog when possible. Further, the fact that all of the syslog messages sent as SNMP traps use the same OID number can make parsing for particular ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access