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;
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';
#--- 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;
}