2014-10-04 21:13:45 +02:00
|
|
|
#!/bin/bash
|
2009-03-04 08:59:35 +01:00
|
|
|
#
|
|
|
|
# Plugin to monitor hylafax queue
|
|
|
|
#
|
|
|
|
# Usage: Place in /etc/munin/plugins/ (or link it there using ln -s)
|
|
|
|
#
|
|
|
|
# Parameters understood:
|
|
|
|
#
|
|
|
|
# config (required)
|
|
|
|
# autoconf (optional)
|
|
|
|
#
|
|
|
|
# Config variables:
|
|
|
|
#
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
FAXSTAT=${faxstat:=/usr/bin/faxstat}
|
|
|
|
FAXQ=${faxq:=/usr/sbin/faxqclean}
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
|
|
if [ -x ${FAXSTAT} ] ; then
|
|
|
|
echo yes
|
|
|
|
else
|
|
|
|
echo no
|
|
|
|
fi
|
2018-09-16 04:01:57 +02:00
|
|
|
exit 0
|
2009-03-04 08:59:35 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
JOBTYPES="Running Waiting Done"
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo 'graph_title Fax Jobs'
|
|
|
|
echo 'graph_vlabel Jobs in Queue'
|
2017-02-22 02:54:01 +01:00
|
|
|
echo 'graph_category other'
|
2009-03-04 08:59:35 +01:00
|
|
|
for i in $JOBTYPES; do
|
|
|
|
echo "$i.info Number of jobs in $i queue."
|
|
|
|
echo "$i.label $i"
|
|
|
|
# echo "$i.type DERIVE"
|
|
|
|
echo "$i.min 0"
|
|
|
|
echo "$i.warning 50"
|
|
|
|
echo "$i.critical 100"
|
|
|
|
done
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
for i in $JOBTYPES; do
|
|
|
|
echo -n "$i.value "
|
|
|
|
$FAXSTAT -dsl | egrep "(root|apache)" | awk -F" " '{print $3}' | grep -c ${i:0:1}
|
|
|
|
done
|
|
|
|
|
|
|
|
#${FAXQ} -j 1 -d 1
|
|
|
|
${FAXQ}
|