duplicates on import
-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
duplicates on import
When I import a changed service object definition into a Nagios XI server where that service is already defined, I'm getting a duplicate service rather than the original service being overwritten. The changed service object includes all necessary attributes. Is there some setting on the Nagios XI server where I'm doing the import to ensure that the new object overwrites the old object?
Thanks!
Thanks!
Re: duplicates on import
On the Import Config File Screen, there is a setting called "Overwrite Database", check that and it should overwrite the existing settings.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
Re: duplicates on import
this option is already checked.
I got a duplicate service when I uploaded (via /etc/import) a new service description with only a changed hostgroup attribute.
I will recreate this and send you the config files that you can test on your servers. Along with the config files, what else can I provide you to help debug/understand this?
I got a duplicate service when I uploaded (via /etc/import) a new service description with only a changed hostgroup attribute.
I will recreate this and send you the config files that you can test on your servers. Along with the config files, what else can I provide you to help debug/understand this?
Re: duplicates on import
You may have a service added to multiple hostgroups and/or also directly added to the host. This would cause the host to be assigned the same service twice. Check the "Manage Hosts" and "Manage Hostgroups" list for the service, and then check the "Manage Hostgroups" on the Host, and finally check the "Manage Hosts" on the hostgroups. It must be added twice somewhere.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
Re: duplicates on import
I am running Nagios XI 2014R2.0 and can reproduce the problem with the following steps. Please tell me if you see the same thing.
1) copy a service from /usr/local/nagios/etc/services to /usr/local/nagios/etc/import
2) change the hostgroup to a new valid value in the copy in /usr/local/nagios/etc/import
3) apply configuration
4) check the CCM and see if two services exist with different hostgroup values.
If I further disable the check with the old hostgroup entry by deselecting active, the new check now show up in the CCM with the status of "Not Applied". It looks like both entries have the same database id, but the overwrite isn't happening...
If you can't reproduce this on R2.0, let me know as well. Is this something addressed in a more current patch? Thanks!
1) copy a service from /usr/local/nagios/etc/services to /usr/local/nagios/etc/import
2) change the hostgroup to a new valid value in the copy in /usr/local/nagios/etc/import
3) apply configuration
4) check the CCM and see if two services exist with different hostgroup values.
If I further disable the check with the old hostgroup entry by deselecting active, the new check now show up in the CCM with the status of "Not Applied". It looks like both entries have the same database id, but the overwrite isn't happening...
If you can't reproduce this on R2.0, let me know as well. Is this something addressed in a more current patch? Thanks!
Re: duplicates on import
kendallchenoweth, I was able to replicate this on 2014R2.0 and on the latest 2014R2.7.
I've created a bug report for it:
I've created a bug report for it:
Code: Select all
NEW TASK ID 5603 created - Nagios XI Bug Report: Import config doesn't overwrite and produces 2 services, when you disable one, the other says not applied.-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
Re: duplicates on import
Great... can you tell me if the fix is going to be in the next patch and when that's planned?
Thanks!
Thanks!
Re: duplicates on import
After speaking with a developer he said that it will not work the way that we were trying because the import functionality uses the hostname/hostgroup when determining the config file name when importing and that it is expected.
He said that you can use /usr/local/nagios/etc/static and put/replace configs in there and restart nagios as an alternate solution for people who are manually managing configs. The caveats being that you will not be able to manage them through the CCM and you should delete the ones you are managing in the static directory from the CCM.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
He said that you can use /usr/local/nagios/etc/static and put/replace configs in there and restart nagios as an alternate solution for people who are manually managing configs. The caveats being that you will not be able to manage them through the CCM and you should delete the ones you are managing in the static directory from the CCM.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
Re: duplicates on import
Drat. So as an alternative is there some command I can run to delete/disable the existing service before importing the new service? This would accomplish the same thing by having only one active service (the changed one I'm importing) in the system at any given time.
Thanks!
Thanks!
-
kendallchenoweth
- Posts: 195
- Joined: Fri Sep 13, 2013 10:43 am
Re: duplicates on import
It looks like a possible solution is to do the following.
cd /usr/local/nagiosxi/scripts
./nagiosql_delete_service --service=<configfile>
./reconfigure_nagios.sh
<copy the updated service into /usr/local/nagios/etc/import>
./reconfigure_nagios.sh
This will be part of a auto generated script. (I'm making changes in QA, validating and promoting the changes to the production system and executing remotely via ssh.)
Do you have any comments or suggestions on this solution?
Thanks!
cd /usr/local/nagiosxi/scripts
./nagiosql_delete_service --service=<configfile>
./reconfigure_nagios.sh
<copy the updated service into /usr/local/nagios/etc/import>
./reconfigure_nagios.sh
This will be part of a auto generated script. (I'm making changes in QA, validating and promoting the changes to the production system and executing remotely via ssh.)
Do you have any comments or suggestions on this solution?
Thanks!