unable to delete contacts.cfg present in static dir

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiosEngie
Posts: 104
Joined: Thu May 03, 2018 7:57 am

unable to delete contacts.cfg present in static dir

Post by nagiosEngie »

Hello Nagios Crew,
I am having a strange issue with my contacts.cfg file. This file is present in /usr/local/nagios/etc/ and in /usr/local/nagios/etc/static.


I am unable to delete the contacts.cfg file in the stic directory. Every time nagios restarts it will recreate this file in the static directory giving me errors every time I add a contact or contact group:

Error: Could not find any contact matching 'francesco.surace' (config file '/usr/local/nagios/etc/contactgroups.cfg', starting on line 70)
Error: Failed to expand contacts for contactgroup 'WEBMETHODS' (config file '/usr/local/nagios/etc/contactgroups.cfg', starting at line 70)
Error: Contact 'sandro.ginnari' is not defined anywhere!
Error: Could not add contact 'sandro.ginnari' to host (config file '/usr/local/nagios/etc/hosts/EINAGFUITMI01.cfg', starting on line 16)

If I look in contacts.cfg (the one in /usr/local/nagios/etc/):

define contact {
contact_name francesco.surace
alias WEBMETHODS
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period webmethods_notification_times
service_notification_period webmethods_notification_times
host_notification_options d,r,
service_notification_options w,c,r,
host_notification_commands xi_host_event_handler
service_notification_commands xi_service_event_handler
email [email protected]
use xi_contact_generic
}

AND

define contact {
contact_name sandro.ginnari
alias sandro.ginnari
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period sandro.ginnari_notification_times
service_notification_period sandro.ginnari_notification_times
host_notification_options d,r,
service_notification_options w,c,r,
email [email protected]
use xi_contact_generic
}


If I lookin my contactgroup.cfg I see:

define contactgroup {
contactgroup_name WEBMETHODS
alias WEBMETHODS
members daniele.devenezia,francesco.surace
}

define contactgroup {
contactgroup_name xi_contactgroup_all
alias All Contacts
members *
}
which looks ok to me.

I think all this mess is due to the presence of the contacts.cfg in the static dir. How do I delete it permanently?


Thanks
Sandro
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: unable to delete contacts.cfg present in static dir

Post by scottwilkerson »

It looks like the contacts file in the static directory contains some of the contacts that are assigned to some groups you have.

Here's the best thing you can so, move the contacts file from the static directory to the import directory and try to apply configuration

Code: Select all

mv /usr/local/nagios/etc/static/contacts.cfg /usr/local/nagios/etc/import/contacts.cfg
This will add the missing items to the CCM and then it won't re-populate if the configuration applies successfully.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nagiosEngie
Posts: 104
Joined: Thu May 03, 2018 7:57 am

Re: unable to delete contacts.cfg present in static dir

Post by nagiosEngie »

Worked!
Nice job!
Thanks

Sandro
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: unable to delete contacts.cfg present in static dir

Post by scottwilkerson »

nagiosEngie wrote:Worked!
Nice job!
Thanks

Sandro
Glad to help.

Locking topic
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked