From cdd9cb3a94a0c9c5e0b536e90c4910d2074d64ca Mon Sep 17 00:00:00 2001 From: hadaq Date: Thu, 29 Jan 2009 13:07:53 +0000 Subject: [PATCH] fixed. Sergey. --- plugins/check_lustre.pl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/check_lustre.pl b/plugins/check_lustre.pl index db50c41..5f52829 100755 --- a/plugins/check_lustre.pl +++ b/plugins/check_lustre.pl @@ -34,7 +34,7 @@ if($opt_h){ my $status : shared = "OK"; #- status reported by Nagios my $time_ls : shared = &getTime(); -my $sleep_time : shared = 10; #- 10 minutes +my $sleep_time : shared = 600; #- 10 minutes my $ExitCode : shared = -1; #- used to stop threads our $server_port = '50502'; @@ -105,8 +105,8 @@ sub statusServer{ my $client_socket; my $selector; - # To decrease a wait time for socket, use - # ReuseAddr with Linux and ReusePort with OpenBSD + #- To decrease a wait time for socket, use + #- ReuseAddr with Linux and ReusePort with OpenBSD unless (defined( $server_socket = IO::Socket::INET->new( LocalPort => $server_port, Proto => 'tcp', @@ -137,9 +137,7 @@ 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; } -- 2.43.0