{
  "PauseUntilDate" : "0001-01-01T00:00:00Z",
  "MinorVersion" : 2,
  "IntroRelease" : "2045b",
  "LastSaveName" : "Drive Status",
  "AppVersion" : "5.0b1",
  "AutoPauseSettings" : [
    {
      "Identifier" : "51AD20B7-1248-461C-989F-3ECEA52C10DB",
      "Mode" : 0,
      "DayFromInterval" : 309725700,
      "DayToInterval" : 309725700
    }
  ],
  "LastSaveDate" : "2019-11-07T03:35:21Z",
  "Name" : "Drive Status",
  "NextAutoResumeDate" : "4001-01-01T00:00:00Z",
  "IsGroup" : false,
  "GroupIdentifier" : "",
  "NextAutoPauseDate" : "4001-01-01T00:00:00Z",
  "PluginIdentifier" : "Script",
  "PluginSettings" : {
    "ScriptSource" : "#Debug this file?\ndebug={Debug} # Set to 0 to turn off all debugging\nif [[ $debug = 1 ]]; then echo \"(INFO) DEBUGGING is ON\"; fi \n\n# Where do you want this output saved?\n# Needs to be somewhere that http can serve it on this machine\n# Does not end in trailing slash\nsave_path=\/tmp\n\n# Filename you want to save the results to\nsave_filename=drive_status.txt\n\n# Threshold for when a drive is too full, in integer, as percent\ndrive_capacity_thresh={Max Capacity}\n\n# -- DO NOT EDIT BELOW THIS LINE -- #\n\n# Just in case, make the path, so we can avoid error checking it\nmkdir -p $save_path\n\n# Set the path to the entire filename\nsave_path=$save_path\/$save_filename\n\nif [[ $debug = 1 ]]; then echo \"(INFO) save_path: $save_path\"; fi;\n\n\n# --\n# Start check capacity\n# --\n\n# Clear out the $save_path file, add a date into the file\necho '' > $save_path\necho \"File last updated on: `date`\" >> $save_path\n\n# Check the `df` or capacity status on all drives\ndf | grep '\/dev\/' | while read df_line; \ndo\n\t# Get the volume identifier\n\tvolume_id=`echo $df_line | awk '{print $1;}'`\n\t\n\t# Must ignore disk images, they already exist on the main mount, so why bother checking\n\t# grep EXIT STATUS 0 means found, 1 means no match\n\tis_dmg=`diskutil info $volume_id | grep 'Disk Image'`\n\tif [[ $? -eq 0 ]]; then\n\t\tif [[ $debug = 1 ]]; then echo \"(Capacity) Found a .dmg, aborting capacity check\"; fi;\n\t\tcontinue\n\tfi\n\t\t\n\t# Get the current used space of the volume\n\tvolume_used=`echo $df_line | awk '{print $5;}' | sed 's\/%\/\/g'`\n\n\tif [[ $volume_used -ge $drive_capacity_thresh ]]\n\tthen\n\t\tif [[ $debug = 1 ]]; then echo \"(Capacity) $volume_id is more than $drive_capacity_thresh% full\"; fi;\n\t\techo \"Capacity ($volume_id $volume_used%): FAILURE\" >> $save_path\n\telse\n\t\tif [[ $debug = 1 ]]; then echo \"(Capacity) $volume_id is less than $drive_capacity_thresh% full\"; fi;\n\t\techo \"Capacity ($volume_id $volume_used%): SUCCESS\" >> $save_path\n\tfi\ndone\n\n# --\n# End check capacity\n# --\n\n# --\n# Start S.M.A.R.T. checking\n# --\n\n# Fetches just the volume id so we can check S.M.A.R.T. on that volume\nmy_disks=`diskutil list | grep 'partition_scheme' | awk '{print $5;}'`\n\nfor i in $my_disks\ndo\n\tif [[ $debug = 1 ]]; then echo \"(S.M.A.R.T.) Starting to check on $i\"; fi;\n\tsmart_result=`diskutil info $i`\n\t\n\t# Must ignore disk images, they always fail S.M.A.R.T and are not worth testing\n\tis_dmg=`echo \"$smart_result\" | grep 'Disk Image'`\n\tif [[ $? -eq 1 ]]; then\n\t\tif [[ $debug = 1 ]]; then echo \"(S.M.A.R.T.) Found a .dmg, aborting smart check\"; fi;\n\t\tcontinue\n\tfi\n\n\t# Parse out the S.M.A.R.T. status\n\t# grep EXIT STATUS 0 means found, 1 means no match\n\tsmart_result=`echo \"$smart_result\" | grep -E 'SMART Status\\:[[:space:]]+[Verified | Not Supported]'`\n\tif [[ $? -eq 1 ]]\n\tthen\n\t\tif [[ $debug = 1 ]]; then echo \"(S.M.A.R.T.) SMART is failing\"; fi;\n\t\techo \"S.M.A.R.T. status on ($i): FAILURE\" >> $save_path\n\telse\n\t\tif [[ $debug = 1 ]]; then echo \"(S.M.A.R.T.) SMART passed test on $i\"; fi;\n\t\techo \"S.M.A.R.T. status on ($i): SUCCESS\" >> $save_path\n\tfi\ndone\n\n# --\n# End check S.M.A.R.T.\n# --\n\n\n# --\n# Start RAID checking\n# --\n\n# Feteches the entire status of all RAID drives\n# Maybe later, iterate them, but I do not have more than one raid to test\nraid_result=`diskutil checkRaid`\n\n# As far as I can tell, the data from diskutil will always have\n# 'No RAID sets found' if it is not supported\n\necho \"$raid_result\" | grep --silent 'No RAID sets found'\nif [[ $? -eq 0 ]]\nthen\n\t# Do nothing, we are not interested in this test, there is no RAID\n\tif [[ $debug = 1 ]]; then echo \"(RAID) No RAID sets found\"; fi;\nelse\n\t# Found a RAID set to test, start poking at it\n\tif [[ $debug = 1 ]]; then echo \"(RAID) RAID SETS found\"; fi;\n\n\t# grep EXIT STATUS 0 means found, 1 means no match\n\techo \"$raid_result\" | grep -i --silent degraded\n\n\t# Check the result of the last grep command $? is bash last command\n\tif [[ $? -eq 0 ]]\n\tthen\n\t\tif [[ $debug = 1 ]]; then echo \"(RAID) RAID is Degraded\"; fi;\n\t\techo \"RAID status: FAILURE\" >> $save_path\n\telse\n\t\tif [[ $debug = 1 ]]; then echo \"(RAID) RAID is Online\"; fi;\n\t\techo \"RAID status: SUCCESS\" >> $save_path\n\tfi\nfi\n\n# --\n# End RAID checking\n# --\n\n# Show me the results\nif [[ $debug = 1 ]]; then cat $save_path; fi;\n\n# grep EXIT STATUS 0 means found, 1 means no match\ncat $save_path | grep --silent 'FAILURE'\nif [[ $? -eq 0 ]]\nthen\n\t\tif [[ $debug = 1 ]]; then echo \"Something is going wrong with your drives\"; fi;\n\t\texit 1\nelse\n\t\tif [[ $debug = 1 ]]; then echo \"All remote drives passed testing SMART, RAID, and CAPACITY\"; fi;\n\t\texit 0\nfi\n\n# Change log\n# 09:48 PM Wednesday 10\/13\/2008\n# Initial script written by merging three scripts\n\n# 07:31 PM Wednesday 10\/15\/2008\n# Went with \"grep -E 'SMART Status\\:[[:space:]]+Verified\" for the S.M.A.R.T. check\n# This should remove any chance for a false positive\n# Added in debug variable, and changed the way paths worked for '$save_path'\n\n# 03:43 PM Monday 01\/19\/2009\n# Converted script to work locally, just for Dejal Simon users\n# Changed S.M.A.R.T. section grep search string to 'partition_scheme' from\n#\tapple_partition_scheme since the latter was too strict a string\n# Excluded .dmg files from capacity check\n# Added in cleaner debug lines, to know where the chcek is at in the run\n\n\n",
    "ScriptInstructions" : "Script to check drive capacity threshold, S.M.A.R.T. status, and RAID health by Scott Haneda scott@hostizard.com \n\nAny single failure is a failure to be looked into.  This test is not to alert you which of RAID, Capacity, and S.M.A.R.T. failed, but rather, to alert you to look at your drives and see what is wrong. \n\nSet Debug to 1 if you are having troubles Set Max Capacity to a percentage value that your drive should not exceed (ie: 90).",
    "ScriptType" : "Bourne-Again Shell: \/bin\/bash",
    "ScriptVariables" : {
      "Debug" : "1",
      "Max Capacity" : "90"
    },
    "ScriptResults" : {
      "0" : "Success",
      "1" : "RAID, CAPACITY or SMART failure"
    }
  },
  "DeviceIdentifier" : "E9413342-9FF0-4B01-BE45-639894573DDE",
  "Mode" : 0,
  "Comments" : "Script to check drive capacity threshold, S.M.A.R.T. status, and RAID health.",
  "Identifier" : "Script - Drive Status",
  "MajorVersion" : 1
}