Howto force hoststatus to down from piggyback data

I wrote a check for unifi controller api (if someone is interrested GitHub - bashclub/check-unifi-controller: Checkmk special agent for checking unifi controller )

I and have two problems with the handling of parent.

  1. device is status “disconnected” the device(host/piggyback) should go down and not show missing services.
  2. if the controller goes down - all devices report errors because of missing piggyback (even with the controller as parent) and should behave as parent goes down

someone have any ideas how to solve this?

using Host monitoring Rule with
host label: cmk/piggyback_source_unifi:yes
and Service “device status” seems to do the hostcheck thing

aftersome testing, the solution is not working as excepected.
i would like to make all piggyback hosts UNREACH if controller is (for whatever reason) is not reachable.

i tried with changing host monitoring rule to check_mk service which works if the controller is “down”. But now the above method to make disconnected devices as HOST down dont work anymore.

i will look through the vsphere code as that seems todo (atleast the UNREACH) part.

If you want UNREACH then you need to a parent - child relationship between these two hosts.

allready done that. But special_agent check dont set the host (unifi controller) status to down only check_mk service to crit.
Even if I set host (unifi controller) to down, the piggyback hosts are not going down only check_mk service crit with “no piggyback data”
if i set host monitoring on the piggybacks to check_mk service its working with UNREACH, but i can no longer down the Host with another service tag.

Can vSphere special_agent do that with esx hosts if they are down? or is check_mk service only showing missing item?
how it should look if down - but not working anymore if piggyback source missing.

Ok the problem is that you have two different services who gave you an information about the host status.
I think there is no easy solution for this problem. Or better said no solution out of the box.

is it possible to intercept the “no piggyback data” error?

Yes you can change the state of the CMK service.

1 Like