[icinga-checkins] icinga.org: icinga-core/fholzer/core: Nicer declaration of Mysql variables

git at icinga.org git at icinga.org
Mon Apr 23 10:40:54 CEST 2012


Module: icinga-core
Branch: fholzer/core
Commit: 54a401993a3e7855568f85cddadcdd6aaa13929c
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=54a401993a3e7855568f85cddadcdd6aaa13929c

Author: Franz Holzer <office at frankstar.at>
Date:   Mon Apr 23 10:39:55 2012 +0200

Nicer declaration of Mysql variables

---

 tools/icinga_verification.pl |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/tools/icinga_verification.pl b/tools/icinga_verification.pl
index c5067cf..7f3edbd 100644
--- a/tools/icinga_verification.pl
+++ b/tools/icinga_verification.pl
@@ -175,8 +175,6 @@ my $ido2dbtcpport = get_key_from_ini("$icinga_base/ido2db.cfg", 'tcp_port');
 #ido2db Servertype
 #db_servertype=
 
-#ido2db Server Host Name
-my $mysqlserver_cfg =  get_key_from_ini("$icinga_base/ido2db.cfg", 'db_host');
 
 #ido2db Server port
 #db_port=
@@ -184,6 +182,10 @@ my $mysqlserver_cfg =  get_key_from_ini("$icinga_base/ido2db.cfg", 'db_host');
 #ido2db Server Socket
 #db_socket=
 
+#ido2db Mysql Config
+#ido2db Server Host Name
+my $mysqlserver_cfg =  get_key_from_ini("$icinga_base/ido2db.cfg", 'db_host');
+
 #ido2db DB User
 my $mysqluser_cfg = get_key_from_ini("$icinga_base/ido2db.cfg", 'db_user');
 
@@ -193,14 +195,8 @@ my $mysqldb_cfg = get_key_from_ini("$icinga_base/ido2db.cfg", 'db_name');
 #ido2db Password
 my $mysqlpw_cfg = get_key_from_ini("$icinga_base/ido2db.cfg", 'db_pass');
 
-# MySQL Checks#
-my $dbh_user         = '';
-my $dbh_user_error   = '';
-my $dbh_cfg          = '';
-my $dbh_cfg_error    = '';
-my $icinga_dbversion = '';
-my $sth_user         = '';
-my $sth1_user        = '';
+# MySQL Checks #
+my ($dbh_user, $dbh_user_error, $dbh_cfg, $dbh_cfg_error, $icinga_dbversion, $sth_user, $sth1_user) = '';
 my @result_icingadb  = ();
 my @row;
 my @result_icingaconninfo = ();
@@ -264,9 +260,6 @@ if ( !$mysqlcheck ) {
     if ( !$dbh_cfg_error ) {
         $dbh_cfg->disconnect();
     }
-	else{
-		$dbh_cfg->disconnect();
-	}
 }
 
 





More information about the icinga-checkins mailing list