Computer and IT knowledge - things to know
checkmk - write a simple snmp check plugin-in
- own plugins should be put to directory: ~/local/lib/python3/cmk_addons/plugins/
- create 2 new directories
mkdir ~/local/lib/python3/cmk_addons/plugins/HelloWorld
mkdir ~/local/lib/python3/cmk_addons/plugins/HelloWorld/agent_based
mkdir ~/local/lib/python3/cmk_addons/plugins/HelloWorld/checkman
- move to directory:
cd ~/local/lib/python3/cmk_addons/plugins/HelloWorld/agent_based
- write plugin
file: /local/lib/python3/cmk_addons/plugins/HelloWorld/agent_based/HelloWorld_status.py
- write man page:
file: /local/lib/python3/cmk_addons/plugins/HelloWorld/checkman/HelloWorld_status
- test plugin
cmk --debug -nv --detect-plugins=HelloWorld_status HOSTNAME
cmk --debug -II -vv --detect-plugins=HelloWorld_status HOSTNAME
cmk -v --detect-plugins=HelloWorld_status HOSTNAME
- things to do if you do minor changes on python plugin code
rediscover: cmk --debug -II -vv --detect-plugins=HelloWorld_status HOSTNAME
restart cmk: cmk -R
- build module out ot the files
-- make new properties file: mkp template hello_world_ng > Created '/omd/sites/site1/tmp/check_mk/HelloWorld.manifest.temp'.
-- make the file: mkp package ~/tmp/check_mk/HelloWorld.manifest.temp
-- Packages are stored under ~/var/check_mk/packages_local
- make a change in a mkp file
-- run mkp release HelloWorld
-- get info file from old mkp
#see also:
- https://docs.checkmk.com/latest/en/devel_check_plugins_snmp.html
- https://docs.checkmk.com/latest/en/mkps.html
computer2know :: thank you for your visit :: have a nice day :: © 2025