diff --git a/check_eol.md b/check_eol.md deleted file mode 100644 index d31a197cd2b1e76e1ac103c5770f2c125230db03..0000000000000000000000000000000000000000 --- a/check_eol.md +++ /dev/null @@ -1,114 +0,0 @@ -# IML Checks for Icinga / Nagios - -[Home](readme.md) - ---- - -## check EOL - -### Introduction - -**check_eol** is a plugin for Icinga/ Nagios. It detects the end of life of an OS or a product. - -You get a status "ok", "warning" or "critical" based on the limits. - -The status is "unknown" if a product or the eol date was not detected. - -It is customizable / extendable to detect other products that are not included in the delivered basic config. - -### Syntax - -``$ check_eol [-c CRITICAL] [-w WARNING] PRODUCT VERSION`` - -#### Parameters - -PRODUCT set a product; known product keys are listed below -VERSION set a version. - - Autodetection: - There is a special handling vor version "detect". - You can set "os" as product to detect the (linux) distribution. - See examples below. - -#### Options - - -c set critical limit; default 90 - -w set warning limit; default 365 - -### Examples - -``check_eol php 7.4`` - Show end of life for given php version 7.4 - -``check_eol -w 100 -c 30 php 7.4`` - Add custom critical and warning limits - -``check_eol os detect`` - Show end of life for current linux os. The distribution and the major version will be detected. - -``check_eol php detect`` - Show the end of life for the detected php version - -### Extend/ customize - -The check is build to be customizable. You can add - -* add your own end of life dates -* version detection for other products - -#### End of life dates - -The dates are defined in the files *check_eol-*.cfg*. -Those contain lines with parsed information that must start at the begin of line: - -* ``[Key]:[version]:[Date as YYYY-MM-DD]:[COMMENT]`` - * Key: name of the product in lowercase, i.e. "php", "centos" - * Version: version number, i.e. a major version i.e. "12" for Node or "7.4" for PHP - * Date as YYYY-MM-DD - * Comment: this is optional -* ``[Key]:METADATA for a product (can be multiline)`` - * This type is completely optional. You can use it to show general (version indepenendent) product infos. It will be shown as additional text for each version of a product - -Al other lines, like empty lines, lines starting with special characters are ignored. I use the hash to mark comments. - -Snippet: - - # -------------------------------------------- - centos:The CentOS Project - centos:website https://www.centos.org/ - # -------------------------------------------- - - centos:6:2020-11-30 - centos:7:2024-06-30 - centos:8:2029-05-31 - -Example output: - - $ check_eol centos 7 - OK [centos 7] ends on 2024-06-30 ... 1586 days left - - The CentOS Project - website https://www.centos.org/ - - Limit Info: warn below 365 days; critical below 90 days - -#### Files - -* check_eol-data/os.cfg - contains eol dates for debian, centos, ubuntu -* check_eol-data/check_eol-databases.cfg - Mariadb, PostgreSql -* check_eol-data/check_eol-program-languages.cfg - Php, NodeJS - -You can add your custom products and dates - it just must match *check_eol-*.cfg*. You should use a custom file name that does not conflict with delivered files. - -Suggestion: *check_eol-data/custom-[my category].cfg* - -#### Version detection - -If you use ``check_eol [product] [version]`` with an already known version in your monitoring check then the search for an eol date is done directly in the *cfg files (see above). - -If you wan to let detect the version use the keyword *detect* next to a product i.e. ``check_eol php detect``. -What happens is is uses a detection for the version number. Therefor it calls a script named *check_eol-versiondetect/detect-[PRODUCT]* - in our example for php ist is *check_eol-versiondetect/detect-php*. - -The scripts *check_eol-versiondetect/detect-[PRODUCT]* must return just a major version - or major and minor version without any other text. - -You can add your own scripts for other non existing products. The only rule is: it must output the version only. Your [PRODUCT] and the returned version will be scanned in *check_eol-*.cfg* to perform the eol check. diff --git a/check_mailq b/check_mailq deleted file mode 100755 index 073a1b52df32333edd489e1365c3da2167d8d26e..0000000000000000000000000000000000000000 --- a/check_mailq +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# ====================================================================== -# -# Check mailq size -# -# requirements: -# - mailq -# -# ---------------------------------------------------------------------- -# 2022-10-21 v1.0 <andrea.gottsponer@unibe.ch> -# ====================================================================== - - -. `dirname $0`/inc_pluginfunctions - -# ---------------------------------------------------------------------- -# MAIN -# ---------------------------------------------------------------------- - -# --- check required tools -ph.require mailq - -# --- check param -h -if [ "$1" = "-h" ]; then - echo " - usage: $0 [ -w value -c value -h ] - - -w Warning level - -c Critical level - -h this help - " - exit 0 -fi - -# set default / override from command line params -typeset -i iWarnLimit=` ph.getValueWithParam 5 w "$@"` -typeset -i iCriticalLimit=` ph.getValueWithParam 20 c "$@"` - -# get mailq count -iMailqCount=`mailq | grep -c "^[A-F0-9]"` - -ph.setStatusByLimit ${iMailqCount} ${iWarnLimit} ${iCriticalLimit} - -# --- status output -ph.status "${iMailqCount} Queue Count" - -# --- performance data usage -ph.perfadd "mailq" "${iMailqCount}" $iWarnLimit $iCriticalLimit 0 - -# --- Bye -ph.exit - -# ---------------------------------------------------------------------- diff --git a/check_smartstatus b/check_smartstatus index ffaf43e6d2adf19c959795d76cdf1c190e536022..8769164bf0d5eb89565fd69185efcbcde403701d 100755 --- a/check_smartstatus +++ b/check_smartstatus @@ -105,7 +105,7 @@ function checkDrive(){ if [ $? -eq 0 ]; then status=`grep -i "$sLabel" $tmpfile | cut -f 2 -d ":"` sOut="$sOut ${status}" - echo $status | egrep -i "$sOK" >>$tmpfile + echo $status | grep -Ei "$sOK" >>$tmpfile if [ $? -ne 0 ]; then iErrors=$iErrors+1 ph.setStatus "critical"