Monitor via hostname instead of IP

Good morning CheckMK Community,

I wanted to see if it was possible to monitor a host in our environment using the hostname instead of ip address.

The main reasoning behind this is - since one of our departments relies on DHCP to assign the machine an ip address, it could potentially change from time to time. I know long term I’ll eventually get them to dhcp reserved, but figured to reach out to see if anyone has a setup that works for this or has a possible working solution to use for the configuration.

As always any help is always greatly appreciated!

Best Regards,

Justin

You can put the hostname into the IP address field. Then every time the agent is queried or an active check runs DNS will be used to resolve it.

3 Likes

As always thank you @r.sander for the very helpful recommendation. Just threw in the hostname and worked like a charm!

Hope you have a great day.

1 Like

In general, you might want to turn on the inline help to discover such “hidden features”.
For the IP (v4|v6) address field, it says:

[…] If you enter a DNS name here, the DNS resolution will be carried out each time the host is checked. Check_MKs DNS cache will NOT be queried. Use this only for hosts with dynamic IP addresses.

3 Likes

That’s a good catch, where is that located under WATO?

Since these hosts will at some point have a new address I would imagine that the updated one would carry over to CheckMK as i’m now monitoring the hostname instead of IP, is that not the case?

The inline help in WATO can be found here:
image

if you are on 1.6 or below, there is a little icon of a book (or stack of books) at the very top right corner of the checkmk WEB-UI

2 Likes

Yes, you should be good. That’s exactly the point of that feature, just as r.sander explained.
I just wanted to point out how to find out such not-too-obvious features :slightly_smiling_face:

1 Like

Perfect, honestly you saved my bacon, did not realize there was a feature that does this for me automatically.

Thank you @martin.schwarz for the assist as well!

This reminds me of the story (not sure if it’s an urban myth) of Microsoft doing a customer survey of what features people would like to have in one of their office products (I believe it was Word).

Turns out that more than 90% of what people mentioned already existed. It was just well hidden :grin: Checkmk can be like that as well, sometimes.

1 Like

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.