Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

Status of services (pushed through api) show after icinga2 service was reload #7227

Closed de1m closed 4 years ago

de1m commented 5 years ago

Describe the bug

The error happens only on first start of my container. The container start without any errors und icinga2 can receive data through NSCA (from Windows Server) without errors. I've a cuple of scripts, written in nodejs (icinga2 modul). This scripts create icinga2 objects (hosts and services) and set state of they through icinga2 api. The error is, that the state of this object will be seeable(in icinga2 webgui) after I run the command "service icinga2 reload"

To Reproduce

  1. Start container (show the readme
  2. Create an host and server of them through api
  3. Show the state in webgui

Your Environment

Include as many relevant details about the environment you experienced the problem in

dnsmichi commented 5 years ago

set state of they through icinga2 api.

I assume that a new check result is being pushed via API action. If you're manually modifying the state attribute somehow, this won't trigger any runtime updates towards backends (IDO, etc.).

de1m commented 5 years ago

okay, but after I've reload the icinga2 its working correctly. Can I do somephing, for debug or testing?

dnsmichi commented 5 years ago

So you're modifying the state attribute in your library? This is not supported by design.

de1m commented 5 years ago

What do you mean with "state attribute"? "Custom Variables" in Icinga2 webgui? or the "vars" in config file?

object Host "k8s-ext-pods-monitoring" {
        import "passive-host"

        display_name = "k8s-ext-pods-monitoring"
        vars["group"] = "adito"
        vars["server"] = "k8s"
        version = 1559720645.693325
        zone = "30b5d7050d6f"
}
de1m commented 5 years ago

hm... I've changed my Script, that create now this object

object Host "k8s-ext-pods-monitoring" {
        import "passive-host"

        display_name = "k8s-ext-pods-monitoring"
        version = 1560243611.427802
        zone = "30b5d7050d6f"
}

but I get the same error

dnsmichi commented 5 years ago

Hm, I think I misunderstood the meaning of "set a state", which is done via the process-check-result action. The host object and its changed state is visible via REST API, right?

Then I'd point to IDO activation bugs collected in #6012.

lippserd commented 4 years ago

Hi @de1m,

If you still have this problem, please open a new issue. I close this one in the meantime.

For the records, I doubt that it is a good idea to add version and zone to the configuration. But that is just a blind guess.

All the best, Eric