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
unable to delete contacts.cfg present in static dir
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
-
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
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
This will add the missing items to the CCM and then it won't re-populate if the configuration applies successfully.
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-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: unable to delete contacts.cfg present in static dir
Worked!
Nice job!
Thanks
Sandro
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
Glad to help.nagiosEngie wrote:Worked!
Nice job!
Thanks
Sandro
Locking topic