diff ServerMonitor/Objects/Checks/DiskSpaceCheck.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 3142e52cbe69
children 68d7834dc28e
line wrap: on
line diff
--- a/ServerMonitor/Objects/Checks/DiskSpaceCheck.cs	Mon Apr 15 19:24:55 2019 -0400
+++ b/ServerMonitor/Objects/Checks/DiskSpaceCheck.cs	Mon Apr 15 19:25:27 2019 -0400
@@ -10,7 +10,9 @@
     [DisplayName("Disk space check"), Description("Check the remaining free disk space"), DisplayWeight(11)]
     public class DiskSpaceCheck : SshCheck
     {
-        public override string Command => string.Format(base.Command, Device);
+        public override string Command => string.Format(DiskSpaceCommand, Device);
+
+        protected string DiskSpaceCommand => "df -P -k {0}";
 
         public string Device { get; set; }
 
@@ -20,8 +22,6 @@
 
         public DiskSpaceCheck()
         {
-            //Command = "df -P -k {0} | awk 'NR>1' | tr -s ' ' | cut -d ' ' -f 4,5";
-            Command = "df -P -k {0}";
             CheckExitCode = true;
             ExitCode = 0;
         }