From 06a567a233b6a27c663ebb28255f64a607c1f971 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 7 Jun 2024 12:00:59 +0200
Subject: [PATCH] remove check_sensuplugins

---
 check_sensuplugins       | 78 ----------------------------------------
 docs/20_Checks/_index.md |  1 -
 2 files changed, 79 deletions(-)
 delete mode 100755 check_sensuplugins

diff --git a/check_sensuplugins b/check_sensuplugins
deleted file mode 100755
index 0b1f8ea..0000000
--- a/check_sensuplugins
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-# ======================================================================
-#
-# SENSU CHECK FOR VALIDITY OF PLUGIN LINKS
-#
-# ----------------------------------------------------------------------
-#
-# ----------------------------------------------------------------------
-# 2018-07-17  first lines
-# 2022-10-21  v1.1  <axel.hahn@unibe.ch>     remove grep: warning: stray \ before white space
-# ======================================================================
-
-. `dirname $0`/inc_pluginfunctions
-
-
-tmpfile=/tmp/check_sensuplugins.out
-
-# ----------------------------------------------------------------------
-# functions to fetch infos by status
-# ----------------------------------------------------------------------
-
-function _getStatus(){
-  cat $tmpfile  | grep '^\.\.\.' | grep " $1\:"
-}
-
-function getTotal(){
-  _getStatus '.*'
-}
-function getOK(){
-  _getStatus "OK"
-}
-function getWarnings(){
-  _getStatus "WARNING"
-}
-function getErrors(){
-  _getStatus "ERROR"
-}
-
-
-# ----------------------------------------------------------------------
-# MAIN
-# ----------------------------------------------------------------------
-(/usr/local/bin/link-sensu-checks.sh -i ; /usr/local/bin/link-sensu-checks.sh -f) >$tmpfile
-
-# --- output of errors and warnings
-echo --- Check sensu plugins
-getErrors
-getWarnings
-
-# --- show status
-typeset -i iTOTAL=`getTotal | wc -l`
-typeset -i iOK=`getOK | wc -l`
-typeset -i iERRORS=`getErrors | wc -l`
-typeset -i iWARNINGS=`getWarnings | wc -l`
-
-echo --- Status:
-echo "total   : $iTOTAL"
-echo "Errors  : $iERRORS"
-echo "Warnings: $iWARNINGS"
-echo "OK      : $iOK"
-
-rm -f $tmpfile
-
-# --- return with wanted exitcode
-if [ $iERRORS -gt 0 ]; then
-  echo exit with error.
-  exit $EXIT_CRITICAL
-fi
-
-if [ $iWARNINGS -gt 0 ]; then
-  echo exit with warning
-  exit $EXIT_WARNING
-fi
-
-echo exit with OK
-exit $EXIT_OK
-
-# ----------------------------------------------------------------------
diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md
index 69c07af..0a06f3a 100644
--- a/docs/20_Checks/_index.md
+++ b/docs/20_Checks/_index.md
@@ -47,7 +47,6 @@ There is one include script used by all checks:
 * [check_rearbackup](check_rearbackup.md)
 * [check_reboot_required](check_reboot_required.md)
 * [check_requirements](check_requirements.md)
-* check_sensuplugins
 * check_smartstatus
 * [check_snmp_data](check_snmp_data.md)
 * check_snmp_printer
-- 
GitLab