[monitoring-plugins] Fixing shellcheck SC2143

Jan Wagner git at monitoring-plugins.org
Thu Dec 2 17:00:13 CET 2021


 Module: monitoring-plugins
 Branch: master
 Commit: 5c473c8612a55cc71689bf4ba468a464bf9da197
 Author: Jan Wagner <waja at cyconet.org>
   Date: Fri Jan  6 18:02:36 2017 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=5c473c8

Fixing shellcheck SC2143

---

 plugins-scripts/check_oracle.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 70a3fef..9b9540a 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -219,7 +219,7 @@ and dbg.name='db block gets'
 and cg.name='consistent gets';
 EOF`
 
-    if [ -n "$(echo "$result" | grep ORA-)" ] ; then
+    if echo "$result" | grep -q 'ORA-' ; then
         error=$(echo "$result" | grep "ORA-" | head -1)
         echo "CRITICAL - $error"
         exit "$STATE_CRITICAL"
@@ -234,7 +234,7 @@ select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
 from v\\$librarycache lc;
 EOF`
 
-    if [ -n "$(echo "$result" | grep ORA-)" ] ; then
+    if echo "$result" | grep -q 'ORA-' ; then
         error=$(echo "$result" | grep "ORA-" | head -1)
         echo "CRITICAL - $error"
         exit "$STATE_CRITICAL"
@@ -273,7 +273,7 @@ from dba_free_space group by tablespace_name) B
 ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
 EOF`
 
-    if [ -n "$(echo "$result" | grep ORA-)" ] ; then
+    if echo "$result" | grep -q 'ORA-' ; then
         error=$(echo "$result" | grep "ORA-" | head -1)
         echo "CRITICAL - $error"
         exit "$STATE_CRITICAL"



More information about the Commits mailing list