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 locate object method "name" via package #19

Closed ccadenel closed 7 years ago

ccadenel commented 8 years ago

When try to generate clapi file I recevie this error message: Can't locate object method "name" via package "xxxxx"

xxxx is a contact name

kwoltz1984 commented 7 years ago

I am getting this error as well: Can't locate object method "name" via package "HelpDesk" (perhaps you forgot to load "HelpDesk"?) at /tmp/nagiosToCentreon/nagios_reader_to_centreon_clapi.pl line 672.

It looks like line 672 involves adding the contacts to services. "HelpDesk" is one of our contacts.

We are running Centreon 2.3.8 with Nagios 3.5.1. Trying to get this configuration so we can start using CES.

Ejant commented 7 years ago

Same issue here.... Can't locate object method "name" via package "nagiosadmin" (perhaps you forgot to load "nagiosadmin"?) at nagios_reader_to_centreon_clapi.pl line 361.

"nagiosadmin" is a contact

Ejant commented 7 years ago

it looks like the error comes when there are multiple contacts:

HTPL;setcontactgroup;HOST;CONTACTGROUPS; Can't locate object method "name" via package "nagiosadmin" (perhaps you forgot to load "nagiosadmin"?) at nagios_reader_to_centreon_clapi.pl line 361.

so, i look into my file and

define host{ name HOST use generic-host alias HOST _SNMPCOMMUNITY TCBW-nocalert contact_groups Contact_A,Contact_B contacts nagiosadmin,someuser notification_period 24x7 register 0 }

If i leave only one contact, it works ok

kwoltz1984 commented 7 years ago

This worked for me, thanks! Mine was with a service though instead of a host. I had one service with multiple contacts and "HelpDesk" was the first one. I removed the other contact and reran with success. No more errors! Thanks @Ejant !

cgagnaire commented 7 years ago

Hi @ccadenel, @kwoltz1984 and @Ejant, 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!

Ejant commented 7 years ago

@cgagnaire it's working now, thank you!!!