Fix typo in var and flip conditional

This commit is contained in:
Joshua Boniface 2023-02-17 16:17:46 -05:00
parent 5ae836f1c5
commit 3009f24910
1 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ output_values() {
PVC_OUTPUT="$( $PVC_CMD )" PVC_OUTPUT="$( $PVC_CMD )"
HOST="$( hostname --short )" HOST="$( hostname --short )"
in_maintenance="$( $JQ_CMD ".maintenance" <<<"${PVC_OUTPUT}" | tr -d '"' )" is_maintenance="$( $JQ_CMD ".maintenance" <<<"${PVC_OUTPUT}" | tr -d '"' )"
cluster_health="$( $JQ_CMD ".cluster_health.health" <<<"${PVC_OUTPUT}" | tr -d '"' )" cluster_health="$( $JQ_CMD ".cluster_health.health" <<<"${PVC_OUTPUT}" | tr -d '"' )"
cluster_health_messages="$( $JQ_CMD -r ".cluster_health.messages | @csv" <<<"${PVC_OUTPUT}" | tr -d '"' | sed 's/,/, /g' )" cluster_health_messages="$( $JQ_CMD -r ".cluster_health.messages | @csv" <<<"${PVC_OUTPUT}" | tr -d '"' | sed 's/,/, /g' )"
@ -147,9 +147,9 @@ output_values() {
echo "pvc_node_health.value ${node_health}" echo "pvc_node_health.value ${node_health}"
echo "pvc_node_health.extinfo ${node_health_messages}" echo "pvc_node_health.extinfo ${node_health_messages}"
if [[ ${node_health} -le 50 && ${is_maintenance} == "false" ]]; then if [[ ${node_health} -le 50 && ${is_maintenance} != "true" ]]; then
node_health_alert=2 node_health_alert=2
elif [[ ${node_health} -le 90 && ${is_maintenance} == "false" ]]; then elif [[ ${node_health} -le 90 && ${is_maintenance} != "true" ]]; then
node_health_alert=1 node_health_alert=1
else else
node_health_alert=0 node_health_alert=0