[icinga-checkins] icinga.org: icinga-core/fholzer/core: ido2db/ idomod socket compare with output

git at icinga.org git at icinga.org
Tue Apr 24 13:34:57 CEST 2012


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

Author: Franz Holzer <office at frankstar.at>
Date:   Tue Apr 24 11:57:23 2012 +0200

ido2db/idomod socket compare with output

---

 tools/icinga_verification.pl |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/tools/icinga_verification.pl b/tools/icinga_verification.pl
index 9ed41f1..20b8a16 100644
--- a/tools/icinga_verification.pl
+++ b/tools/icinga_verification.pl
@@ -230,6 +230,9 @@ my $ido2dbsocketname = get_key_from_ini("$icinga_base/ido2db.cfg", 'socket_name'
 #IDOMOD.cfg parsing
 #Output Socket
 my $idomodsocket = get_key_from_ini("$icinga_base/idomod.cfg", 'output_type');
+if ($idomodsocket == 'unixsocket'){
+	$idomodsocket = 'unix';
+}
 
 #Output
 my $idomodoutput = get_key_from_ini("$icinga_base/idomod.cfg", 'output');
@@ -237,9 +240,13 @@ my $idomodoutput = get_key_from_ini("$icinga_base/idomod.cfg", 'output');
 #idomod SSL Status
 my $idomodssl = get_key_from_ini("$icinga_base/idomod.cfg", 'use_ssl');
 
-#idomod SSL Status
+#idomod TCP port
 my $idomodtcpport = get_key_from_ini("$icinga_base/idomod.cfg", 'tcp_port');
 
+
+#ido2db - idomod socket compare
+
+
 # MySQL Checks #
 my $dbh_conn_error = '';
 my @result_icingadb  = ();
@@ -339,11 +346,12 @@ Icinga Informations:
  SSL Status: $idomodssl
  TCP Port: $idomodtcpport
  
- Testing Mysql Connection with ido2db.cfg:
-EOF
+##################### Test Results: ########################
 
+Mysql Connection with ido2db.cfg:
+EOF
 if (!$dbh_cfg_error){
-	print color("green"), " Connection OK!\n", color("reset");	
+	print color("green"), " Connection OK!", color("reset");	
 }
 else{
 	print color("red"), " $dbh_cfg_error\n", color("reset");
@@ -351,11 +359,22 @@ else{
 # MYSQL User Input Error
 print color("red"), " $dbh_conn_error\n", color("reset");
 print "\n";
+
 print <<EOF;
-#Check Services
-Process Status:
+ido2db - idomod Socket:
 EOF
+# ido2db -> idomod socket
+if ($ido2dbsocket eq $idomodsocket){
+	print color("green"), " ido2db/idomod writing/listen to the same socket", color("reset");
+} else {
+	print color("red"), " ido2db/idomod sockets are different", color("reset");
+}
+
+print <<EOF;
 
+
+Process Status:
+EOF
 foreach my $service (keys(%{ $config_ref->{'services'} })) {
     my $binary = which (@{ $config_ref->{'services'}->{$service}->{'binaries'} });
     if (! $binary ) {
@@ -476,4 +495,4 @@ sub get_ido2db_version {
     } else {
         return 'ido2db binary not found in PATH';
     }
-}
+}
\ No newline at end of file





More information about the icinga-checkins mailing list