Strange duplication issues after using import script
-
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Strange duplication issues after using import script
Hi all,
Once again I seem to have found a stange duplication issue when using the import tool.
Hopefully not as long winded as the other one. I have created a small number of images to retrace my steps to make it hopefully clearer as to what steps im taking.
Please know that I have followed the import documentation to the letter.
The ENV is 32bit RedHat5 running in a VM ENV.
This is the host before the import I then click the file I wish to import It then adds 31 services successfully.
Once again I seem to have found a stange duplication issue when using the import tool.
Hopefully not as long winded as the other one. I have created a small number of images to retrace my steps to make it hopefully clearer as to what steps im taking.
Please know that I have followed the import documentation to the letter.
The ENV is 32bit RedHat5 running in a VM ENV.
This is the host before the import I then click the file I wish to import It then adds 31 services successfully.
You do not have the required permissions to view the files attached to this post.
Last edited by griffithusg on Tue Apr 05, 2011 12:33 am, edited 1 time in total.
-
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Re: Strange duplication issues after using import script
As you can see it has only added the 31 services.
I then went through the entire process again changing only a check argument in the check_mem_ssh service check. - The reason for doing this is simulating what potentially might have changed between configs snapshots from the old system.
As you can see it has added an extra check_zpool service check.
Just for debug purposes I have run the import again without deleting or changing any services and you can see it duplicates the check_zpool again creating a third duplicate. Although the config does not error when exporting it does create lots of duplication warnings in the log. It also makes it rather messy in the CCM.
Hopefully we can out what is going on. let me know if you want me to send you the ragana.cfg.
Thanks.
Just for debug purposes I have run the import again without deleting or changing any services and you can see it duplicates the check_zpool again creating a third duplicate. Although the config does not error when exporting it does create lots of duplication warnings in the log. It also makes it rather messy in the CCM.
Hopefully we can out what is going on. let me know if you want me to send you the ragana.cfg.
Thanks.
You do not have the required permissions to view the files attached to this post.
Re: Strange duplication issues after using import script
Just to make sure, this is the documentation you read http://assets.nagios.com/downloads/nagi ... ios_XI.pdf correct? (I am assuming though but just thought to check).
There is an issue that has come up with imports related to comma-separated and spaces. That being said, any space can cause it to duplicate as it reads both the word and then the word with a space.
We've identified the source of the duplicate entries upon importing into NagiosQL. It appears that when there is a comma separated list of hosts, services, groups, parents, etc in the prepped config files, that the values should not be having spaces put between them. After running tests with the spaces removed, the import happens cleanly, and there are no leftover duplicates in the Core Config Manager.
Example problem:
hostgroups group1, group2, group3
Example of fixed config line:
hostgroups group1,group2,group3
There is an issue that has come up with imports related to comma-separated and spaces. That being said, any space can cause it to duplicate as it reads both the word and then the word with a space.
We've identified the source of the duplicate entries upon importing into NagiosQL. It appears that when there is a comma separated list of hosts, services, groups, parents, etc in the prepped config files, that the values should not be having spaces put between them. After running tests with the spaces removed, the import happens cleanly, and there are no leftover duplicates in the Core Config Manager.
Example problem:
hostgroups group1, group2, group3
Example of fixed config line:
hostgroups group1,group2,group3
Re: Strange duplication issues after using import script
Or a more specific example:
=====================
BAD CONFIG
=====================
===================
GOOD CONFIG
===================
=====================
BAD CONFIG
=====================
Code: Select all
define host {
host_name BPI Process 2
use xiwizard_bpi_host
address 127.0.0.1
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts nagiosadmin
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options n
hostgroups linux-servers,websites,otherstuff ## GOOD
_xiwizard bpiwizard
register 1
} GOOD CONFIG
===================
Code: Select all
define host {
host_name BPI Process 2
use xiwizard_bpi_host
address 127.0.0.1
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts nagiosadmin
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options n
hostgroups linux-servers, websites, otherstuff ## BAD
_xiwizard bpiwizard
register 1
} -
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Re: Strange duplication issues after using import script
Hello,
Yes, I have read this document.
I have also had this problem before with the duplications due to spaces.
Here is an except from the config to show you there are no spaces.
define service{
host_name ragana
service_description check_xv_ssh
use check_xv_ssh
check_command check_xv_ssh
parallelize_check 1
notification_period 24x7
}
define service{
host_name ragana
service_description check_zpool
use check_zpool
check_command check_zpool!duty
max_check_attempts 3
normal_check_interval 10
retry_check_interval 1
check_period 24x7
parallelize_check 1
notification_interval 60
notification_period on-call_hours
notification_options w,c,r
contact_groups usg_oncall
}
define service{
host_name ragana
service_description check_zpool_individual_rpool
check_command check_zpool_individual!duty!rpool
max_check_attempts 3
normal_check_interval 10
retry_check_interval 1
check_period 24x7
parallelize_check 1
notification_interval 60
notification_period on-call_hours
notification_options w,c,r
contact_groups usg_oncall
}
Is there a way to output what is being sent to Mysql from NagiosQL?
Yes, I have read this document.
I have also had this problem before with the duplications due to spaces.
Here is an except from the config to show you there are no spaces.
define service{
host_name ragana
service_description check_xv_ssh
use check_xv_ssh
check_command check_xv_ssh
parallelize_check 1
notification_period 24x7
}
define service{
host_name ragana
service_description check_zpool
use check_zpool
check_command check_zpool!duty
max_check_attempts 3
normal_check_interval 10
retry_check_interval 1
check_period 24x7
parallelize_check 1
notification_interval 60
notification_period on-call_hours
notification_options w,c,r
contact_groups usg_oncall
}
define service{
host_name ragana
service_description check_zpool_individual_rpool
check_command check_zpool_individual!duty!rpool
max_check_attempts 3
normal_check_interval 10
retry_check_interval 1
check_period 24x7
parallelize_check 1
notification_interval 60
notification_period on-call_hours
notification_options w,c,r
contact_groups usg_oncall
}
Is there a way to output what is being sent to Mysql from NagiosQL?
Re: Strange duplication issues after using import script
Ah, I spoke with my co-worker who worked with you previously and he is going to check over a few things as well.griffithusg wrote:I have also had this problem before with the duplications due to spaces.
Re: Strange duplication issues after using import script
Can you send us that full config? We'd like to run some tests on our end.
Re: Strange duplication issues after using import script
Code: Select all
normal_check_interval 10
retry_check_interval 1Code: Select all
check_interval 10
retry_interval 1-
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Re: Strange duplication issues after using import script
Hi,
Sorry tried suggested changes to config with no difference.
Sorry tried suggested changes to config with no difference.
Re: Strange duplication issues after using import script
I'm going back through the previous messages again, and I was wondering if you could give us just a little bit more detail on a few items.
What happens when you delete that service before re-running the import?
If you get the duplicate again, I'd like you to click the orange "Info" icon for both duplicates and show us that output. It should show us the Db relationships and to which tables. My guess is that it's ghosting an entry in there to satisfy a table relationship.
I don't think I'm quite understanding why you're using the import process to test a change in the configuration. The import process will establish new table relationships based on unique entry ID's, not host names and services names. I'm guessing this is causing the problem, but as I mentioned I don't think I'm completely understanding the situation.
So can you clarify just a little bit more on this part so I make sure I understand the steps correctly? You ran the import, it imported successfully the first time. I'm noticing that none of the files are synced yet. Did you apply this config, or did you run the import again?I then went through the entire process again changing only a check argument in the check_mem_ssh service check. - The reason for doing this is simulating what potentially might have changed between configs snapshots from the old system.
What happens when you delete that service before re-running the import?
If you get the duplicate again, I'd like you to click the orange "Info" icon for both duplicates and show us that output. It should show us the Db relationships and to which tables. My guess is that it's ghosting an entry in there to satisfy a table relationship.
I don't think I'm quite understanding why you're using the import process to test a change in the configuration. The import process will establish new table relationships based on unique entry ID's, not host names and services names. I'm guessing this is causing the problem, but as I mentioned I don't think I'm completely understanding the situation.