]> jspc29.x-matter.uni-frankfurt.de Git - hadesicinga.git/commitdiff
debugging. Sergey.
authorhadaq <hadaq>
Thu, 29 Jan 2009 12:02:14 +0000 (12:02 +0000)
committerhadaq <hadaq>
Thu, 29 Jan 2009 12:02:14 +0000 (12:02 +0000)
plugins/check_lustre.pl

index a0926ca4d7516828800110bdbb64ee8258e05cd4..ddf477a168471a50b5222147a19ddd4b90e07a58 100755 (executable)
@@ -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;
                    }