Page 1 of 1
Safely testing notifications from 2nd nagios host
Posted: Wed Dec 02, 2015 1:20 pm
by mleo40
I have cloned my very large nagios production environment into a dev environment, and I have disabled notifications universally in dev.
However, I need to test my new config's and notification types but without actually sending legit problems from the dev nagios server.
Without picking through and removing or changing my notification contacts for everything, can I selectively send notifications to myself somehow without triggering alerts to to real people?
Does a host definition "notifications_enabled=yes" override the nagios "enable_notification=(no)" ?
Re: Safely testing notifications from 2nd nagios host
Posted: Wed Dec 02, 2015 6:14 pm
by hsmith
mleo40 wrote:
Does a host definition "notifications_enabled=yes" override the nagios "enable_notification=(no)" ?
It does not.
mleo40 wrote:
Without picking through and removing or changing my notification contacts for everything, can I selectively send notifications to myself somehow without triggering alerts to to real people?
Not that I can think of off the top of my head, unfortunately. Would the bulk modification tool work for you?
Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 8:30 am
by mleo40
I don't know what that is, and is it available for core 4.1.1?
Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 10:26 am
by hsmith
mleo40 wrote:
I don't know what that is, and is it available for core 4.1.1?
That's my mistake. For some reason I thought I was posting in the XI forum. It's not available in Core. Being that this is core though, it may be pretty easy to whip up a
sedcommand or two to clean this up for you. We could just bulk change notifications enabled to 0 instead of 1, and then manually fix the ones you're interested in.
Does that make sense? Again, sorry for the confusion.
Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 10:56 am
by mleo40
no worries...thanks for replying.
if it's not possible this thread can be closed out.
Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 12:56 pm
by hsmith
Well, it depends on what you mean by not possible.
Code: Select all
sed -i 's/notifications_enabled.*1/notifications_enabled\t\t\t0/g' templates.cfg
Would change turn notifications off in the file templates.cfg for instance

Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 2:01 pm
by mleo40
Possible with regards to not undoing all my existing config's, or via some easy "built-in" tool.
Everything is possible with the right shell command!
But that solution requires there to be an existing line item for each template already, which I don't.
However...that does give me a path forward. thanks!
Re: Safely testing notifications from 2nd nagios host
Posted: Thu Dec 03, 2015 4:12 pm
by hsmith
Hopefully it helps, would you like this locked at this point?