Anyone already play/work and automated the downtime when a host is rebooting or shutdown for maintenance ?
Instead of having to manually trigger a downtime on a host, it will be way better to have something that run at reboot/shutdown and after that, something that run at boot to remove the downtime period…
thanks Antony…
so the best for that it’s to create a “dummy” user that have less permission so we can use it everywhere even in “servers” at client’s site
Don’t really like the idea of having the login and password in a script
I run my script from an installation server which then connects to the machine
being worked on and does whatever is needed (possibly including a reboot, or
restarting services), so I trust that installation server to talk to the
Icinga server with a scripted password.
If you want the machine which is actually being worked on to send the requests
to Icinga, though, then agreed, you want either a low-priviledge user, or else
a wrapper script on the Icinga server which can only do this function, and you
call that (eg: over SSH) from the machine being worked on, with its name as a
parameter.
Then the Icinga password is only on the Icinga machine, and the wrapper script
ensures that this downtime stuff is the only thing that anyone who gets SSH
access to it can do.
Its simple. It is triggered by icinga eventhandler as soon the state changes from OK to DOWN, Depending on the ‘max_check_attempts’ it will trigger a downtime for the host and it services before the host reaches a ‘hard’ state.
You should only use it for hosts that go down without notice for the admins, like workstations etc.