diff --git a/scripts/snmpsimd.py b/scripts/snmpsimd.py index b9eafe3..9899e61 100644 --- a/scripts/snmpsimd.py +++ b/scripts/snmpsimd.py @@ -677,6 +677,7 @@ def probeContext(transportDomain, transportAddress, contextName): [--args-from-file=] [--transport-id-offset=] [--v2c-arch] + [--v2c-community] [--v3-only] [--v3-engine-id=] [--v3-context-engine-id=] @@ -707,7 +708,7 @@ def probeContext(transportDomain, transportAddress, contextName): 'daemonize', 'process-user=', 'process-group=', 'pid-file=', 'logging-method=', 'log-level=', 'device-dir=', 'cache-dir=', 'variation-modules-dir=', 'force-index-rebuild', - 'validate-device-data', 'validate-data', 'v2c-arch', 'v3-only', + 'validate-device-data', 'validate-data', 'v2c-arch', 'v2c-community=', 'v3-only', 'transport-id-offset=', 'variation-module-options=', 'args-from-file=', # this option starts new SNMPv3 engine configuration @@ -831,6 +832,9 @@ def probeContext(transportDomain, transportAddress, contextName): elif opt[0] == '--v2c-arch': v2cArch = True + elif opt[0] == '--v2c-community': + v2cCommunityName = opt[1] + elif opt[0] == '--v3-only': v3Only = True @@ -1088,6 +1092,8 @@ def configureManagedObjects(dataDirs, dataIndexInstrumController, log.msg.incIdent() for fullPath, textParser, communityName in getDataFiles(dataDir): + if v2cCommunityName: + communityName = v2cCommunityName if communityName in _dataFiles: log.error( 'ignoring duplicate Community/ContextName "%s" for data '