From 0368739eacddb80efd6234def22370a8c8222935 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sat, 31 Dec 2016 14:29:01 +0100 Subject: [PATCH] net-snmp: enable AgentX support Signed-off-by: Stijn Tintel --- net/net-snmp/Makefile | 6 +++--- net/net-snmp/files/snmpd.conf | 3 +++ net/net-snmp/files/snmpd.init | 8 ++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 893eee005f..a4a83892ce 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -100,6 +100,7 @@ endef SNMP_MIB_MODULES_INCLUDED = \ + agentx \ host/hr_device \ host/hr_disk \ host/hr_filesys \ @@ -141,7 +142,6 @@ SNMP_MIB_MODULES_INCLUDED = \ SNMP_MIB_MODULES_EXCLUDED = \ agent_mibs \ - agentx \ disman/event \ disman/schedule \ hardware \ @@ -157,9 +157,9 @@ SNMP_MIB_MODULES_EXCLUDED = \ udp-mib \ utilities \ -SNMP_TRANSPORTS_INCLUDED = Callback UDP +SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix -SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix +SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 TARGET_CFLAGS += $(FPIC) diff --git a/net/net-snmp/files/snmpd.conf b/net/net-snmp/files/snmpd.conf index 4bdc3d4d43..e21dc5771d 100644 --- a/net/net-snmp/files/snmpd.conf +++ b/net/net-snmp/files/snmpd.conf @@ -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 diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index ff780975de..11dc381b27 100644 --- a/net/net-snmp/files/snmpd.init +++ b/net/net-snmp/files/snmpd.init @@ -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 -- 2.30.2