thank you,
so far I created a executable file mk_osmap in /usr/lib/check_mk_agent/plugins.
#!/bin/sh
echo '<<<mk_osmap>>>'
curl "https://api.opensensemap.org/boxes/5b1d9ddd1fef04001b15460e?format=json"
and another file mk_osmap.py in local/lib/check_mk/base/plugins/agent_based
from .agent_based_api.v1 import *
***def discover_mk_osmap(section):***
*** yield Service()***
***def check_mk_osmap(section):***
*** for line in section:***
*** if line[0].startswith("usb-SCSI_DISK"):***
*** yield Result(state=State.CRIT, summary="Found USB stick")***
*** return***
*** yield Result(state=State.OK, summary="No USB stick found")***
register.check_plugin(
name="mk_osmap",
service_name="OpenSenseMap",
discovery_function=discover_mk_osmap,
check_function=check_mk_osmap,
)
All the tex within the *** *** ist from the website example and so it will surely not work.
I think this is the part where I really need help…
Mike