Hello! How are you?
I’m trying to write a plugin for my CheckMK to read data via REST API from a group of devices to collect disk information, such as status and size.
I used the OmeTemp example here and it worked fine, however, I haven’t had any success with my own plugin yet.
I’m not a good programmer, but I already have other SNMP plugins for the same devices working, however, I can’t get information about the disks via SNMP and,
since the device makes this information available via API, that’s why I’m trying to write this Special Agent Plugin to read and monitor this data.
My big problem is: I noticed that in the OmeTemp example, the URL is static: "url = “https://api.open-meteo.com…”. In order for my agent to correctly access the device’s API data,
I would need to build this URL dynamically, like: http://monitored_host_ip_address/cgi-bin… However, I haven’t found any way to get the IP of the monitored host to pass to the script.
I did a lot of research, read topics from people who had the same problem, however, in older versions of CheckMK. I believe that in these new versions this has already been overcome,
although I haven’t found any answer that works so far.
I would be grateful if you could point me in some direction - or even if you tell me that I’m seeing this wrong.
Elbe