Random Project

Patch to improve error handling

Thank you for writing the plugin. It’s working with DS3400, but it did not notice all errors, because case failed to handle cases where
– output contains string “Failed” with capital F
– output doesn’t contain strings “optimal” or “failure”

Here’s a patch for 1.1 that should fix it:

100c100
*failed*|*Failed*)
109a110,114
> *)
> echo $RESULT
> echo “UNKNOWN”
> exit $STATE_UNKNOWN
> ;;
112c117,122
*)
> echo “Unkown response from SMCLI: ” $RESULT “”
> echo “UNKNOWN”
> exit $STATE_UNKNOWN
> ;;
> esac