Author: arkurth
Date: Wed Aug 24 20:25:15 2011
New Revision: 1161266

URL: http://svn.apache.org/viewvc?rev=1161266&view=rev
Log:
VCL-503
Changed run_ssh_command to only send a critical notification on the last SSH 
attempt if the SSH timeout is reached.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/utils.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=1161266&r1=1161265&r2=1161266&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Wed Aug 24 20:25:15 2011
@@ -5577,10 +5577,16 @@ sub run_ssh_command {
                
                # Check if the timeout was reached
                if ($EVAL_ERROR && $EVAL_ERROR eq "alarm\n") {
-                       notify($ERRORS{'CRITICAL'}, 0, "attempt 
$attempts/$max_attempts: SSH command timed out after $duration seconds, timeout 
threshold: $timeout_seconds seconds, command: $node:\n$ssh_command");
-                       
                        # Kill the child processes of this reservation process
                        kill_child_processes($PID);
+                       
+                       if ($max_attempts == 1 || $attempts < $max_attempts) {
+                               notify($ERRORS{'WARNING'}, 0, "attempt 
$attempts/$max_attempts: SSH command timed out after $duration seconds, timeout 
threshold: $timeout_seconds seconds, command: $node:\n$ssh_command");
+                       }
+                       else {
+                               notify($ERRORS{'CRITICAL'}, 0, "attempt 
$attempts/$max_attempts: SSH command timed out after $duration seconds, timeout 
threshold: $timeout_seconds seconds, command: $node:\n$ssh_command");
+                               return;
+                       }
                        next;
                }
                elsif ($EVAL_ERROR) {


Reply via email to