contacts.cfg is not working properly

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
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

contacts.cfg is not working properly

Post by sinkak »

Code: Select all

define contact{
        contact_name                    wsawarn
        alias                           WSAWarn
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                              [email protected]
       }

Code: Select all

define contact{
        contact_name                    root
        alias                           ROOT
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c
        host_notification_options       d
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        service_notification_commands   notify-service-by-sms-only-once
        host_notification_commands      notify-host-by-sms-only-once
        email                                [email protected]
        }

Code: Select all

define contactgroup{
        contactgroup_name       DevNull
        members                 wsawarn
        }

define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 wsawarn,root
        }


only warnings are working not critical alerts.
Please explain where is the mistake in config?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Are you not getting critical notifications for either of these contacts, or just the admins?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

i am getting critical and warnings from warning email address ( [email protected]).

But nothing from 911 email address ([email protected]).
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Let's try changing

Code: Select all

define contact{
        contact_name                    root
        alias                           ROOT
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c
        host_notification_options       d
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        service_notification_commands   notify-service-by-sms-only-once
        host_notification_commands      notify-host-by-sms-only-once
        email                                [email protected]
        }
to

Code: Select all

define contact{
        contact_name                    root
        alias                           ROOT
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c
        host_notification_options       d
        service_notification_commands   notify-service-by-email, notify-service-by-sms-only-once
        host_notification_commands      notify-host-by-email, notify-host-by-sms-only-once
        email                                [email protected]
        }
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

i did those changes.
am waiting for the alerts to come.

Code: Select all

define contact{
        contact_name                    root
        alias                           ROOT
should this be defined in config?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

As long as you have in defined in the contact group, it should be fine. I doubt using the name root will have any weird side effects, but it's probably best practice to use a different one.
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

no alerts from 911 email address.

i changed from root

Code: Select all

define contact{
        contact_name                    wsacritical
        alias                           WSACRITICAL
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c
        host_notification_options       d
        service_notification_commands   notify-service-by-email, notify-service-by-sms-only-once
        host_notification_commands      notify-host-by-email, notify-host-by-sms-only-once
        email                                 [email protected]
        }
define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 wsawarn,wsacritical
        }
Still no changes in 911 alerts.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Did you restart Nagios after making those changes?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

yes.
i did
sudo service nagios reload
sudo service nagios restart
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Are these two contacts in the same configuration file?
Former Nagios Employee.
me.
Locked