Page 1 of 1

Can't disable notifications (cli)

Posted: Mon Mar 19, 2018 2:55 pm
by rdubya
This is so simple I'm confused as to why it doesn't work (core 4.1.1 centos 6.6).

I've tried at the host level;

Code: Select all

define host{
        use             linux-box
        host_name       blackduck
        alias           BlackDuck
        address         x.x.x.x ; IP address of the server
        hostgroups      release-build-systems
        notifications_enabled   0
}
and I've tried at the service level;

Code: Select all

define service{
        use                     generic-service
        host_name               blackduck
        service_description     ProtexIP HTTP
        check_command           check_nrpe!check_url1
        notifications_enabled   0
}
Using

Code: Select all

notifications_enabled=0 
gets me this;
Error: Could not add object property in file '/usr/local/nagios/etc/objects/hosts/blackduck.cfg' on line 43.

Code: Select all

Using notifications_enabled = 0 
passes a restart check but still does nothing.

After each change, I restart the nagios service.
At first I didn't see the squelched alerts icon and figured that was just an oversight, but when I kill nrpe I still get alerts to email and slack.

Any takers?

Re: Can't disable notifications (cli)

Posted: Mon Mar 19, 2018 4:08 pm
by npolovenko
@rdubya, You said Nagios server passes the restart command but yet you see:

Code: Select all

Error: Could not add object property in file '/usr/local/nagios/etc/objects/hosts/blackduck.cfg' on line 43.
Where do you see this error?

Can you run this command and post the output?

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: Can't disable notifications (cli)

Posted: Tue Mar 20, 2018 9:13 am
by rdubya
Thanks.
Here's the output you requested; https://pastebin.com/hU5MLbNp
Here's the config for the host; https://pastebin.com/0waN5dEn

Sorry, I wasn't clear.
This fails pre-flight;

Code: Select all

notifications_enabled=0 
These pass pre-flight, but have no effect;

Code: Select all

notifications_enabled = 0
notifications_enabled 0  
I still get notifications from the host;
Slack; https://ibb.co/bXbL2x
Email; https://ibb.co/giUq2x

This is the case no matter where I place the statement.

Thanks, R

Re: Can't disable notifications (cli)

Posted: Tue Mar 20, 2018 8:28 pm
by mcapra
Here's a few similar issues I helped other users work through:
https://support.nagios.com/forum/viewto ... =7&t=46010
https://support.nagios.com/forum/viewto ... 16&t=42527

Strictly speaking, notifications_enabled 0 should be working as intended. I've never been very clear on which takes precedence though; status.dat or the object's configuration.

As a note, these actions will immediately re-schedule all of your checks on daemon start and can be quite resource intensive.

You might try stopping the Nagios service, removing status.dat and retention.dat, then restarting the Nagios service.

Re: Can't disable notifications (cli)

Posted: Wed Mar 21, 2018 9:57 am
by tmcdonald
Thanks for the assist, @mcapra!

Re: status.dat vs object config, it should be status.dat as that is the running state of the objects, and can be modified by things like downtime and acknowledgements.

@rdubya, let us know if you have further (related) questions.

Re: Can't disable notifications (cli)

Posted: Thu Mar 22, 2018 11:08 am
by rdubya
Sorry for the late response, we've had some things pop up.

Thanks for this (and the links, I was permitted to see at least one of them), it helps some. As far as status.dat goes, that seems to be deleted when the nagios service is stopped although retention remains. Re-setting the entire inventory does some to be drastic, but if works it works.

I'm going to see about using/adapting some of the curl commands I've seen, I'll return with what I find.

Thanks again, R

Re: Can't disable notifications (cli)

Posted: Thu Mar 22, 2018 4:56 pm
by lmiltchev
I'm going to see about using/adapting some of the curl commands I've seen, I'll return with what I find.
Sure. Let us know how it went. We will keep this thread open for the time being.