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

Merge branch 'master' of git-repo.iml.unibe.ch:iml-open-source/icinga-checks

parents 2dfcdf6c dcf41939
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment