Hi!
In my company, we have some application on server that are started\required “On-Demand”.
When this kind of server (usually in the public cloud) are requested\turned ON.
Then I need to start to monitoring it.
Usually they are Turned OFF so I cannot use a TimePeriod to reach this goal.
I need something that enable\disable the monitoring for these servers when they are started.
I use RUNDECK as job scheduler - so I’m asking if there is a “command” or a API call I can use to anable\disable the monitoring for this server.
REgards
P.
Hello
If this is a cloud server you can use the boot time cloud-init execution to send an API call the register with Icinga and start the monitoring.
you can also send an API call and alter the run time attributes to disable the active status
The server is just registered and configured on ICINGA.
Yes, it is in the cloud but in this case id does not matter, i mean.
But due to the fact that is consumed on demand - I cannot use the Downtime scheduled or Timeperiod to monitor it.
I need something that ENABLE Monitoring at startup, and after DISABLE monitoring at shutdown.
P.
Assaf already had a good idea here. You start with active checks disabled, that is enable_active_checks = false in your config. Later you modify this attribute via the API and enable it:
I Try your command with my HOST…
But unfortunately do not work.
I receive error:
{“error”:404.0,“status”:“No objects found.”}
I used this command running from ICINGA server:
I still have error…
I do not undestand why!
Unfortunately I do not know very well curl…
But the commandis quite simple!
Still HAVE “NO OBJECT FOUND” !!
OK. The host was initially DISABLED and due to this, was not found by curl.
After I ENABLED the monitoring for this host - I was able to find it with curl.
But I’m looking just for something that ENABLE\DISABLE the host&services monitoring…
If curl do not found the host When it is DISABLED - This procedure cannot be used!
Any other ideas ?
My goal is to modify this properties with curl:
Okay, in that case it’s important to know that you’re using the Director. The way we showed you just disables active checks on a host and doesn’t disable the whole object. That never touched the Director side of things.
I try with curl and xcept for http instead of https (I do not use https) - Seems to work fine!
… But after I need to perform a Deploy. Is there a way to perform a deploy using curl ?
Also with other command (cli) you need to perform a deploy in order to changes take effect