From: hadaq Date: Thu, 29 Jan 2009 12:02:14 +0000 (+0000) Subject: debugging. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5bd2a5a870626002c2b4edb2f5d685bda10dd947;p=hadesicinga.git debugging. Sergey. --- diff --git a/plugins/check_lustre.pl b/plugins/check_lustre.pl index a0926ca..ddf477a 100755 --- a/plugins/check_lustre.pl +++ b/plugins/check_lustre.pl @@ -17,8 +17,8 @@ use Time::Local; use Time::localtime; use Getopt::Std; -# the following is for the status server -# to communicate with Nagios plugin +#- The following is for the status server +#- to communicate with Nagios plugin use threads; use threads::shared; use IO::Socket; @@ -32,10 +32,10 @@ if($opt_h){ exit(0); } -my $status : shared = "OK"; # status reported by Nagios +my $status : shared = "OK"; #- status reported by Nagios my $time_ls : shared = &getTime(); -my $sleep_time : shared = 600; # 10 minutes -my $ExitCode : shared = -1; # used to stop threads +my $sleep_time : shared = 600; #- 10 minutes +my $ExitCode : shared = -1; #- used to stop threads our $server_port = '50502'; our $protocol = 'tcp'; @@ -138,6 +138,9 @@ sub statusServer{ #--- report the status my $current_time = &getTime(); + my $time_diff = abs($current_time - $time_ls); + my $itimediff = int((abs($current_time - $time_ls))/60); + print "curtime: $current_time timels: $time_ls timediff: $time_diff itimediff: $itimediff\n"; if( abs($current_time - $time_ls) < 3*$sleep_time ){ print $client_socket $status; }