Skip to content
Snippets Groups Projects
Commit 24cc9b88 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

remove check_mailq

parent 53e807c2
Branches
No related tags found
1 merge request!606199 checkmailq remove
#!/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
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment