CMK version:
CheckMK 2.4.0p5 raw edition
OS version:
Ubuntu 24.04.2 LTS
Error message:
Output of “cmk --debug -vvn hostname”:
OMD[site]:~$ cmk --debug -vvvvvI hostname
Discovering services and host labels on: hostname
hostname:
+ FETCHING DATA
Source: SourceInfo(hostname='hostname', ipaddress='10.10.10.10', ident='snmp', fetcher_type=<FetcherType.SNMP: 7>, source_type=<SourceType.HOST: 1>)
[cpu_tracking] Start [7e6fdb5fdb80]
Read from cache: SNMPFileCache(path_template=/omd/sites/site/tmp/check_mk/data_source_cache/snmp/{mode}/hostname, max_age=MaxAge(checking=0, discovery=90.0, inventory=90.0), simulation=False, use_only_cache=False, file_cache_mode=1)
SNMP scan:
Getting OID .1.3.6.1.2.1.1.1.0...
Running 'snmpget -v3 -l authPriv -a sha -u redacted -A redacted -x AES -X redacted -m "" -M "" -On -OQ -Oe -Ot 10.10.10.10 .1.3.6.1.2.1.1.1.0'
ERROR: SNMP error: snmpget: Bad context specified
Getting OID .1.3.6.1.2.1.1.1.0 failed.
Hi,
When using SNMPv3 contexts configured in Checkmk, the context isn’t being applied to snmpget calls. If I hardcode the context (e.g., -n Jetdirect) in lib/python3/cmk/fetchers/snmp_backend/classic.py, the snmpget command succeeds and retrieves the correct data. Subsequent snmpbulkwalk calls then correctly pick up and apply the context from the Checkmk configuration. It appears that snmpget is ignoring the configured SNMPv3 context. Is this a bug, or am I missing something?
