[icinga-checkins] icinga.org: icinga-core/fholzer/core: $config_ref, services bugfix

git at icinga.org git at icinga.org
Thu Apr 26 14:04:58 CEST 2012


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

Author: Franz Holzer <office at frankstar.at>
Date:   Thu Apr 26 14:05:00 2012 +0200

$config_ref, services bugfix

---

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

diff --git a/tools/icinga_verification.pl b/tools/icinga_verification.pl
index 31e7998..8c2ccac 100644
--- a/tools/icinga_verification.pl
+++ b/tools/icinga_verification.pl
@@ -43,19 +43,21 @@ sub get_error_from_log;
 ### preconfiguration ###
 #Critical System Services
 my $config_ref = {
-    services => {
+    critical_services => {
         apache2 => { binaries => [ 'httpd', 'apache2' ] },
         mysql => { binaries => [ 'mysqld' ] },
         icinga => { binaries => [ 'icinga' ] },
         ido2db => { binaries => [ 'ido2db' ] },
-    }
-};
-#Non Critical System Services
-my $config_ref_noncrit = {
-    services => {
+    },
+	noncritical_services => {
 		snmptt => { binaries => [ 'snmptt' ] },
-    }
+	}   
 };
+#Non Critical System Services
+#my $config_ref_noncrit = {
+#    services => {		
+#    }
+#};
 
 ################################
 # Option parsing
@@ -461,8 +463,8 @@ print <<EOF;
 
 Icinga essential Services:
 EOF
-foreach my $service (keys(%{ $config_ref->{'services'} })) {
-    my $binary = which (@{ $config_ref->{'services'}->{$service}->{'binaries'} });
+foreach my $service (keys(%{ $config_ref->{'critical_services'} })) {
+    my $binary = which (@{ $config_ref->{'critical_services'}->{$service}->{'binaries'} });
     if (! $binary ) {
         print $statuswarn, "$service - no binary found.\n";
     } else {
@@ -475,13 +477,12 @@ foreach my $service (keys(%{ $config_ref->{'services'} })) {
         }
     }
 }
-
 print <<EOF;
 
-Non-Critical Services:
+non-critical Services:
 EOF
-foreach my $service (keys(%{ $config_ref_noncrit->{'services'} })) {
-    my $binary = which (@{ $config_ref_noncrit->{'services'}->{$service}->{'binaries'} });
+foreach my $service (keys(%{ $config_ref->{'noncritical_services'} })) {
+    my $binary = which (@{ $config_ref->{'noncritical_services'}->{$service}->{'binaries'} });
     if (! $binary ) {
         print $statuswarn, "$service - no binary found.\n";
     } else {
@@ -494,6 +495,7 @@ foreach my $service (keys(%{ $config_ref_noncrit->{'services'} })) {
         }
     }
 }
+
 print <<EOF;
 
 ############################################################





More information about the icinga-checkins mailing list