paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame^] | 1 | @node SNMP Support |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2 | @chapter SNMP Support |
| 3 | |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 4 | SNMP (Simple Network Managing Protocol) is a widely implemented feature for |
| 5 | collecting network information from router and/or host. Quagga itself does not |
| 6 | support SNMP agent (server daemon) functionality but is able to connect to a |
| 7 | SNMP agent using the SMUX protocol (RFC1227) and make the routing protocol MIBs |
| 8 | available through it. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9 | |
| 10 | @menu |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 11 | * Getting and installing an SNMP agent:: |
| 12 | * SMUX configuration:: |
| 13 | * MIB and command reference:: |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 14 | @end menu |
| 15 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame^] | 16 | @node Getting and installing an SNMP agent |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 17 | @section Getting and installing an SNMP agent |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 18 | |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 19 | There are several SNMP agent which support SMUX. We recommend to use the latest |
| 20 | version of @code{net-snmp} which was formerly known as @code{ucd-snmp}. |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame^] | 21 | It is free and open software and available at @uref{http://www.net-snmp.org/} |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 22 | and as binary package for most Linux distributions. |
| 23 | @code{net-snmp} has to be compiled with @code{--with-mib-modules=smux} to |
| 24 | be able to accept connections from Quagga. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 25 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame^] | 26 | @node SMUX configuration |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 27 | @section SMUX configuration |
| 28 | |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 29 | To enable SMUX protocol support, Quagga must have been build with the |
| 30 | @code{--enable-snmp} option. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 31 | |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 32 | A 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 |
| 34 | numbers and passwords. Be aware that this OID number is not the one that is |
| 35 | used in queries by clients, it is solely used for the intercommunication of the |
| 36 | daemons. |
| 37 | |
| 38 | In the following example the ospfd daemon will be connected to the snmpd daemon |
| 39 | using the password "quagga_ospfd". For testing it is recommending to take |
| 40 | exactly 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 | |
| 63 | After restarting snmpd and quagga, a successful connection can be verified in |
| 64 | the syslog and by querying the SNMP daemon: |
| 65 | |
| 66 | @example |
| 67 | snmpd[12300]: [smux_accept] accepted fd 12 from 127.0.0.1:36255 |
| 68 | snmpd[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 |
| 72 | OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109 |
| 73 | @end example |
| 74 | |
| 75 | Be warned that the current version (5.1.1) of the Net-SNMP daemon writes a line |
| 76 | for every SNMP connect to the syslog which can lead to enormous log file sizes. |
| 77 | If that is a problem you should consider to patch snmpd and comment out the |
| 78 | troublesome @code{snmp_log()} line in the function |
| 79 | @code{netsnmp_agent_check_packet()} in @code{agent/snmp_agent.c}. |
| 80 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame^] | 81 | @node MIB and command reference |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 82 | @section MIB and command reference |
| 83 | |
| 84 | The following OID numbers are used for the interprocess communication of snmpd and |
| 85 | the Quagga daemons. Sadly, SNMP has not been implemented in all daemons yet. |
| 86 | @example |
| 87 | (OIDs below .iso.org.dod.internet.private.enterprises) |
hasso | 54aa6b2 | 2004-10-12 06:05:34 +0000 | [diff] [blame] | 88 | zebra .1.3.6.1.4.1.3317.1.2.1 .gnome.gnomeProducts.zebra.zserv |
| 89 | bgpd .1.3.6.1.4.1.3317.1.2.2 .gnome.gnomeProducts.zebra.bgpd |
| 90 | ripd .1.3.6.1.4.1.3317.1.2.3 .gnome.gnomeProducts.zebra.ripd |
| 91 | ospfd .1.3.6.1.4.1.3317.1.2.5 .gnome.gnomeProducts.zebra.ospfd |
| 92 | ospf6d .1.3.6.1.4.1.3317.1.2.6 .gnome.gnomeProducts.zebra.ospf6d |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 93 | @end example |
| 94 | |
| 95 | The following OID numbers are used for querying the SNMP daemon by a client: |
| 96 | @example |
hasso | 54aa6b2 | 2004-10-12 06:05:34 +0000 | [diff] [blame] | 97 | zebra .1.3.6.1.2.1.4.24 .iso.org.dot.internet.mgmt.mib-2.ip.ipForward |
| 98 | ospfd .1.3.6.1.2.1.14 .iso.org.dot.internet.mgmt.mib-2.ospf |
| 99 | bgpd .1.3.6.1.2.1.15 .iso.org.dot.internet.mgmt.mib-2.bgp |
| 100 | ripd .1.3.6.1.2.1.23 .iso.org.dot.internet.mgmt.mib-2.rip2 |
| 101 | ospf6d .1.3.6.1.3.102 .iso.org.dod.internet.experimental.ospfv3 |
paul | d191eba | 2004-07-31 15:15:39 +0000 | [diff] [blame] | 102 | @end example |
| 103 | |
| 104 | The following syntax is understood by the Quagga daemons for configuring SNMP: |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 105 | @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 |