Hello,
I recently imported a bunch of hosts and services into a new installation of NagiosXI.
Later, I ran the manual configuration check and found duplicates services.
It looks like I have duplicate service definitions in the services.cfg and _multiple_hosts.cfg files.
What is the procedure for getting rid of duplicates?
Thanks for your time!
After importing configurations, duplicate are found
-
Bitflogger
- Posts: 226
- Joined: Mon Oct 16, 2017 9:24 am
-
Bitflogger
- Posts: 226
- Joined: Mon Oct 16, 2017 9:24 am
Re: After importing configurations, duplicate are found
This is an example of what is causing the duplicates.
servicetemplates.cfg
define service {
name generic-aix-service-computational
service_description a_computational
use generic-aix-service
check_command check_nrpe!computational
retry_interval 10
notification_interval 120
first_notification_delay 10
notification_options w,c,r
register 0
}
services/services.cfg
define service {
host_name turco.doit.wisc.edu
use generic-aix-service-computational
contact_groups aix-alerts
register 1
}
[ead@winston services]$ cat turco.doit.wisc.edu.cfg
define service {
host_name turco.doit.wisc.edu
use generic-aix-service-computational
contact_groups aix-alerts
register 1
}
define service {
host_name turco.doit.wisc.edu
service_description a_disk_app1
use generic-aix-service-disk
check_command check_nrpe!disk_$HOSTNAME$.app1
contact_groups aix-crit-alerts,pesa-disk-apps
register 1
}
servicetemplates.cfg
define service {
name generic-aix-service-computational
service_description a_computational
use generic-aix-service
check_command check_nrpe!computational
retry_interval 10
notification_interval 120
first_notification_delay 10
notification_options w,c,r
register 0
}
services/services.cfg
define service {
host_name turco.doit.wisc.edu
use generic-aix-service-computational
contact_groups aix-alerts
register 1
}
[ead@winston services]$ cat turco.doit.wisc.edu.cfg
define service {
host_name turco.doit.wisc.edu
use generic-aix-service-computational
contact_groups aix-alerts
register 1
}
define service {
host_name turco.doit.wisc.edu
service_description a_disk_app1
use generic-aix-service-disk
check_command check_nrpe!disk_$HOSTNAME$.app1
contact_groups aix-crit-alerts,pesa-disk-apps
register 1
}
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: After importing configurations, duplicate are found
services.cfg doesn't sound like something that came out of the CCM on apply configuration, can you verify that if you go to Configure -> CCM -> Services in the config name drop-down you have something named "serivces"
If not, the file can be moved from the services directory and then the config verified, if would be common for there to be a _multiple_hosts.cfg after an import.
If not, the file can be moved from the services directory and then the config verified, if would be common for there to be a _multiple_hosts.cfg after an import.
-
Bitflogger
- Posts: 226
- Joined: Mon Oct 16, 2017 9:24 am
Re: After importing configurations, duplicate are found
I do have many. My guess is that trying to import a number of files, created by the configuration prep process, without a good filter, caused some existing configuration files to get imported, leading to something recursive. The import file selection screen seems very dangerous.
Re: After importing configurations, duplicate are found
Navigate to Configure -> Core Config Manager -> Hosts OR Services -> Find the related config - from here, you'll be able to delete and clear them out. Once finished, click 'Apply Config' to update your running configuration.
Former Nagios Employee
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: After importing configurations, duplicate are found
If you go to Configure -> CCM -> Services in the config name drop-down you can only have 1 item in the drop-down named "services"Bitflogger wrote:I do have many. My guess is that trying to import a number of files, created by the configuration prep process, without a good filter, caused some existing configuration files to get imported, leading to something recursive. The import file selection screen seems very dangerous.
As @rkennedy pointed out you can choose to delete the items that are duplicates, it is possible all of them are, and they were also imported into their appropriate hosts configuration.
-
Bitflogger
- Posts: 226
- Joined: Mon Oct 16, 2017 9:24 am
Re: After importing configurations, duplicate are found
I was able to delete the duplicates. Thanks for your help!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: After importing configurations, duplicate are found
Glad it is sorted!
Locking thread
Locking thread