]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/snmp.rst
Merge pull request #3163 from donaldsharp/more_vty_errors
[mirror_frr.git] / doc / user / snmp.rst
1 .. _snmp-support:
2
3 ************
4 SNMP Support
5 ************
6
7 :abbr:`SNMP (Simple Network Managing Protocol)` is a widely implemented feature
8 for collecting network information from router and/or host. FRR itself does
9 not support SNMP agent (server daemon) functionality but is able to connect to
10 a SNMP agent using the the AgentX protocol (:rfc:`2741`) and make the
11 routing protocol MIBs available through it.
12
13 Note that SNMP Support needs to be enabled at compile-time and loaded as module
14 on daemon startup. Refer to :ref:`loadable-module-support` on the latter.
15
16 .. _getting-and-installing-an-snmp-agent:
17
18 Getting and installing an SNMP agent
19 ====================================
20
21 The supported SNMP agent is AgentX. We recommend to use
22 the latest version of `net-snmp` which was formerly known as `ucd-snmp`. It is
23 free and open software and available at `http://www.net-snmp.org/ <http://www.net-snmp.org/>`_
24 and as binary package for most Linux distributions.
25
26 .. _agentx-configuration:
27
28 AgentX configuration
29 ====================
30
31 .. program:: configure
32
33 To enable AgentX protocol support, FRR must have been build with the
34 :option:`--enable-snmp` or `--enable-snmp=agentx` option. Both the
35 master SNMP agent (snmpd) and each of the FRR daemons must be configured. In
36 :file:`/etc/snmp/snmpd.conf`, the ``master agentx`` directive should be added.
37 In each of the FRR daemons, ``agentx`` command will enable AgentX support.
38
39 :file:`/etc/snmp/zebra.conf`:
40
41 ::
42
43 #
44 # example access restrictions setup
45 #
46 com2sec readonly default public
47 group MyROGroup v1 readonly
48 view all included .1 80
49 access MyROGroup "" any noauth exact all none none
50 #
51 # enable master agent for AgentX subagents
52 #
53 master agentx
54
55 :file:`/etc/frr/ospfd.conf:`
56
57 .. code-block:: frr
58
59 ! ... the rest of ospfd.conf has been omitted for clarity ...
60 !
61 agentx
62 !
63
64
65 Upon successful connection, you should get something like this in the log of
66 each FRR daemons:
67
68 ::
69
70 2012/05/25 11:39:08 ZEBRA: snmp[info]: NET-SNMP version 5.4.3 AgentX subagent connected
71
72
73 Then, you can use the following command to check everything works as expected:
74
75 ::
76
77 # snmpwalk -c public -v1 localhost .1.3.6.1.2.1.14.1.1
78 OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109
79 [...]
80
81
82 The AgentX protocol can be transported over a Unix socket or using TCP or UDP.
83 It usually defaults to a Unix socket and depends on how NetSNMP was built. If
84 need to configure FRR to use another transport, you can configure it through
85 :file:`/etc/snmp/frr.conf`:
86
87 ::
88
89 [snmpd]
90 # Use a remote master agent
91 agentXSocket tcp:192.168.15.12:705
92
93
94 Here is the syntax for using AgentX:
95
96 .. index:: agentx
97 .. clicmd:: agentx
98 .. index:: no agentx
99 .. clicmd:: no agentx
100
101
102 .. include:: snmptrap.rst