diff ServerMonitor/Objects/Checks/SshCheck.cs @ 13:a36cc5c123f4

Fix SSH command sublclasses holding on to old command strings after a program update.
author Brad Greco <brad@bgreco.net>
date Mon, 15 Apr 2019 19:25:27 -0400
parents 052aa62cb42a
children 68d7834dc28e
line wrap: on
line diff
--- a/ServerMonitor/Objects/Checks/SshCheck.cs	Mon Apr 15 19:24:55 2019 -0400
+++ b/ServerMonitor/Objects/Checks/SshCheck.cs	Mon Apr 15 19:25:27 2019 -0400
@@ -66,6 +66,8 @@
         protected virtual List<CheckResult> ProcessCommandResult(string output, int exitCode)
         {
             List<CheckResult> results = new List<CheckResult>();
+            if (CheckCommandOutput)
+                results.Add(GetStringResult(CommandOutputMatchType, CommandOutputPattern, CommandOutputUseRegex, output, "Command output"));
             if (CheckExitCode)
             {
                 CheckResult result = GetIntResult(ExitCode, exitCode, "Exit code");
@@ -73,8 +75,6 @@
                     result.Message += ". Command output: " + output;
                 results.Add(result);
             }
-            if (CheckCommandOutput)
-                results.Add(GetStringResult(CommandOutputMatchType, CommandOutputPattern, CommandOutputUseRegex, output, "Command output"));
             return results;
         }