From: Hades DAQ Date: Fri, 7 Mar 2014 16:21:23 +0000 (+0100) Subject: JAM: adjustments for icinga on lxhadeb06 X-Git-Tag: pre2018~107 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=101bea5252803f36c302adc458d67662113a3d46;p=hadesdaq.git JAM: adjustments for icinga on lxhadeb06 --- diff --git a/hmon/permanent/hmon_icinga.pl b/hmon/permanent/hmon_icinga.pl index eb4d22c..cc416b6 100755 --- a/hmon/permanent/hmon_icinga.pl +++ b/hmon/permanent/hmon_icinga.pl @@ -19,7 +19,7 @@ my $interval = 5; my ($socket,$client_socket); $socket = new IO::Socket::INET ( - PeerHost => 'hadesdaq02', + PeerHost => 'lxhadeb06', PeerPort => '12345', Proto => 'tcp' ); @@ -52,13 +52,13 @@ while (1) { if (!$result) { #print "open socket\n"; $socket = new IO::Socket::INET ( - PeerHost => 'hadesdaq02', + PeerHost => 'lxhadeb06', PeerPort => '12345', Proto => 'tcp'); if (!($socket)) { #print "unable to open socket\n"; $value = "DOWN"; - $longtext = "Unable to connect to hadesdaq02 (icinga log deamon)"; + $longtext = "Unable to connect to lxhadeb06 (icinga log deamon)"; $num_errors = 999; } } @@ -80,19 +80,21 @@ while (1) { } #print "blubb\n"; - + # JAM: below changed from a[8] to a[9] due to different ls format if (defined $result_a) { #print $result_a . "\n"; my @a = split(/\s+/,$result_a); + #print $a[9]. "\n"; + #print $a[10]. "\n"; if ($started == 1) { $started = 0; - $last_mod_time = $a[8]; + $last_mod_time = $a[9]; $num_unchanged = 0; } - if ($last_mod_time ne $a[8]) { + if ($last_mod_time ne $a[9]) { my @a = split(/\s+/,$result_a); - $last_mod_time = $a[8]; + $last_mod_time = $a[9]; $num_unchanged = 0; } else { $num_unchanged++; @@ -108,30 +110,32 @@ while (1) { $value = "DOWN"; $longtext = "Icinga not updated since $last_mod_time"; QA::WriteQALog($flog,"server","icinga",10,QA::FATAL,$title,$value,$longtext); + $num_unchanged = 0; + # JAM better reset counter here } else { - my $icinga_query_hosts = "ssh hadesdaq02 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/icinga/cgi/status.cgi\" | grep -v declare"; + my $icinga_query_hosts = "ssh lxhadeb06 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/cgi-bin/icinga/status.cgi\" | grep -v declare"; my @icinga_result_hosts = qx($icinga_query_hosts); splice(@icinga_result_hosts, 0, 7); #printf("@icinga_result_hosts"); $num_errors += scalar @icinga_result_hosts; - my $icinga_query_etrax = "ssh hadesdaq02 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&hostgroup=etrax&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/icinga/cgi/status.cgi\" | grep -v declare"; + my $icinga_query_etrax = "ssh lxhadeb06 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&hostgroup=etrax&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/cgi-bin/icinga/status.cgi\" | grep -v declare"; my @icinga_result_etrax = qx($icinga_query_etrax); #printf("@icinga_result_etrax"); splice(@icinga_result_etrax, 0, 7); my $num_errors_etrax = scalar @icinga_result_etrax; - my $icinga_query_power = "ssh hadesdaq02 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&hostgroup=power&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/icinga/cgi/status.cgi\" | grep -v declare"; + my $icinga_query_power = "ssh lxhadeb06 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&hostgroup=power&style=hostdetail&hoststatustypes=4&hostprops=10' /usr/lib/cgi-bin/icinga/status.cgi\" | grep -v declare"; my @icinga_result_power = qx($icinga_query_power); #print @icinga_result_power . "\n"; splice(@icinga_result_power, 0, 7); my $num_errors_power = scalar @icinga_result_power; - my $icinga_query_services = "ssh hadesdaq02 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&style=detail&servicestatustypes=16&hoststatustypes=3&serviceprops=2097162' /usr/lib/icinga/cgi/status.cgi\" | grep -v declare"; + my $icinga_query_services = "ssh lxhadeb06 \"REMOTE_USER='icingaadmin' REQUEST_METHOD='GET' QUERY_STRING='csvoutput&style=detail&servicestatustypes=16&hoststatustypes=3&serviceprops=2097162' /usr/lib/cgi-bin/icinga/status.cgi\" | grep -v declare"; my @icinga_result_services = qx($icinga_query_services); splice(@icinga_result_services, 0, 7); #printf("@icinga_result_services");