4 @acronym{SNMP,Simple Network Managing Protocol} is a widely implemented
5 feature for collecting network information from router and/or host.
6 Quagga itself does not support SNMP agent (server daemon) functionality
7 but is able to connect to a SNMP agent using the SMUX protocol
8 (@cite{RFC1227}) and make the routing protocol MIBs available through
12 * Getting and installing an SNMP agent::
13 * SMUX configuration::
14 * MIB and command reference::
15 * Handling SNMP Traps::
18 @node Getting and installing an SNMP agent
19 @section Getting and installing an SNMP agent
21 There are several SNMP agent which support SMUX. We recommend to use the latest
22 version of @code{net-snmp} which was formerly known as @code{ucd-snmp}.
23 It is free and open software and available at @uref{http://www.net-snmp.org/}
24 and as binary package for most Linux distributions.
25 @code{net-snmp} has to be compiled with @code{--with-mib-modules=smux} to
26 be able to accept connections from Quagga.
28 @node SMUX configuration
29 @section SMUX configuration
31 To enable SMUX protocol support, Quagga must have been build with the
32 @code{--enable-snmp} option.
34 A separate connection has then to be established between between the
35 SNMP agent (snmpd) and each of the Quagga daemons. This connections
36 each use different OID numbers and passwords. Be aware that this OID
37 number is not the one that is used in queries by clients, it is solely
38 used for the intercommunication of the daemons.
40 In the following example the ospfd daemon will be connected to the
41 snmpd daemon using the password "quagga_ospfd". For testing it is
42 recommending to take exactly the below snmpd.conf as wrong access
43 restrictions can be hard to debug.
48 # example access restrictions setup
50 com2sec readonly default public
51 group MyROGroup v1 readonly
52 view all included .1 80
53 access MyROGroup "" any noauth exact all none none
55 # the following line is relevant for Quagga
57 smuxpeer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
60 ! ... the rest of ospfd.conf has been omitted for clarity ...
62 smux peer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
66 After restarting snmpd and quagga, a successful connection can be verified in
67 the syslog and by querying the SNMP daemon:
70 snmpd[12300]: [smux_accept] accepted fd 12 from 127.0.0.1:36255
71 snmpd[12300]: accepted smux peer: \
72 oid GNOME-PRODUCT-ZEBRA-MIB::ospfd, quagga-0.96.5
74 # snmpwalk -c public -v1 localhost .1.3.6.1.2.1.14.1.1
75 OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109
78 Be warned that the current version (5.1.1) of the Net-SNMP daemon writes a line
79 for every SNMP connect to the syslog which can lead to enormous log file sizes.
80 If that is a problem you should consider to patch snmpd and comment out the
81 troublesome @code{snmp_log()} line in the function
82 @code{netsnmp_agent_check_packet()} in @code{agent/snmp_agent.c}.
84 @node MIB and command reference
85 @section MIB and command reference
87 The following OID numbers are used for the interprocess communication of snmpd and
88 the Quagga daemons. Sadly, SNMP has not been implemented in all daemons yet.
90 (OIDs below .iso.org.dod.internet.private.enterprises)
91 zebra .1.3.6.1.4.1.3317.1.2.1 .gnome.gnomeProducts.zebra.zserv
92 bgpd .1.3.6.1.4.1.3317.1.2.2 .gnome.gnomeProducts.zebra.bgpd
93 ripd .1.3.6.1.4.1.3317.1.2.3 .gnome.gnomeProducts.zebra.ripd
94 ospfd .1.3.6.1.4.1.3317.1.2.5 .gnome.gnomeProducts.zebra.ospfd
95 ospf6d .1.3.6.1.4.1.3317.1.2.6 .gnome.gnomeProducts.zebra.ospf6d
98 The following OID numbers are used for querying the SNMP daemon by a client:
100 zebra .1.3.6.1.2.1.4.24 .iso.org.dot.internet.mgmt.mib-2.ip.ipForward
101 ospfd .1.3.6.1.2.1.14 .iso.org.dot.internet.mgmt.mib-2.ospf
102 bgpd .1.3.6.1.2.1.15 .iso.org.dot.internet.mgmt.mib-2.bgp
103 ripd .1.3.6.1.2.1.23 .iso.org.dot.internet.mgmt.mib-2.rip2
104 ospf6d .1.3.6.1.3.102 .iso.org.dod.internet.experimental.ospfv3
107 The following syntax is understood by the Quagga daemons for configuring SNMP:
108 @deffn {Command} {smux peer @var{oid}} {}
109 @deffnx {Command} {no smux peer @var{oid}} {}
112 @deffn {Command} {smux peer @var{oid} @var{password}} {}
113 @deffnx {Command} {no smux peer @var{oid} @var{password}} {}
116 @include snmptrap.texi