centreon / nagiosToCentreon

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

Can't call method "register" without a package or object reference at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 499. #43

Closed Tonnulus closed 6 years ago

Tonnulus commented 6 years ago

Hello, When I run # perl /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl --config /tmp/nagios.cfg -S > /tmp/centreon.cfg I get this error : Can't call method "register" without a package or object reference at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 499.

I tried to add "use diagnostics" in nagios_reader_to_centreon_clapi.pl and I get a lot of errors :

printf (...) interpreted as function at Unquoted string "name" may clash with future reserved word at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 682 (#2) Argument "" isn't numeric in numeric ne (!=) at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 662 (#5)

Can't call method "register" without a package or object reference at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 500 (#6) (F) You used the syntax of a method call, but the slot filled by the object reference or package name contains an expression that returns a defined value which is neither an object reference nor a package name. Something like this will reproduce the error:

    $BADREF = 42;
    process $BADREF 1,2,3;
    $BADREF->process(1,2,3);

Uncaught exception from user code: Can't call method "register" without a package or object reference at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 500. at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 500 main::export_services('Nagios::Service=HASH(0x1ce8d58)', 'Nagios::Service=HASH(0x1ce8e48)', 'Nagios::Service=HASH(0x1ce8f50)', 'Nagios::Service=HASH(0x1ce9028)', 'Nagios::Service=HASH(0x1ce9100)', 'Nagios::Service=HASH(0x1ce91d8)', 'Nagios::Service=HASH(0x1ce9508)', 'Nagios::Service=HASH(0x1cec7e0)', 'Nagios::Service=HASH(0x1cecb10)', ...) called at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 784

Sims24 commented 6 years ago

Hi @Tonnulus,

We just merge out last work, please retry from master branch hope this will fix this issue.

Please give us some feedbacks if issues remains. Thanks.

Sims24 commented 6 years ago

Answer and re open if you still face issues.

Tonnulus commented 6 years ago

Thank you for your help. The script run without error, but the only result I have is :

RESOURCECFG;ADD;$hostsUSER2$;PUBLIC;Central;Resource $USER2$ RESOURCECFG;ADD;$hostsUSER10$;/srv/eyesofnetwork/pnp4nagios;Central;Resource $USER10$ RESOURCECFG;ADD;$hostsUSER1$;/srv/eyesofnetwork/nagios/plugins;Central;Resource $USER1$ RESOURCECFG;ADD;$hostsUSER3$;/srv/eyesofnetwork/notifier;Central;Resource $USER3$

There is no host and no service ...

Sims24 commented 6 years ago

Is it possible to send us your config files by mail ? we'll keep it confidential and that would help a lot.

Could you please also give us exactly the command line you used.

Thanks, Simon

cgagnaire commented 6 years ago

@Sims24, @Tonnulus did it right by opening a new issue https://github.com/centreon/nagiosToCentreon/issues/44 :p