Projet

Général

Profil

Révision ca88b232

IDca88b2322520e6a02d526299a1e903f07adae3b7
Parent b76955b1
Enfant 835f964e

Ajouté par Vincent HOBEIKA il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/pureftpd_count
1
#!/bin/sh
2
#
3
#
4
# Script to show pureftp counts.
5
# Logs are searched in /var/log/pure-ftpd/transfer.log by default.
6
# Logs must be in w3c format: 
7
# pure-ftpd --altlog w3c:/var/log/pure-ftpd/transfer.log
8
#
9
# Parameters understood:
10
#
11
#       config   (required)
12
#       autoconf (optional - used by munin-config)
13
#
14
#
15
# Magic markers (optional - used by munin-config and installation
16
# scripts):
17
#
18
#%# family=auto
19
#%# capabilities=autoconf
20

  
21
MAXLABEL=20
22

  
23
if [ "$1" = "autoconf" ]; then
24
        echo yes
25
        exit 0
26
fi
27

  
28
if [ "$1" = "config" ]; then
29

  
30
        echo 'graph_title FTP Server'
31
        echo 'graph_args --base 1000 -l 0'
32
        echo 'graph_vlabel Daily FTP Operations'
33
	echo 'graph_category FTP'
34
	echo 'graph_period second'
35
	echo 'ftp_put.type GAUGE'
36
	echo 'ftp_get.type GAUGE'
37
        echo 'ftp_put.label Files PUT'
38
        echo 'ftp_get.label Files GET'
39
        exit 0
40
fi
41

  
42
echo -en "ftp_put.value "
43
echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log  | grep [[:space:]]\\[\\]created[[:space:]] | wc -l)
44
echo -n
45
echo -en "ftp_get.value "
46
echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log  | grep [[:space:]]\\[\\]sent[[:space:]] | wc -l)
47

  

Formats disponibles : Unified diff