Dynamic creation/deletion of HTTP active checks for Plesk hosted domains

Hi,

I manage several Plesk web servers monitored with Checkmk and I would like to automatically create HTTP/HTTPS active checks for the domains hosted on each server.

For example, if I have a Plesk host with the following domains:

  • www.domain1.tld

  • www.domain2.tld

I would like Checkmk to automatically create the corresponding HTTP(S) active checks for each domain.

The main requirement is that the configuration should stay dynamic: if I add a new domain in Plesk, the related HTTP/HTTPS check should be created automatically in Checkmk without manually adding a new endpoint or modifying the rules.

The number of hosted domains can change frequently, so maintaining active check endpoints manually is not really practical.

I was considering creating an agent-based plugin that returns the list of domains from Plesk, but I am not sure if this is the correct approach because the actual HTTP(S) checks should be executed as active checks from the monitoring server, not from the Plesk agent.

Is there a recommended/best practice approach for this scenario?

Would this be better handled with:

  • an agent-based plugin with some kind of discovery mechanism,

  • piggyback hosts,

  • the REST API,

  • or another Checkmk feature?

Thanks!

In the end you need some type of datasource that gives you the information about the existing domains.
If this is special agent against the Plesk installation or an agent plugin producing piggyback data is not important. I would use the piggyback data then to automatically generate the host objects inside a specific folder where already rules exist to assign the HTTP/S checks.

1 Like

Thanks! That sounds like a very clean approach.

Could you elaborate on the “automatically generate the host objects” part?

Are you referring to Dynamic Host Management, the REST API, or another Checkmk mechanism?

If you use the Pro or Ultimate edition i would use the Dynamic Host Management to do this.

1 Like

Sorry, but I use community edition

With community edition you need to use the rest API, to build something like the dynamic host management.
In the end this could be more flexible compared to the DCD :wink:
But it is a significant amount of work.
I would also recommend to use your own site for this self build automation. The Nagios core is not so good to handle too many restarts if you get often changes In your config with new hosts.