Page 1 of 13
contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 11:30 am
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?
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 11:38 am
by hsmith
Are you not getting critical notifications for either of these contacts, or just the admins?
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 12:18 pm
by sinkak
i am getting critical and warnings from warning email address (
[email protected]).
But nothing from 911 email address (
[email protected]).
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 12:23 pm
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]
}
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 12:39 pm
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?
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 12:44 pm
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.
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 1:05 pm
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.
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 1:07 pm
by hsmith
Did you restart Nagios after making those changes?
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 1:11 pm
by sinkak
yes.
i did
sudo service nagios reload
sudo service nagios restart
Re: contacts.cfg is not working properly
Posted: Mon Oct 05, 2015 1:18 pm
by hsmith
Are these two contacts in the same configuration file?