centreon / nagiosToCentreon

Import your nagios config files into Centreon DB... And it rocks !
Apache License 2.0
9 stars 13 forks source link

Could not import host with parent #22

Closed renard closed 7 years ago

renard commented 8 years ago

Got following error:

Line 5010 : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'host_parents' in 'field list'

The generated line is looks like:

HOST;setparam;host1;parents;host2

According to the current (1.8) doc it should be something like:

HOST;addparent;host1;host2

I guess some other object should be affected.

Did you even test your code before releasing it?

renard commented 8 years ago

Here (in attachment) is a simple configuration. The configuration was initially generated by a centreon 2.3.3. I just extract a few config stanza that generate errors.

I generate the API file using:

nagios_reader_to_centreon_clapi.pl -C nagios.cfg       > api

Then I run:

usr/local/centreon/www/modules/centreon-clapi/core/centreon  -u admin -p admin -i `pwd`/api
Line 1 : Object already exists (check_centreon_dummy)
Line 2 : Object already exists (host-notify-by-sendmailhost)
Line 3 : Object already exists (notify-by-sendmailservices)
Line 4 : Object already exists (24x7)
Line 12 : Object already exists (nagios-John)
Line 22 : Object already exists (generic-host)
Line 33 : Object already exists (Host_A)
Line 46 : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'host_parents' in 'field list'
Line 49 : Object not found:nagios-John
Line 50 : Object already exists (Switch_HP)
Line 64 : Object not found:nagios-John
Line 65 : Object already exists
Line 76 : Object already exists
Line 77 : Object already exists
Line 94 : Object not found:check_http!80
Line 96 : Object not found:nagios-John

Nevermind the "Object already exists".

Problems I see here:

This patch can fix a few obvious mistakes. For the moment I still cannot import the full nagios configuration into centreon. If you have a configuration annonymizer I can send you the full config.

quick-and-dirty-fix.patch.txt

simple.zip

djtlg commented 7 years ago

I am having this issue as well. Will it be fixed anytime soon.

cgagnaire commented 7 years ago

Hi @renard and @djtlg, Can you please try the v3-sims branch that fix your problem ? Be advise that the --config option now needs the path to the configuration files objects directory, not the nagios.cfg. Thanks!

renard commented 7 years ago

@cgagnaire since there was too much bugs and due to the complexity of centreon, I switch to an other monitoring system.

Sorry I cannot help you any more.