mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net-mgmt/net-snmp: add listen field (#717)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
PLUGIN_NAME= net-snmp
|
||||
PLUGIN_VERSION= 0.1
|
||||
PLUGIN_VERSION= 0.2
|
||||
PLUGIN_COMMENT= Net-SNMP is a daemon for the SNMP protocol
|
||||
PLUGIN_DEPENDS= net-snmp
|
||||
PLUGIN_MAINTAINER= m.muenz@gmail.com
|
||||
|
||||
@@ -23,4 +23,12 @@
|
||||
<type>text</type>
|
||||
<help>Set the contact address to use.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>general.listen</id>
|
||||
<label>Listen IPs</label>
|
||||
<style>tokenize</style>
|
||||
<type>select_multiple</type>
|
||||
<allownew>true</allownew>
|
||||
<help>Set the IP addresses the service should listen to.</help>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
@@ -19,5 +19,9 @@
|
||||
<default></default>
|
||||
<Required>N</Required>
|
||||
</syscontact>
|
||||
<listen type="NetworkField">
|
||||
<FieldSeparator>,</FieldSeparator>
|
||||
<Required>N</Required>
|
||||
</listen>
|
||||
</items>
|
||||
</model>
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
{% if helpers.exists('OPNsense.netsnmp.general.enabled') and OPNsense.netsnmp.general.enabled == '1' %}
|
||||
|
||||
{% from 'OPNsense/Macros/interface.macro' import physical_interface %}
|
||||
|
||||
{% if helpers.exists('OPNsense.netsnmp.general.listen') and OPNsense.netsnmp.general.listen != '' %}
|
||||
{% for network in OPNsense.netsnmp.general.listen.split(',') %}
|
||||
{% if ':' not in network %}
|
||||
agentAddress udp:{{ network }}:161
|
||||
{% else %}
|
||||
agentAddress udp6:[{{ network }}]:161
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
agentAddress udp:161,udp6:[::1]:161
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if helpers.exists('OPNsense.netsnmp.general.community') and OPNsense.netsnmp.general.community != '' %}
|
||||
rocommunity {{ OPNsense.netsnmp.general.community }}
|
||||
|
||||
Reference in New Issue
Block a user