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