Projet

Général

Profil

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

root / plugins / ftp / pure-ftpd @ ef960abc

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

1 162259cd Tamas Fejos
#!/bin/sh
2
#
3
# Plugin to monitor pure-ftpd status
4
#
5
# (c) Julien Danjou <julien@danjou.info>
6
#
7
#  GPLv2 licensed
8
#
9
# Parameters:
10
#
11
# 	config   (required)
12
# 	autoconf (optional - used by munin-config)
13
#
14
# Config variables:
15
#
16
# 	spooldir     - Override what exim says
17
# 	exim         - Where's exim?
18
# 	queuewarn    - When to warn
19
# 	queuecrit    - When to crit
20
#
21
# Configuration:
22
# Maybe need to add folowing lines to plugins config file
23
# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho 
24
# as user with apropirate privilegs then restart munin-node.
25
#
26
# [pure-ftpd]
27
# user root
28
#
29
# 2008/02/01 - TMS
30
# - Little Configuration documentation
31
# - Added monitoring IDLE connections
32
#
33
# 2007/05/07 - jd
34
# First release
35
#
36
# Magic markers (optional - used by installation scripts and
37
# munin-config):
38
#
39
#%# family=contrib
40
#%# capabilities=autoconf
41
42
PW=`which pure-ftpwho 2>/dev/null`
43
GRAPHTITLE='FTP connections'
44
45
test -n "$pw" && PW=$pw
46
test -n "$graphtitle" && GRAPHTITLE=$graphtitle
47
48
if [ "$1" = "autoconf" ]; then
49
	if test -x $PW; then
50
		echo yes
51
		exit 0
52
	else
53
		echo "no (pure-ftpwho not found)"
54
		exit 0
55
	fi
56
fi
57
58
if [ "$1" = "config" ]; then
59
	echo "graph_title $GRAPHTITLE"
60
	echo 'graph_args --base 1000 -l 0'
61
	echo 'graph_vlabel connections'
62
	echo 'graph_category ftp'
63
	echo 'upload.label Upload'
64
	echo 'download.label Download'
65
	echo 'idle.label Idle'
66
	echo 'upload.draw AREA'
67
	echo 'download.draw STACK'
68
	echo 'idle.draw STACK'
69
	exit 0
70
fi
71
72
printf "download.value "
73
$PW -n -s | grep -c ' DL '
74
printf "upload.value "
75
$PW -n -s | grep -c ' UL '
76
printf "idle.value "
77
$PW -n -s | grep -c 'IDLE'