Dynamically modifying Nagios config

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
yashgt
Posts: 6
Joined: Sat Sep 01, 2012 12:37 am

Dynamically modifying Nagios config

Post by yashgt »

We have a few services which will startup and shutdown at various times. Due to this it is not possible to include them in the nagios configuration upfront.
I would like to periodically poll a DB or a file to enlist the dynamic services and modify the nagios config so that they show up on the Nagios dashboard.
Is there built-in support for such a thing in nagios? If not I would be restarting Nagios everytime the config is changed by a background process.

Thanks,
Yash
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Dynamically modifying Nagios config

Post by tmcdonald »

One solution if you know when they will be down is to configure scheduled/recurring downtime for each service. That way at least they will not alert/notify when down. As for actually removing them from the graphical interface, I do not know of a way to do this personally. I will check with some co-workers and get back to you.
Former Nagios employee
wfournier
Posts: 7
Joined: Fri Oct 04, 2013 2:44 am

Re: Dynamically modifying Nagios config

Post by wfournier »

Add register 0 to remove them but still keep the config. You can reload (kill -1) the nagios process instead of restarting.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dynamically modifying Nagios config

Post by abrist »

wfournier wrote:Add register 0 to remove them but still keep the config. You can reload (kill -1) the nagios process instead of restarting.
correct.
You will only be able to remove the config objects from the frontend, as adding them would require a restart/reload.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked