Skip to content

Commit

Permalink
Merge pull request #2434 from sever-sever/T5702
Browse files Browse the repository at this point in the history
T5702: SNMP add interface-mib max-interfaces-number and prefix
  • Loading branch information
c-po authored Nov 7, 2023
2 parents 45c6b0c + 30a05ee commit c3ddea5
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data/templates/snmp/etc.snmpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ SysDescr {{ description }}
{% endif %}
agentaddress unix:/run/snmpd.socket{{ ',' ~ options | join(',') if options is vyos_defined }}

{% if mib is vyos_defined %}
# Interface MIB limits
{% if mib.interface_max is vyos_defined %}
ifmib_max_num_ifaces {{ mib.interface_max }}
{% endif %}
{% if mib.interface is vyos_defined %}
include_ifmib_iface_prefix {{ mib.interface | join(' ') }}
{% endif %}
{% endif %}

# SNMP communities
{% if community is vyos_defined %}
{% for comm, comm_config in community.items() %}
Expand Down
95 changes: 95 additions & 0 deletions interface-definitions/snmp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,101 @@
</properties>
</leafNode>
#include <include/generic-description.xml.i>
<node name="mib">
<properties>
<help>Management information base (MIB)</help>
</properties>
<children>
<leafNode name="interface-max">
<properties>
<help>Sets the maximum number of interfaces included in IF-MIB data collection</help>
<valueHelp>
<format>u32:1-4294967295</format>
<description>Sets the maximum number of interfaces included in IF-MIB data collection</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-4294967295"/>
</constraint>
</properties>
</leafNode>
<leafNode name="interface">
<properties>
<help>Sets the interface name prefix to include in the IF-MIB data collection</help>
<completionHelp>
<list>br bond dum eth gnv macsec peth sstpc tun veth vti vtun vxlan wg wlan wwan</list>
</completionHelp>
<valueHelp>
<format>br</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>bond</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>dum</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>eth</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>gnv</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>macsec</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>peth</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>sstpc</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>tun</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>veth</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>vti</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>vtun</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>vxlan</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>wg</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>wlan</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<valueHelp>
<format>wwan</format>
<description>Allow prefix for IF-MIB data collection</description>
</valueHelp>
<constraint>
<regex>(br|bond|dum|eth|gnv|macsec|peth|sstpc|tun|veth|vti|vtun|vxlan|wg|wlan|wwan)</regex>
</constraint>
<multi/>
</properties>
</leafNode>
</children>
</node>
<tagNode name="listen-address">
<properties>
<help>IP address to listen for incoming SNMP requests</help>
Expand Down

0 comments on commit c3ddea5

Please sign in to comment.