Giter Club home page Giter Club logo

nagiostocentreon's Introduction

Nagios Reader to Centreon CLAPI

"Nagios Reader to Centreon CLAPI" is a free and open source project to analyse Nagios CFG configuration files and to transform monitoring configuration to Centreon CLAPI command in order to import configuration into Centreon web interface.

Prerequisites

First of all you need a Centreon server installed and ready to use. Please see the document on htt://document.centreon.com to install a Centreon server based on ISO or RPM.

Installation

This script uses the Perl-Nagios-Object library to read CFG files. To install it please follow this steps on your Nagios(R) server:

$ yum install perl-Module-Build perl-Test-Exception perl-Test-NoWarnings perl-List-Compare
$ cd /tmp
$ wget http://search.cpan.org/CPAN/authors/id/D/DU/DUNCS/Nagios-Object-0.21.20.tar.gz
$ tar xzf Nagios-Object-0.21.20.tar.gz
$ cd Nagios-Object-0.21.20
$ perl Build.PL
$ ./Build
$ ./Build test
$ ./Build install

Note : perl-List-Compare is from EPEL repo for CentOS/Red Hat

Usage

To display help use the command:

$ perl nagios_reader_to_centreon_clapi.pl --help
######################################################
#    Copyright (c) 2005-2017 Centreon                #
#    Bugs to http://github.com/nagiosToCentreon      #
######################################################

Version: 3.0.0
Usage: nagios_reader_to_centreon_clapi.pl
    -C (--config)      Path to nagios configuration files (must be a directory) (Default: /usr/local/nagios/etc/)
    -V (--version)     Nagios version of the configuration files (Default: 3)
    -P (--poller)      Name of the targeted poller (Default: Central)
    -p (--prefix)      Add a prefix before commands, contacts, templates, groups, etc.
    -s (--switch)      Switch alias and name of contacts for the configurations that need it
    -f (--filter)      Filter files to process with regexp (Default: '^(?!(\.|connector\.cfg))(.*\.cfg)$')
    --default-htpl     Define default host template for template-less hosts or host templates\n";
    --default-stpl     Define default service template for template-less services or service templates\n";
    -h (--help)        Usage help

To run the script please use the following command:

$ perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/ > /tmp/centreon_clapi_import_commands.txt

Export the file /tmp/centreon_clapi_import_commands.txt on your Centreon server.

Run the following command to import configuration into Centreon on your Centreon server:

$ /usr/share/centreon/bin/centreon -u admin -p @PASSWORD -i /tmp/centreon_clapi_import_commands.txt

Notes

  • Services by hostgroups will be transformed : a template of service will be created using old service definition, and a unitary service will be created for all hosts linked to the hostgroup using the newly created service template.
  • Hostgroups exclusions (i.e. hostgroup_name !Windows) won't be taken into account.
  • Using filters may provoque errors at CLAPI import because of the contacts definition on several objects being the full name instead of the login/alias as CLAPI intend it to be.

nagiostocentreon's People

Contributors

cgagnaire avatar julienmathis avatar lpinsivy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagiostocentreon's Issues

Export only RESOURCES (No host, no services)

Hello,
Thanks to the new version and #43 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 ...

Version number

Please increase the version number with each commit (e.g. 1.0.n) so we can keep 1.0 apart from 1.0 :)

Can't locate object method - hostgroups

Hi,

I'm getting a similar error to issue #5 but in a different section (the version of the script I downloaded ("1.0") already contains nountevo's patch):

Can't locate object method "members" via package "all" (perhaps you forgot to load "all"?) at nagios_reader_to_centreon_clapi.pl line 369.

When I comment out the offending section (in /etc/nagios3/conf.d/hostgroups_nagios2.cfg) the script continues (with other errors, will submit new issues for those), but misses the All group with everything in it (hosts, services):

# A simple wildcard hostgroup
#define hostgroup {
#        hostgroup_name  all
#               alias           All Servers
#               members         *
#        }

ARRAY probleme

Hi everyone,

I encounter an issue with nagiosToCentreon.pl

When i use the Script i have this 2 error

  • defined(@array) is deprecated at nagios_reader_to_centreon_clapi.pl line 350.
  • Can't use an undefined value as an ARRAY reference at nagios_reader_to_centreon_clapi.pl line 605.

For the first error i have edited the script
Before

 # Add contactgroups to host
                        if ( defined ( $host->contact_groups )  && $host->contact_groups ne '' ) {
                                my $contactgroups_list = "";
                                if ( scalar @{$host->contact_groups} > 1 ) {
                                        foreach my $item ( @{$host->contact_groups} ) {
                                                $contactgroups_list .= sprintf ( "%s", $item) . "|";
                                        }
                                        $contactgroups_list =~ s/\|$//;
                                        printf ( "%s;setcontactgroup;%s;%s\n", $type, $host_name, $contactgroups_list );
                                } elsif ( defined (@{$host->contact_groups}) )  {
                                        foreach my $item ( @{$host->contact_groups} ) {
                                            printf ( "%s;addcontactgroup;%s;%s\n", $type, $host_name, $item->contactgroup_name );
                                        }
                                } else {
                                        printf ( "%s;addcontactgroup;%s;%s\n", $type, $host_name, $host->contact_groups );
                                }
                        }

After

# Add contactgroups to host
                        if ( defined ( $host->contact_groups )  && $host->contact_groups ne '' ) {
                                my $contactgroups_list = "";
                                if ( scalar @{$host->contact_groups} > 1 ) {
                                        foreach my $item ( @{$host->contact_groups} ) {
                                                $contactgroups_list .= sprintf ( "%s", $item) . "|";
                                        }
                                        $contactgroups_list =~ s/\|$//;
                                        printf ( "%s;setcontactgroup;%s;%s\n", $type, $host_name, $contactgroups_list );
                                } elsif (@{$host->contact_groups} )  {
                                        foreach my $item ( @{$host->contact_groups} ) {
                                            printf ( "%s;addcontactgroup;%s;%s\n", $type, $host_name, $item->contactgroup_name );
                                        }
                                } else {
                                        printf ( "%s;addcontactgroup;%s;%s\n", $type, $host_name, $host->contact_groups );
                                }
                        }

The first error disappear. but i dont know what to do with the second.
Nagios version : 3.5.1
Perl version 5.16.3

Thanks for your help

PDOException with message Column not found

Hi
Im checking to import centreon 2.3.3 to last version, importing all config (In this case centreon was a frontend from nagios, after that they changed all the schema) . The export part seems to work nice, but when I import I receive this log
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'host_parents' in 'field list'' in /usr/share/centreon/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /usr/share/centreon/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /usr/share/centreon/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#2 /usr/share/centreon/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#3 /usr/share/centreon/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE host SET...', Array)
#4 /usr/share/centreon/lib/Centreon/Object/Object.php(196): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE host SET...', Array)
#5 /usr/share/centreon/www/class/centreon-clapi/centreonObject.class.php(269): Centreon_Object->update('109', Array)
#6 /usr/share/centreon/www/class/centreon-clapi/centreonHost.class.php(439): CentreonClapi\CentreonObject->setparam('109', Array)
#7 /usr/share/centreon/www/class/centreon- in /usr/share/centreon/lib/Zend/Db/Statement/Pdo.php on line 234

I don't know where to check this error.

Object not found

Hi ,

I am facing this issue while running the following command to import the configuration into Centreon on your Centreon server:

/usr/share/centreon/bin/centreon -u admin -p @password -i /tmp/my_host_file.txt

I have copied all the host files from my Nagios and converted them into txt formal successfully but while trying to import it to my center, I got that error every time. Please help me to solve this. Thanks in advance.

Script adding generic parent template name when no parent template is set

Hi,

I had to migrate from Nagios to Centreon and found your script that is working very well and saved me tonnes of time (thanks a lot for your work btw).

However I found a little bug that took me time to resolve:
When you have a template item (ex: Host template; service template etc...) which has no "Parent templates" set, the script will generate a generic parent templates name (ex: generic-active-service-custom; generic-active-host-custom) instead of letting this setting blank (;; in the export file).

When importing the file it will results in errors like "Line 1448 : Object not found:generic-active-host-custom" on the "parent-less" host or service template and they will not be created (resulting in more "Object not found" occurrence).

Examples of CLAPI import commands:
Script generated = HTPL;ADD;EU_Host;EU Host;;generic-active-host-custom;;
Should have been = HTPL;ADD;EU_Host;EU Host;;;;
(See attached files for the corresponding Centreon view)

2017-11-28 11_27_11-settings

Hope this will help a few centreon admin.

Cheers

Error import the centreon_clapi_import_commands

Hey brothers,

i am testing to migrate my nagios configuration (version 4.2.1) to centreon (version 2.7.7) wich have already installed in my VM linux ubuntu 16.04 ...
i have follow the instructions in this link: https://documentation-fr.centreon.com/docs/centreon/en/2.8.x/migration/nagiostocentreon.html (= Nagios Reader vers Centreon CLAPI). i have set this command:
perl nagios_reader_to_centreon_clapi.pl --nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc --version 4 > /tmp/centreon_clapi_import_commands.txt:
and then:
/usr/local/centreon/bin/centreon -u admin -p admin -i /tmp/centreon_clapi_import_commands.txt

the command prompt return :

Line 1 : Resource is already tied to instance
Line 2 : Resource is already tied to instance
Line 3 : Resource is already tied to instance
Line 4 : Resource is already tied to instance
Line 5 : Resource is already tied to instance
Line 6 : Resource is already tied to instance
Line 7 : Resource is already tied to instance
Line 8 : Resource is already tied to instance

Is it normal ?
the result is shown in the figures
nagios_reader_to_centreon_clapi file
resource is already tied to instance
centreon clapi

Thanks in advance.
Best regards : )

Can't call method "service_name" on unblessed

Hello ,
I got this error message when executing the script:

Can't call method "service_name" on unblessed reference at /root/nagiosToCentreon-master/nagios_reader_to_centreon_clapi.pl line 706.

It's related to the export of servicegroups, but I couldn't figure out what's wrong in the code.

Any help plz !!

services with multiple hosts

Services with multiple hosts are imported once for the first host. It is not always possible to use detach function on source system.

Migrate from Nagios Core 4.3.2 to Centreon 2.8.15 -

Hello
I want to migrate from Nagios 4.3.2 to Centreon 2.8.15.

perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/ > /tmp/centreon_clapi_import_commands.txt
perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/objects/ >> /tmp/centreon_clapi_import_commands.txt

I have an error for the second script :
Use of uninitialized value in concatenation (.) or string at nagios_reader_to_centreon_clapi.pl line 452.

Thank for your answer

script consumes all memory

hello,

I don't know if it's related to the script itself or my servers but when I execute 'perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/nagios.cfg > /tmp/centreon_clapi_import_commands.txt' I quickly get an out of memory message and the script never finishes :(

I'm trying to import nagios 4.0.8 configuration to a freshly installed Centreon 3.4
Nagios VM runs on CentOS7. It has 2 vcpu and 4Gb of memory. My Nagios configuration has something like 80 hosts so I don't think it's a huge configuration.
Any idea?
Thank you

Services by host groups are converted to services by hosts

Importing a service by host group splits it to multiple services by hosts for every host in the group

define hostgroup{
hostgroup_name Physical_server_with_soft_raid
members host1, host2, host3
}

define service{
hostgroup_name Physical_server_with_soft_raid
service_description check_nrpe_cores_temp
use modele_service_nrpe
check_command check_nrpe_check_cores_temp
}

becomes
SERVICE;ADD;host1;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp
SERVICE;ADD;host2;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp
SERVICE;ADD;host3;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp

which is repeated twice in the centreon_clapi_import_commands.txt

defined(@array) is deprecated

I guess this is cosmetic:

defined(@array) is deprecated at nagios_reader_to_centreon_clapi.pl line 203. (Maybe you should just omit the defined()?)

Fixed it by changing:

$ diff ../../../nagios_reader_to_centreon_clapi.pl nagios_reader_to_centreon_clapi.pl
203c203
<               if ( defined ( $contact->contactgroups ) && defined ( @{$contact->contactgroups} ) ) {

---
>               if ( defined ( $contact->contactgroups ) && @{$contact->contactgroups} ) {

Could not import host with parent

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?

Use of uninitialized value

Hi,
I have this error when i am executing this command :
perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/nagios.cfg > /tmp/centreon_clapi_import_commands.txt

Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 21.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 21.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 33.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 33.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 46.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 46.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 57.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 57.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 68.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 68.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 860, <GEN13> line 79.
Use of uninitialized value $value in pattern match (m//) at /usr/local/share/perl/5.14.2/Nagios/Object.pm line 864, <GEN13> line 79.
Use of uninitialized value $name in exists at /usr/local/share/perl/5.14.2/Nagios/Object/Config.pm line 367.
Use of uninitialized value $name in exists at /usr/local/share/perl/5.14.2/Nagios/Object/Config.pm line 367.

Perl version (perl --version) : v5.14.2
git status : branch master
git log : commit f757635
Author: Laurent Pinsivy [email protected]
Date: Tue Feb 9 13:17:16 2016 +0000
Nagios (./nagios --help) : Nagios Core 3.5.1

Regards,

Can't locate object method

Hello,

I have the same issue that has been fixed on contactgroups (3404470)

But this time on contacts.

$ perl nagios_reader_to_centreon_clapi.pl -C /etc/nagios/nagios.cfg > centreon_clapi_import.txt Can't locate object method "name" via package "exploitation_suiviprod" (perhaps you forgot to load "exploitation_suiviprod"?) a t nagios_reader_to_centreon_clapi.pl line 358.

I tried to patch the same way, but i still have problems.
(not sure why there's a hash in contacts??)

patch.txt

With the patch it fixes the error, but results in centreon_clapi_import.txt :

HTPL;setcontact;SAN_NAS;exploitation_suiviprod|exploitation_systeme
HTPL;setcontact;Windows;exploitation_suiviprod|exploitation_systeme
HOST;setcontact;3560-DMZ1;Nagios::Contact=HASH(0x1038b400)|Nagios::Contact=HASH(0x1038aea0)|Nagios::Contact=HASH(0x10392920)

Regards

Error message during execution

Hi,
Here is the message:
Use of uninitialized value $value in pattern match (m//) at /usr/lib/perl5/site_perl/5.14.2/Nagios/Object.pm line 860, line 14580.

If it's help you Laurent :-)

Thanks

Can't use an undefined value as an ARRAY reference

After commenting out the offending stanza for issue #6, I get instead:

Can't use an undefined value as an ARRAY reference at nagios_reader_to_centreon_clapi.pl_orig line 560.

Almost all services are missing from the output.

No Hosts, No Services

I have tested and i don't have any details of:

  • hosts
  • services
  • templates
  • ...

I've got only :

  • contacts
  • contact groups
  • commands
  • time period

is it expected? :-)

Thanks

Can't call method "use"

Hi, I have an issue on CentOS 6.4.. Nagios upgraded to 4.1.1, Nagios-Object-0.21.20 installed.

perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/nagios.cfg > /tmp/cntreon_clapi_import_commands.txt
Can't call method "use" without a package or object reference at nagios_reader_to_centreon_clapi.pl line 475.

Export limits at 2000 + Object not found:Nagios::Contact=HASH(0x930f850)

Hello,

I've successfully imported my configuration from an old Nagios server, and managed to make all check works.

But I notice that not all services have been imported from the old configuration. When I checked the file generated by the script nagios_reader_to_centreon_clapi.pl, I see a sharp 2000 services imported, when there are 2324 on my old Centreon.

[root@tom nagiosToCentreon]# grep "SERVICE;ADD" exportclapi | wc -l
2000

So it seems there's some kind of limitation here?


Another problem I have, is when I import this file in the new Centreon, I've got quite a bunch of these message :

Line 15425 : Object not found:Nagios::Contact=HASH(0x930f850)

Do you know by anychance what they mean?

Thank you very much in advance!

Unable to export services with same description name.

Hi , i'm having an issue exporting Services with same description name. to make it sample to understand here's an exemple :

Server 1 :
PING
CPU
RAM

Server 2 :
PING
CPU
RAM

I'll be unable to export Server 2 services , because they have same description name with Server 1. the workaround i did is to rename the Server 2 services (Srv2_Ping, Srv2_CPU, Srv2_RAM) to be able to export them.

If it can help i have CentOS 5.9 with A Fully Automated Nagios Running Nagios 3.4.4, trying to export them to my CES 3.3.

Called hostgroup() on an object that doesn't support it

Hi,

I try to import a Nagios configuration created by Centreon into CES. Nagios runs on a Debian system (Debian 7.9), I have installed libnagios-object-perl version 0.21.16-1, which comes with that release of Debian

Upon starting nagios_reader_to_centreon_clapi.pl, I get the following error:
Called hostgroup() on an object that doesn't support it. at /usr/share/perl5/Nagios/Object.pm line 961
Nagios::Object::hostgroup_name('Nagios::Contact=HASH(0x9512b44)') called at /usr/share/perl5/Nagios/Object/Config.pm line 646
Nagios::Object::Config::get_host_list('Nagios::Contact=HASH(0x9512b44)') called at /usr/share/perl5/Nagios/Object/Config.pm line 662
Nagios::Object::Config::register('Nagios::Object::Config=HASH(0x93d11e4)', 'Nagios::Contact=HASH(0x9512b44)') called at /usr/share/perl5/Nagios/Object/Config.pm line 813
Nagios::Object::Config::register_objects('Nagios::Object::Config=HASH(0x93d11e4)') called at /usr/share/perl5/Nagios/Config.pm line 136
Nagios::Config::new('Nagios::Config', 'Filename', '/tmp/nagiosToCentreon/nagios3/nagios.cfg', 'force_relative_files', 0) called at nagios_reader_to_centreon_clapi.pl line 742

Please advice

Thanks in advance

Dirk

Nagios 3.5.3 Import to Centreon 2.8.17

Hello!
I tried to Import the configuration from a new nagios Server to our centreon Server, but I´m getting the following error:

Use of uninitialized value in concatenation (.) or string at nagios_reader_to_centreon_clapi.pl line 480.

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

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

Import Object not found

Hello,

I try to export and then import a nagios configuration file. When I do the export I have a lot of errors like this one:
Line 5652 : Object not found:Serveurs-GaleraCluster,Serveurs-MySQL,Serveurs-Linux-Debian-AWS

This line is the folllowing in my import file:
HTPL;ADD;ABC-BDD-Servers;ABC-BDD-Servers;;ABC|Serveurs-GaleraCluster,Serveurs-MySQL,Serveurs-Linux-Debian-AWS;;

This is a host template with multiple host templates'parents defined :

  • ABC
  • Serveurs-GaleraCluster
  • Serveurs-MySQL
  • Serveurs-Linux-Debian-AWS

The first one is correctly parsed but not the 3 others.
I think this is because of the use of <,> instead of <|>.

Error import the centreon_clapi_import_commands

Hi,

I'm trying to import my all nagios configuration (services, objects, commands) in centreon but I have an error.

I ran $ perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/ > /tmp/centreon_clapi_import_commands.txt and I have a file with 4 lines.

But, when I tried to import my file with /usr/share/centreon/www/modules/centreon-clapi/core/centreon -u admin -p password -i /tmp/centreon_clapi_import_commands.txt the command prompt return :

Line 1 : Resource is already tied to instance
Line 2 : Resource is already tied to instance
Line 3 : Resource is already tied to instance
Line 4 : Resource is already tied to instance

Is it normal ?

Thanks you in advance :)

contact admin

All imported contact are desactivated in the Clapi (line 167)
printf ( "CONTACT;setparam;%s;contact_activate;0\n", $contact_name);
When you import your clapi, if you had a admin user in your target Centreon, you are not able to connect anymore on your system. You have to activate your admin user through MySQL to recover connection.
Why do you desactivate user contact in this script ?
Could you exclude admin contact from desactivation in this script.

Normal check interval and retry check interval does not work for Services

Hello,

Services (template or not) are not exported with their normal and retry check interval.

Functions are misnamed :

printf ( "%s;setparam;%s;normal_check_interval;%s\n", $type, $service_name, $service->check_interval ) if ( defined ( $service->check_interval ) );

It should be $service->normal_check_interval instead of $service->check_interval.
The same goes for retry check interval

Can't locate object method "members" via package "allhosts"

Can't locate object method "members" via package "allhosts" (perhaps you forgot to load "allhosts"?) at nagios_reader_to_centreon_clapi.pl line 381.

The hosts and the services ar not exported in the txt file, it's stop after Host Templates

Cannot locate object

Hi,

Got the following error / message, it could help you:
Can't locate object method "contactgroup_name" via package "grp_piquet" (perhaps you forgot to load "grp_piquet"?) at /tmp/nagios_reader_to_centreon_clapi.pl line 343.

grp_piquet est un groupe de contact.

Thanks

Can't call method "register" without a package or object reference at nagios_reader_to_centreon_clapi.pl line 490.

When I run perl nagios_reader_to_centreon_clapi.pl --config /usr/local/nagios/etc/nagios.cfg > /tmp/centreon_clapi_import_commands.txt I get these 2 errors:

Use of uninitialized value $name in exists at /usr/local/share/perl/5.14.2/Nagios/Object/Config.pm line 367.

Can't call method "register" without a package or object reference at nagios_reader_to_centreon_clapi.pl line 490.

I tried writing Nagios::Object::Config in front of register method call, which took me a bit further:

Can't call method "registered" without a package or object reference at /usr/local/share/perl/5.14.2/Nagios/Object/Config.pm line 568.

When I try to provide Nagios::Object::registered nothing changes.

Do you have any suggestions?
If the module Nagios::Object::Config is loaded why register is not recognized?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.