Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / fax / faxstat @ 29bdf34e

Historique | Voir | Annoter | Télécharger (1,11 ko)

1
#!/bin/bash
2
#
3
# Plugin to monitor hylafax queue
4
#
5
# Usage: Place in /etc/munin/plugins/ (or link it there using ln -s)
6
#
7
# Parameters understood:
8
#
9
#       config   (required)
10
#       autoconf (optional)
11
#
12
# Config variables:
13
#
14
#%# family=auto
15
#%# capabilities=autoconf
16

    
17
FAXSTAT=${faxstat:=/usr/bin/faxstat}
18
FAXQ=${faxq:=/usr/sbin/faxqclean}
19

    
20
if [ "$1" = "autoconf" ]; then
21
        if [ -x ${FAXSTAT} ] ; then
22
                echo yes
23
                exit 0
24
        else
25
                echo no
26
                exit 1
27
        fi
28
fi
29

    
30
JOBTYPES="Running Waiting Done"
31

    
32
if [ "$1" = "config" ]; then
33
        echo 'graph_title Fax Jobs'
34
        echo 'graph_vlabel Jobs in Queue'
35
        echo 'graph_category other'
36
        for i in $JOBTYPES; do
37
          echo "$i.info Number of jobs in $i queue."
38
          echo "$i.label $i"
39
#         echo "$i.type DERIVE"
40
          echo "$i.min 0"
41
          echo "$i.warning 50"
42
          echo "$i.critical 100"
43
        done
44
        exit 0
45
fi
46

    
47
for i in $JOBTYPES; do
48
  echo -n "$i.value "
49
  $FAXSTAT -dsl | egrep "(root|apache)" | awk -F" " '{print $3}' | grep -c ${i:0:1}
50
done
51

    
52
#${FAXQ} -j 1 -d 1
53
${FAXQ}