contacts cfg is failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

contacts cfg is failing

Post by sinkak »

In nagios.cfg file

i added whole config files folder

# Debian uses by default a configuration directory where nagios3-common,
# other packages and the local admin can dump or link configuration
# files into.
cfg_dir=/usr/local/nagios/etc/conf.d


It showed no error while nagios reload.

But after i added individual file

Code: Select all

# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/conf.d/contacts/contacts_nagios2.cfg
Its showing this error

Code: Select all

Warning: Duplicate definition found for contact 'wsawarn' (config file '/usr/local/nagios/etc/conf.d/contacts/contacts_nagios2.cfg', starting on line 18)
Error: Could not add object property in file '/usr/local/nagios/etc/conf.d/contacts/contacts_nagios2.cfg' on line 19.
   Error processing object config files!
i made no changes to contacts.cfg file.

Code: Select all

define contact{
        contact_name                              wsawarn                             <-------------line19
        alias                                            WSAWarn
        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
        email                                          [email protected]
       }

define contactgroup{
        contactgroup_name       admins
        alias                       Nagios Administrators
        members                 wsawarn
        }
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 failing

Post by hsmith »

The error is telling you that you have this contact defined in multiple spots. If you have it defined in more than once place, you are going to have issues. You'll need to choose one spot that you want the contact and delete it from the other place. Does this make sense ?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts cfg is failing

Post by sinkak »

I have only one contact defined.
as shown above and many contact_groups.

it doesn't show error before i when i had this on nagios.cfg.

Code: Select all

cfg_dir=/usr/local/nagios/etc/conf.d
but when i ad individual config file like this on nagios.cfg.

Code: Select all

cfg_file=/usr/local/nagios/etc/conf.d/contacts/contacts_nagios2.cfg
this error comes up.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: contacts cfg is failing

Post by jdalrymple »

Do you have both lines in nagios.cfg at the same time? If so you're effectively defining the entire file twice and as such the contact will be read over twice.

Expected behavior...
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts cfg is failing

Post by sinkak »

Oh thats the reason they are failing. Got it.

Please close this thread.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: contacts cfg is failing

Post by lmiltchev »

You shouldn't be modifying the configs manually from the CLI because when you apply configuration, all of the changes that you have made would be wiped out (re-written with whatever is in the database).
All of the changes must be made in the CCM. XI users/contacts can be added by going to Admin->Manage Users->Add New User.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts cfg is failing

Post by sinkak »

Sorry.
I posted in wrong forum. I am using nagios core.
Please close this post.
Locked