Could not add object property – Icinga Error

Sharing this bit of information to help someone who is worried with this same error. While configuring or modifying Icinga, you may experience an issue like

Warning: Duplicate definition found for host ‘env_servers’ (config file ‘/etc/icinga/conf.d/hostgroups.cfg’, starting on line 19)
Error: Could not add object property in file ‘/etc/icinga/conf.d/hostgroups.cfg’ on line 20.
Error processing object config files!

It took some time to find out the real cause of this issue. If you analyze the issue, you can see a warning on top, but might not have noticed it seriously(I didnt 😛 ). Error is the result of warning, so resolve the warning first. Though it says it found a duplicate definition found, you may not be able to find such a duplicate. Which means the issue is not with the hostgroups.cfg file, but with the icinga.cfg file. In the main cfg file of Icinga(icinga.cfg), I had some entries as shown below:

cfg_dir=/etc/icinga/conf.d
cfg_file=/etc/icinga/conf.d/hostgroups.cfg

This is the root cause of the warning. What these lines mean is that while having the config check, icinga finds two hostgroups.cfg (and thus duplicate definitions too), one from cfg_dir and another from cfg_file. So, it shows the warning duplicate entries found. What you need to do is that just remove cfg_file setting from the cfg file and your issue is now resolved.

The same solution is applicable with Nagios monitoring server also.

LET US KNOW YOUR RATINGS ON THIS BLOG HERE. ALSO FEEL FREE TO CONTACT ME.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s