1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Save with UNIX line breaks

- also remove lots of trailing whitespace on last line
This commit is contained in:
Stig Sandbeck Mathisen 2014-10-04 21:16:42 +02:00
parent 73239efaef
commit 6a28f5a215
2 changed files with 71 additions and 72 deletions

View file

@ -1,25 +1,25 @@
#! /bin/sh #! /bin/sh
# configuration : # configuration :
# #
# env.LOGFILE /var/log/proftpd/proftpd.log # env.LOGFILE /var/log/proftpd/proftpd.log
if [ "$1" = 'config' ]; then if [ "$1" = 'config' ]; then
echo "graph_args --base 1000 -l 0" echo "graph_args --base 1000 -l 0"
echo "graph_title Serveur FTP" echo "graph_title Serveur FTP"
echo "graph_category Ftp" echo "graph_category Ftp"
echo "graph_vlabel Stats Proftpd" echo "graph_vlabel Stats Proftpd"
echo "succes.label Login succes" echo "succes.label Login succes"
echo "succes.draw AREA" echo "succes.draw AREA"
echo "failed.label Login failed" echo "failed.label Login failed"
echo "failed.draw AREA" echo "failed.draw AREA"
fi fi
LOGFILE=${LOGFILE:-"/var/log/proftpd/proftpd.log"} LOGFILE=${LOGFILE:-"/var/log/proftpd/proftpd.log"}
succes=$(grep -c "successful" "$LOGFILE" ) succes=$(grep -c "successful" "$LOGFILE" )
failed=$(grep -c "Login failed" "$LOGFILE" ) failed=$(grep -c "Login failed" "$LOGFILE" )
echo "succes.value $succes" echo "succes.value $succes"
echo "failed.value $failed" echo "failed.value $failed"
exit 0 exit 0

View file

@ -1,47 +1,46 @@
#!/bin/sh #!/bin/sh
# #
# #
# Script to show pureftp counts. # Script to show pureftp counts.
# Logs are searched in /var/log/pure-ftpd/transfer.log by default. # Logs are searched in /var/log/pure-ftpd/transfer.log by default.
# Logs must be in w3c format: # Logs must be in w3c format:
# pure-ftpd --altlog w3c:/var/log/pure-ftpd/transfer.log # pure-ftpd --altlog w3c:/var/log/pure-ftpd/transfer.log
# #
# Parameters understood: # Parameters understood:
# #
# config (required) # config (required)
# autoconf (optional - used by munin-config) # autoconf (optional - used by munin-config)
# #
# #
# Magic markers (optional - used by munin-config and installation # Magic markers (optional - used by munin-config and installation
# scripts): # scripts):
# #
#%# family=auto #%# family=auto
#%# capabilities=autoconf #%# capabilities=autoconf
MAXLABEL=20 MAXLABEL=20
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo yes echo yes
exit 0 exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo 'graph_title FTP Server' echo 'graph_title FTP Server'
echo 'graph_args --base 1000 -l 0' echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Daily FTP Operations' echo 'graph_vlabel Daily FTP Operations'
echo 'graph_category FTP' echo 'graph_category FTP'
echo 'graph_period second' echo 'graph_period second'
echo 'ftp_put.type GAUGE' echo 'ftp_put.type GAUGE'
echo 'ftp_get.type GAUGE' echo 'ftp_get.type GAUGE'
echo 'ftp_put.label Files PUT' echo 'ftp_put.label Files PUT'
echo 'ftp_get.label Files GET' echo 'ftp_get.label Files GET'
exit 0 exit 0
fi fi
echo -en "ftp_put.value " echo -en "ftp_put.value "
echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log | grep [[:space:]]\\[\\]created[[:space:]] | wc -l) echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log | grep [[:space:]]\\[\\]created[[:space:]] | wc -l)
echo -n echo -n
echo -en "ftp_get.value " echo -en "ftp_get.value "
echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log | grep [[:space:]]\\[\\]sent[[:space:]] | wc -l) echo $(grep "`date '+%Y-%m-%d'`" /var/log/pure-ftpd/transfer.log | grep [[:space:]]\\[\\]sent[[:space:]] | wc -l)