No output with custom SNMP check example

CMK version: 2.0.0p39 (CEE)
OS version Ubuntu 22.04:

Hello,

I tried to create a custom SNMP check with the help of this article:
Writing SNMP-based check plug-ins (checkmk.com)

For a first test I only changed the to be detected sysDescr. string to Cisco.
The output of snmpwalk for this is SNMPv2-MIB::sysDescr.0 = STRING: Cisco IOS Software [Cupertino], Catalyst L3 Switch Software…

But even with the sample code I just get nothing in return if I try to run it via:

cmk -vvvI --detect-plugins=flintstone_setup_check.py --debug MYDEVICE

Discovering services and host labels on: MYDEVICE

MYDEVICE:

  • FETCHING DATA

Source: SourceType.HOST/FetcherType.SNMP

[cpu_tracking] Start [7f8061f23250]

[SNMPFetcher] Fetch with cache settings: SNMPFileCache(base_path=PosixPath(‘/omd/sites/mysite/tmp/check_mk/data_source_cache/snmp/MYDEVICE’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)

Not using cache (Mode Mode.FORCE_SECTIONS)

[SNMPFetcher] Execute data source

Not using cache (Mode Mode.FORCE_SECTIONS)

[cpu_tracking] Stop [7f8061f23250 - Snapshot(process=posix.times_result(user=0.010000000000000009, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.010000001639127731))]

Source: SourceType.HOST/FetcherType.PIGGYBACK

[cpu_tracking] Start [7f8061f23610]

[PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath(‘/omd/sites/mysite/tmp/check_mk/data_source_cache/piggyback/MYDEVICE’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)

Not using cache (Mode Mode.FORCE_SECTIONS)

[PiggybackFetcher] Execute data source

No piggyback files for ‘MYDEVICE’. Skip processing.

No piggyback files for ‘1.2.3.4’. Skip processing.

Not using cache (Mode Mode.FORCE_SECTIONS)

[cpu_tracking] Stop [7f8061f23610 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]

  • PARSE FETCHER RESULTS

Source: SourceType.HOST/FetcherType.SNMP

No persisted sections loaded

→ Add sections:

Source: SourceType.HOST/FetcherType.PIGGYBACK

Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

No persisted sections loaded

→ Add sections:

Received no piggyback data

  • EXECUTING HOST LABEL DISCOVERY

Trying host label discovery with:

  • PERFORM HOST LABEL DISCOVERY

  • EXECUTING DISCOVERY PLUGINS (0)

Trying discovery with:

Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

Trying to acquire lock on /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

Got lock on /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

Releasing lock on /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

Released lock on /omd/sites/mysite/var/check_mk/autochecks/MYDEVICE.mk

SUCCESS - Found no new services, no new host labels

What I am doing wrong?

Use the plugin name as defined within the plugin, not the filename. In most cases this means just omitting the suffix .py.

1 Like