net-snmp: enable AgentX support

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel
2016-12-31 14:29:01 +01:00
parent f9e96a9169
commit 0368739eac
3 changed files with 14 additions and 3 deletions
+3
View File
@@ -1,6 +1,9 @@
config agent
option agentaddress UDP:161
config agentx
option agentxsocket /var/run/agentx.sock
config com2sec public
option secname ro
option source default
+8
View File
@@ -15,6 +15,13 @@ snmpd_agent_add() {
echo "agentaddress $agentaddress" >> $CONFIGFILE
}
snmpd_agentx_add() {
local cfg="$1"
echo "master agentx" >> $CONFIGFILE
config_get agentxsocket "$cfg" agentxsocket
[ -n "$agentxsocket" ] && echo "agentXSocket $agentxsocket" >> $CONFIGFILE
}
snmpd_system_add() {
local cfg="$1"
config_get syslocation "$cfg" sysLocation
@@ -199,6 +206,7 @@ start_service() {
config_load snmpd
config_foreach snmpd_agent_add agent
config_foreach snmpd_agentx_add agentx
config_foreach snmpd_system_add system
config_foreach snmpd_com2sec_add com2sec
config_foreach snmpd_com2sec6_add com2sec6