Page 1 of 1

External command to change parents?

Posted: Tue Jun 26, 2012 10:22 am
by Steffan
Hi there,

Im new at this forum :)

I just want to say that i use nagios core a lot. monitoring around 130 hosts and 1000 services (mostly custom scripts).

But today i had a great idear:

I was building up my configuration with "Parents" so my statusmap could be used, but then i got to all our virtual machines on our ESX cluster that use DRS (migrates virtual machines around on the physical hosts) and therefore i cant set a static parent on those virtual machines because i never know which host they are running on. therefore i decided to write a script to get a list of all the vritual machines on lets say "host 1" and then change the parents on those virtual machines in nagios....... but.. there a no external command for changing parents?!?!

So im pretty much screwed here... can anyone help me ? is it planed to create this external command in a future release ??


sorry for bad writing and spelling, but im sure you will understand ;)

regards
Steffan

Re: External command to change parents?

Posted: Tue Jun 26, 2012 10:45 am
by mguthrie
That would be a tricky thing to add an external command for, because external commands are primarily for changing runtime settings, not object configurations. Things like notifications_enabled can be turned off and on at runtime, but in order to change a parent, Nagios would have to re-verify the configuration and restart each time this happened. However, you could look at some way to automate modifying the host configs, verify, then restart nagios.

Re: External command to change parents?

Posted: Wed Jun 27, 2012 2:47 am
by Steffan
mguthrie wrote:That would be a tricky thing to add an external command for, because external commands are primarily for changing runtime settings, not object configurations. Things like notifications_enabled can be turned off and on at runtime, but in order to change a parent, Nagios would have to re-verify the configuration and restart each time this happened. However, you could look at some way to automate modifying the host configs, verify, then restart nagios.
Thanks for your answer!

But wont it break/screw up nagios, stats, active check's or anything like that if i keep restarting the nagios process every 5 minutes automaticly ??

Re: External command to change parents?

Posted: Wed Jun 27, 2012 9:02 am
by mguthrie
No, it doesn't break anything as long as the new configuration is valid. The monitoring engine will only be stopped for a matter of seconds during the restart, but that's about it. There are users who use elastic cloud services and automatically add and remove hosts all of the time, so regular restarts are just part of their routine.