diff --git a/conf/config.json b/conf/config.json index 933fa6f..fc89762 100644 --- a/conf/config.json +++ b/conf/config.json @@ -36,7 +36,7 @@ "auth": { "version2": { "enabled": true, - "community": "public" + "community": ["public", "private"] }, "version3": { "enabled": true, diff --git a/conf/config.json.default b/conf/config.json.default index bb284df..6d2a21d 100644 --- a/conf/config.json.default +++ b/conf/config.json.default @@ -32,7 +32,7 @@ "auth": { "version2": { "enabled": true, - "community": "public" + "community": ["public", "private"] }, "version3": { "enabled": true, diff --git a/src/sensu/snmp/receiver.py b/src/sensu/snmp/receiver.py index 76aef6f..ff11fdd 100644 --- a/src/sensu/snmp/receiver.py +++ b/src/sensu/snmp/receiver.py @@ -82,10 +82,11 @@ def _configure_tcp_transport(self, listen_address, listen_port): #log.info("TrapReceiver: Initialized SNMP TCP Transport on %s:%s" % (listen_address, listen_port)) pass - def _configure_snmp_v2(self, community): + def _configure_snmp_v2(self, communities): # v1/2 setup - pysnmp.entity.config.addV1System(self._snmp_engine, 'sensu-trapd-agent', community) - log.debug("TrapReceiver: Initialized SNMPv1 Auth") + for community in communities: + pysnmp.entity.config.addV1System(self._snmp_engine, "sensu-trapd-agent-%s" % community, community) + log.debug("TrapReceiver: Initialized SNMPv1 Auth with community '%s'" % community) def _configure_snmp_v3(self, users): # configure snmp v3 users