Page 1 of 1

How to setup a NOALERT Contact

Posted: Tue Oct 16, 2018 10:07 pm
by kwhogster
Nagios 4.3.4
I am defining a service to check which will call a .sh file I wrote to schedule downtime..

I want to add the contact on the service so it will not send any alerts on this check.

So I created a noalerts contact

Code: Select all

define contact{
        contact_name                    noalerts
        alias                           Send No Alerts
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        }
When I run the Nagios verify config I get these errors
/usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg

Error: Contact 'noalerts' has no service notification commands defined!
Error: Contact 'noalerts' has no host notification commands defined!


I have other contacts with those two commands like below

service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email


I do not want to send notification at all for the service

Any ideas?

Thank you

Tom

Re: How to setup a NOALERT Contact

Posted: Wed Oct 17, 2018 11:30 am
by npolovenko
Hello, @kwhogster. You can still include a notification command for the contact, but change the notification options to None.
host_notification_options n,
service_notification_options n,

Re: How to setup a NOALERT Contact

Posted: Wed Oct 17, 2018 11:13 pm
by kwhogster
Thanks
got this instead

Code: Select all

define contact{
        contact_name                    noalerts
        alias                           Send No Alerts
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        service_notification_commands   n,
        host_notification_commands      n,
        }
Error: Service notification command 'n' specified for contact 'noalerts' is not defined anywhere!
Error: Host notification command 'n' specified for contact 'noalerts' is not defined anywhere!

Any ideas

Re: How to setup a NOALERT Contact

Posted: Wed Oct 17, 2018 11:19 pm
by kwhogster
OOPS

I misread your commands it was options not commands

Code: Select all

define contact{
        contact_name                    noalerts
        alias                           Send No Alerts
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    n,
        host_notification_options       n,
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        }
Now this runs thru with non errors

Thank you

Tom

Please Lock this as resolved.

Re: How to setup a NOALERT Contact

Posted: Thu Oct 18, 2018 9:59 am
by npolovenko
@kwhogster, Glad this worked for you. Closing this thread as resolved.