Can't disable notifications (cli)

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
rdubya
Posts: 40
Joined: Mon Apr 11, 2016 8:38 am

Can't disable notifications (cli)

Post 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?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't disable notifications (cli)

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rdubya
Posts: 40
Joined: Mon Apr 11, 2016 8:38 am

Re: Can't disable notifications (cli)

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Can't disable notifications (cli)

Post 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.
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can't disable notifications (cli)

Post 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.
Former Nagios employee
rdubya
Posts: 40
Joined: Mon Apr 11, 2016 8:38 am

Re: Can't disable notifications (cli)

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Can't disable notifications (cli)

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked