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