Select Git revision
inc_haproxy_cfg.sh
-
Hahn Axel (hahn) authoredHahn Axel (hahn) authored
check_snmp_printer 1.39 KiB
#!/bin/env bash
# ============================================================
#
# Wrapper for check_snmp_printer plugin
#
# ------------------------------------------------------------
# 2021-03-22 <axel.hahn@iml.unibe.ch> v0.1
# ============================================================
# ------------------------------------------------------------
# CONFIG
# ------------------------------------------------------------
check='/usr/lib64/nagios/plugins/check_snmp_printer'
debug=0
# ------------------------------------------------------------
# MAIN
# ------------------------------------------------------------
sParams="$*"
# find host behind param -H
snmphost=$( echo $sParams | sed -Ee 's#.*\-H\ ([0-9a-z\.\-]*).*#\1#' )
what=$( echo $sParams | sed -Ee 's#.*\-\-([a-z]*).*#\1#' )
case "$what" in
consum)
what="Consumables"
;;
messages)
what="Messages of the printer"
;;
pagecount)
what="Number of printed pages"
;;
trays)
what="Status of trays for paper"
sParams="$sParams --nofeeder"
;;
esac
if [ "$debug" = "1" ]; then
echo COMMAND @ `date`
echo $0 $*
echo "$what - `$check --model -H $snmphost` - IP $snmphost"
echo ---
echo calling $check $sParams
echo ---
fi
$check $sParams