Ver código fonte

removed old "check failed" states that lead to errorneous error messages

Volker Tanger 4 meses atrás
pai
commit
8f115eb9c4
2 arquivos alterados com 25 adições e 17 exclusões
  1. 21 17
      functions.moshel
  2. 4 0
      history.txt

+ 21 - 17
functions.moshel

@@ -8,7 +8,7 @@
 #
 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-MOSHELVERSION="2.1.6"
+MOSHELVERSION="2.1.7"
 
 #---------------------------------------------------------
 # init library and files
@@ -89,10 +89,11 @@ CheckValueUnder () {
     fi
     RESULT=$( /bin/bash -c "$Command" | awk "$Awk" | cut -d "." -f 1 | cut -d "," -f 1  )
 
-    if [ -z "$RESULT" ]; then
-    	TextsAndGraphs "${Name}" 2 "Check failed"
-	RESULT=-1
-    elif [ "$RESULT" -ge $Value ]; then
+#    if [ -z "$RESULT" ]; then
+#    	TextsAndGraphs "${Name}" 2 "Check failed"
+#	RESULT=-1
+#    el
+    if [ "$RESULT" -ge $Value ]; then
     	TextsAndGraphs "${Name}" 1 "(${RESULT} !over! ${Value}) ${Message}"
     else
     	TextsAndGraphs "${Name}" 0 "(${RESULT} under ${Value}) ok"
@@ -115,10 +116,11 @@ CheckValueOver () {
     fi
     RESULT=$( /bin/bash -c "$Command" | awk "$Awk" | cut -d "." -f 1 | cut -d "," -f 1  )
 
-    if [ -z "$RESULT" ]; then
-    	TextsAndGraphs "${Name}" 2 "Check failed"
-	RESULT=-1
-    elif [ "$RESULT" -le $Value ]; then
+#    if [ -z "$RESULT" ]; then
+#   	TextsAndGraphs "${Name}" 2 "Check failed"
+#	RESULT=-1
+#    el
+    if [ "$RESULT" -le $Value ]; then
     	TextsAndGraphs "${Name}" 1 "(${RESULT} !under! ${Value}) ${Message}"
     else
     	TextsAndGraphs "${Name}" 0 "(${RESULT} over ${Value}) ok"
@@ -141,10 +143,11 @@ CheckCountLessThan () {
     fi
     RESULT=$( /bin/bash -c "$Command" | awk "$Awk" | wc -l  )
 
-    if [ -z "$RESULT" ]; then
-    	TextsAndGraphs "${Name}" 2 "Check failed"
-	RESULT=-1
-    elif [ "$RESULT" -ge $Value ]; then
+#    if [ -z "$RESULT" ]; then
+#    	TextsAndGraphs "${Name}" 2 "Check failed"
+#	RESULT=-1
+#    el
+    if [ "$RESULT" -ge $Value ]; then
     	TextsAndGraphs "${Name}" 1 "(${RESULT} !above! ${Value}) ${Message}"
     else
     	TextsAndGraphs "${Name}" 0 "(${RESULT} below ${Value}) ok"
@@ -166,10 +169,11 @@ CheckCountMoreThan () {
     fi
     RESULT=$( /bin/bash -c "$Command" | awk "$Awk" | wc -l  )
 
-    if [ -z "$RESULT" ]; then
-    	TextsAndGraphs "${Name}" 2 "Check failed"
-	RESULT=-1
-    elif [ "$RESULT" -le $Value ]; then
+#    if [ -z "$RESULT" ]; then
+#    	TextsAndGraphs "${Name}" 2 "Check failed"
+#	RESULT=-1
+#    el
+    if [ "$RESULT" -le $Value ]; then
     	TextsAndGraphs "${Name}" 1 "(${RESULT} !below! ${Value}) ${Message}"
     else
     	TextsAndGraphs "${Name}" 0 "(${RESULT} above ${Value}) ok"

+ 4 - 0
history.txt

@@ -66,6 +66,10 @@ wanted checks (examples)
 
 ------------------------------------------------------------------------
 
+2024-08-05
+    Volker Tanger <volker.tanger@wyae.de>
+	* bugfix: removed old "check failed" when value is 0
+	
 2024-08-02
     Volker Tanger <volker.tanger@wyae.de>
 	* feature: changed alert message (removed values) to reduce alert fatique