External command to change parents?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Steffan
Posts: 13
Joined: Tue Jun 26, 2012 10:13 am

External command to change parents?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: External command to change parents?

Post 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.
Steffan
Posts: 13
Joined: Tue Jun 26, 2012 10:13 am

Re: External command to change parents?

Post 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 ??
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: External command to change parents?

Post 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.
Locked