Discussion:
[Check_mk (english)] Can the 'parents' value be dynamic?
Ronald
2018-11-14 20:55:55 UTC
Permalink
Dear All,

I am trying to investigate if it is possible to make the 'parents' value of
a host a dynamic value.

In this case I would like to automatically make Check_MK aware of the Host
(Hypervisor) where a Guest (VM) is running on. As the VM can switch between
some Hosts it would be ideal if the 'parent' value is also switched (eg
during next inventory check.

The Hypervisor in this case is KVM host. Within the guest I have the
hostname present by means of a virtio-shared file containing the hostname,
and made it present in the agent output (as a start):

<<<local>>>
0 Hypervisor count=0 OK - kvm.site.domain.tld is the Hypervisor
I did already attempt to set the name via check_mk_agent, but this does not
seem to work.
<<<local>>>
parents = kvm.pi1vbg.ampr.org
Is there a variable to be used in this case?

Any help would be appreciated.

Best regards,

Ron
Robert Sander
2018-11-15 09:10:34 UTC
Permalink
In this case I would like to automatically make Check_MK aware of the Host (Hypervisor) where a Guest (VM) is running on. As the VM can switch
between some Hosts it would be ideal if the 'parent' value is also switched (eg during next inventory check.
You can do this by using the WATO API.

I have an example script for VMware ("ESX Hostsystem" service check):

https://github.com/HeinleinSupport/check_mk/blob/master/helper/vm_parent.py

It uses my Check_MK API wrapper available at:

https://github.com/HeinleinSupport/check_mk/tree/master/checkmkapi

Regards
--
Robert Sander
Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin

https://www.heinlein-support.de

Tel: 030 / 405051-43
Fax: 030 / 405051-19

Amtsgericht Berlin-Charlottenburg - HRB 93818 B
GeschÀftsfÌhrer: Peer Heinlein - Sitz: Berlin
Loading...