Hello!
I’m writing a custom plugin to monitor a service.
In the agent side, I wrote a plugin with the following example output:
<<<myapp_webservice>>>
appname^51000
Then, in the check_mk server, I want to write the discovery and check functions to work with this data.
For my check function, I need to known the IP address of the host, linke in the $HOSTADDRESS$ macro but within the python script.
So the check will be monitoring the service in the URL: http://{hostaddress}:51000/appname
Can you tell me how I can know the host IP address from within the python script?
Yes, a datasource agent would be the better solution I guess.
If you just want to check HTTP you may use check_http together with Nagios macros.
We put for example the application in host alias and use $HOSTALIAS$ to build the URL.
I’m not sending the host IP because it may be several IP address in the host, and I’m interested in the one that CheckMK server has configured for monitoring that host.
I understand the limitation. I suppose I will be doing a local check then, because I want this to be automated when I deploy the agent, and in check_http service I will still need to manualy enter the port.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.