error when using co...
 
Notifications
Clear all

error when using contacts.cfg

3 Posts
3 Users
0 Reactions
188 Views
230dac1117c61c216398025d641fef7664053509e251cbc52ac991b139a4658b?s=80&d=mm&r=g
Posts: 1
Topic starter
(@travis-bean)
New Member
Joined: 4 weeks ago

I use /etc/nagios4/conf.d/contacts.cfg:

define contact {
host_notifications_enabled 1
service_notifications_enabled 1
contact_name root
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 root@localhost
}

define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members root
}

I get an error when I include the following in contacts.cfg (If I remove this, the error goes away):

define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members root
}

The error I receive is the following: 

Warning: Duplicate definition found for contactgroup 'admins' (config file '/etc/nagios4/objects/contacts.cfg', starting on line 46)
Error: Could not add object property in file '/etc/nagios4/objects/contacts.cfg' on line 48.
Error: Service notification period '24x7' specified for contact 'root' is not defined anywhere!
Error: Could not register contact (config file '/etc/nagios4/conf.d/contacts.cfg', starting on line 1)
Error processing object config files!

2 Replies
4618621cad0557d04ea115c17c9b53afe90beefed335c33c73919c5b8bbc3d1b?s=80&d=mm&r=g
Posts: 27
Admin
(@sandor)
Member
Joined: 8 months ago

Hey Travis,

The error is saying that you have a duplicate contactgroup for admins. If you look in your contactgroups.cfg file admins should be set up already by default unless it was removed. If you want to change your contactgroup go to contactgroups.cfg in the same location and you should be able to edit it to be what you need. The secondary error mentions 24x7 not being defined in the root contact as well so while your in contacts.cfg make sure that the root contact has a valid notification period. Let us know if this helps.

Reply
a1f0408c4bf8b6c6852fa60b0967969deba323a155d80c58ba13da7bb9cd9d41?s=80&d=mm&r=g
Posts: 17
Admin
(@jmichaelson)
Member
Joined: 7 months ago

That's fair enough. Do you have an account on github to create an issue for that. If not, I can create one on your behalf.

Reply
Share: