From c56685a639dd991ca9b06bcdb687df580f410f78 Mon Sep 17 00:00:00 2001 From: Julien Mathis Date: Fri, 4 May 2007 12:22:18 +0000 Subject: [PATCH] add connection for ods git-svn-id: http://svn.centreon.com/Plugins/Dev@2232 6bcd3966-0018-0410-8128-fd23d134de7e --- centreon-plugins/src/check_meta_service.pl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/centreon-plugins/src/check_meta_service.pl b/centreon-plugins/src/check_meta_service.pl index be26537c5..fefb9d9ba 100644 --- a/centreon-plugins/src/check_meta_service.pl +++ b/centreon-plugins/src/check_meta_service.pl @@ -51,14 +51,10 @@ if ($opt_h) { exit $ERRORS{'OK'}; } -my $dbh = DBI->connect("DBI:mysql:database=oreon;host=localhost","oreon", "oreon-pwd",{'RaiseError' => 1}); +require("@OREON_PATH@/ODS/etc/conf.pm"); -my $sth1 = $dbh->prepare("SELECT * FROM `cfg_perfparse`"); -if (!$sth1->execute) {die "Error: cannot prepare query\n";} -my $ref1 = $sth1->fetchrow_hashref(); -my $dbh2 = DBI->connect("DBI:".$ref1->{'Storage_Modules_Load'}.":database=".$ref1->{'DB_Name'}.";host=".$ref1->{'DB_Host'}, - $ref1->{'DB_User'}, $ref1->{'DB_Pass'}, - {'RaiseError' => 1}); +my $dbh = DBI->connect("DBI:mysql:database=oreon;host=localhost","oreon", "oreon-pwd",{'RaiseError' => 1}); +my $dbh2 = DBI->connect("DBI:mysql:database=oreon;host=localhost","ods", "oreon-pwd",{'RaiseError' => 1}); my $result; my $warning;