blob: 96f080b2fdf7de3c8f57d84507fd5e0b51d4028a [file] [log] [blame]
paul76b89b42004-11-06 17:13:09 +00001@node SNMP Support
paul718e3742002-12-13 20:15:29 +00002@chapter SNMP Support
3
pauld191eba2004-07-31 15:15:39 +00004SNMP (Simple Network Managing Protocol) is a widely implemented feature for
5collecting network information from router and/or host. Quagga itself does not
6support SNMP agent (server daemon) functionality but is able to connect to a
7SNMP agent using the SMUX protocol (RFC1227) and make the routing protocol MIBs
8available through it.
paul718e3742002-12-13 20:15:29 +00009
10@menu
pauld191eba2004-07-31 15:15:39 +000011* Getting and installing an SNMP agent::
12* SMUX configuration::
13* MIB and command reference::
paul718e3742002-12-13 20:15:29 +000014@end menu
15
paul76b89b42004-11-06 17:13:09 +000016@node Getting and installing an SNMP agent
pauld191eba2004-07-31 15:15:39 +000017@section Getting and installing an SNMP agent
paul718e3742002-12-13 20:15:29 +000018
pauld191eba2004-07-31 15:15:39 +000019There are several SNMP agent which support SMUX. We recommend to use the latest
20version of @code{net-snmp} which was formerly known as @code{ucd-snmp}.
paul76b89b42004-11-06 17:13:09 +000021It is free and open software and available at @uref{http://www.net-snmp.org/}
pauld191eba2004-07-31 15:15:39 +000022and as binary package for most Linux distributions.
23@code{net-snmp} has to be compiled with @code{--with-mib-modules=smux} to
24be able to accept connections from Quagga.
paul718e3742002-12-13 20:15:29 +000025
paul76b89b42004-11-06 17:13:09 +000026@node SMUX configuration
paul718e3742002-12-13 20:15:29 +000027@section SMUX configuration
28
pauld191eba2004-07-31 15:15:39 +000029To enable SMUX protocol support, Quagga must have been build with the
30@code{--enable-snmp} option.
paul718e3742002-12-13 20:15:29 +000031
pauld191eba2004-07-31 15:15:39 +000032A separate connection has then to be established between between the SNMP agent
33(snmpd) and each of the Quagga daemons. This connections each use different OID
34numbers and passwords. Be aware that this OID number is not the one that is
35used in queries by clients, it is solely used for the intercommunication of the
36daemons.
37
38In the following example the ospfd daemon will be connected to the snmpd daemon
39using the password "quagga_ospfd". For testing it is recommending to take
40exactly the below snmpd.conf as wrong access restrictions can be hard to debug.
41
42@example
43/etc/snmp/snmpd.conf:
44 #
45 # example access restrictions setup
46 #
47 com2sec readonly default public
48 group MyROGroup v1 readonly
49 view all included .1 80
50 access MyROGroup "" any noauth exact all none none
51 #
52 # the following line is relevant for Quagga
53 #
54 smuxpeer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
55
56/etc/quagga/ospf:
57 ! ... the rest of ospfd.conf has been omitted for clarity ...
58 !
59 smux peer .1.3.6.1.4.1.3317.1.2.5 quagga_ospfd
60 !
61@end example
62
63After restarting snmpd and quagga, a successful connection can be verified in
64the syslog and by querying the SNMP daemon:
65
66@example
67snmpd[12300]: [smux_accept] accepted fd 12 from 127.0.0.1:36255
68snmpd[12300]: accepted smux peer: \
69 oid GNOME-PRODUCT-ZEBRA-MIB::ospfd, quagga-0.96.5
70
71# snmpwalk -c public -v1 localhost .1.3.6.1.2.1.14.1.1
72OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109
73@end example
74
75Be warned that the current version (5.1.1) of the Net-SNMP daemon writes a line
76for every SNMP connect to the syslog which can lead to enormous log file sizes.
77If that is a problem you should consider to patch snmpd and comment out the
78troublesome @code{snmp_log()} line in the function
79@code{netsnmp_agent_check_packet()} in @code{agent/snmp_agent.c}.
80
paul76b89b42004-11-06 17:13:09 +000081@node MIB and command reference
pauld191eba2004-07-31 15:15:39 +000082@section MIB and command reference
83
84The following OID numbers are used for the interprocess communication of snmpd and
85the Quagga daemons. Sadly, SNMP has not been implemented in all daemons yet.
86@example
87 (OIDs below .iso.org.dod.internet.private.enterprises)
hasso54aa6b22004-10-12 06:05:34 +000088zebra .1.3.6.1.4.1.3317.1.2.1 .gnome.gnomeProducts.zebra.zserv
89bgpd .1.3.6.1.4.1.3317.1.2.2 .gnome.gnomeProducts.zebra.bgpd
90ripd .1.3.6.1.4.1.3317.1.2.3 .gnome.gnomeProducts.zebra.ripd
91ospfd .1.3.6.1.4.1.3317.1.2.5 .gnome.gnomeProducts.zebra.ospfd
92ospf6d .1.3.6.1.4.1.3317.1.2.6 .gnome.gnomeProducts.zebra.ospf6d
pauld191eba2004-07-31 15:15:39 +000093@end example
94
95The following OID numbers are used for querying the SNMP daemon by a client:
96@example
hasso54aa6b22004-10-12 06:05:34 +000097zebra .1.3.6.1.2.1.4.24 .iso.org.dot.internet.mgmt.mib-2.ip.ipForward
98ospfd .1.3.6.1.2.1.14 .iso.org.dot.internet.mgmt.mib-2.ospf
99bgpd .1.3.6.1.2.1.15 .iso.org.dot.internet.mgmt.mib-2.bgp
100ripd .1.3.6.1.2.1.23 .iso.org.dot.internet.mgmt.mib-2.rip2
101ospf6d .1.3.6.1.3.102 .iso.org.dod.internet.experimental.ospfv3
pauld191eba2004-07-31 15:15:39 +0000102@end example
103
104The following syntax is understood by the Quagga daemons for configuring SNMP:
paul718e3742002-12-13 20:15:29 +0000105@deffn {Command} {smux peer @var{oid}} {}
106@deffnx {Command} {no smux peer @var{oid}} {}
107@end deffn
108
109@deffn {Command} {smux peer @var{oid} @var{password}} {}
110@deffnx {Command} {no smux peer @var{oid} @var{password}} {}
111@end deffn