Host module (Ansible) doesn't have option to configure relay

Hello everyone,

If I’m not mistaken, there is currently no option to create
a host, monitored via a “relay”, right?

Does anyone know if this is planned?

Thanks,
Thomas

There is. But you must use Checkmk 2.5 Ultimate and have the relay already configured.

Thanks Mattias, but I’m talking about the “host module” in the latest ansible collection.

I cannot find a way, to create a host that is “monitored on relay XXX”.
There is a way to do this with a site, but not with a relay.

Am I overlooking something?

I updated the topic to reflect this (the Ansible reference gets lost easily when using the “latest” view).

@robin.gierse can you bring in some light on the scope of the host module? I guess for adding SNMP hosts, it’s a totally valid point. I am not sure about the scope on special agent only hosts with Ansible.

I did not test this, but I would think it should be as easy as this, no additional code necessary:

- checkmk.general.host:
    name: "myhost"
    folder: "/"
    update_attributes:
      relay: "$MY_ID"

P.S.: I updated the title to match naming conventions in Ansible. :slight_smile:

Thanks @robin.gierse! The API documentation seems to agree with you… :slight_smile:

I’ll try it out on one of the next days and will let you know.

Thanks again @robin.gierse: Confirmed. One note one might want to make is that the value
for relay must really be its ID, not its alias. Otherwise you get an error that the relay you’re configuring, doesn’t exist.

Screenshot of relay config, including required values for relay attribute:

:slight_smile: