mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 18:07:20 +00:00
Category Tree: Reduce number of categories
power5 -> cpu directories for different ftp servers
This commit is contained in:
parent
68bb709de6
commit
c3e309c6a5
15 changed files with 9 additions and 9 deletions
25
plugins/proftpd/proftpd
Executable file
25
plugins/proftpd/proftpd
Executable file
|
@ -0,0 +1,25 @@
|
|||
#! /bin/sh
|
||||
# configuration :
|
||||
#
|
||||
# env.LOGFILE /var/log/proftpd/proftpd.log
|
||||
|
||||
if [ "$1" = 'config' ]; then
|
||||
echo "graph_args --base 1000 -l 0"
|
||||
echo "graph_title Serveur FTP"
|
||||
echo "graph_category ftp"
|
||||
echo "graph_vlabel Stats Proftpd"
|
||||
echo "succes.label Login succes"
|
||||
echo "succes.draw AREA"
|
||||
echo "failed.label Login failed"
|
||||
echo "failed.draw AREA"
|
||||
fi
|
||||
|
||||
LOGFILE=${LOGFILE:-"/var/log/proftpd/proftpd.log"}
|
||||
|
||||
succes=$(grep -c "successful" "$LOGFILE" )
|
||||
failed=$(grep -c "Login failed" "$LOGFILE" )
|
||||
|
||||
echo "succes.value $succes"
|
||||
echo "failed.value $failed"
|
||||
|
||||
exit 0
|
64
plugins/proftpd/proftpd_bytes
Executable file
64
plugins/proftpd/proftpd_bytes
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor FTP bytes.
|
||||
# based on previous work by jintxo
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional)
|
||||
#
|
||||
# Magic markers (optional - used by munin-config and installation
|
||||
# scripts):
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
MAXLABEL=20
|
||||
|
||||
mktempfile () {
|
||||
mktemp -t $1
|
||||
}
|
||||
|
||||
LOGFILE=${logfile:-/var/log/proftpd/xferlog}
|
||||
LOGTAIL=${logtail:-`which logtail`}
|
||||
STATEFILE=/var/lib/munin/plugin-state/xferlog-bytes.offset
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title FTP Server Bytes'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel FTP Server Bytes'
|
||||
echo 'graph_category ftp'
|
||||
echo 'ftp_get.label Bytes GET'
|
||||
echo 'ftp_put.label Bytes PUT'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
ftp_get=U
|
||||
ftp_put=U
|
||||
|
||||
TEMP_FILE=`mktempfile munin-xferlog-bytes.XXXXXX`
|
||||
|
||||
if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
|
||||
then
|
||||
$LOGTAIL ${LOGFILE} $STATEFILE | grep "[[:space:]][oi][[:space:]]" > ${TEMP_FILE}
|
||||
ftp_get=`grep "[[:space:]]o[[:space:]]" ${TEMP_FILE} | awk '{s += $8} END { if ( s ) print s ; else print "0" }'`
|
||||
ftp_put=`grep "[[:space:]]i[[:space:]]" ${TEMP_FILE} | awk '{s += $8} END { if ( s ) print s ; else print "0" }'`
|
||||
|
||||
/bin/rm -f $TEMP_FILE
|
||||
fi
|
||||
|
||||
echo "ftp_get.value ${ftp_get}"
|
||||
echo "ftp_put.value ${ftp_put}"
|
||||
|
64
plugins/proftpd/proftpd_count
Executable file
64
plugins/proftpd/proftpd_count
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor FTP files.
|
||||
# based on previous work by jintxo
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional)
|
||||
#
|
||||
# Magic markers (optional - used by munin-config and installation
|
||||
# scripts):
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
MAXLABEL=20
|
||||
|
||||
mktempfile () {
|
||||
mktemp -t $1
|
||||
}
|
||||
|
||||
LOGFILE=${logfile:-/var/log/proftpd/xferlog}
|
||||
LOGTAIL=${logtail:-`which logtail`}
|
||||
STATEFILE=/var/lib/munin/plugin-state/xferlog-count.offset
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title FTP Server Transfers'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel FTP Server Transfers'
|
||||
echo 'graph_category ftp'
|
||||
echo 'ftp_get.label Files GET'
|
||||
echo 'ftp_put.label Files PUT'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
ftp_get=U
|
||||
ftp_put=U
|
||||
|
||||
TEMP_FILE=`mktempfile munin-xferlog-count.XXXXXX`
|
||||
|
||||
if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
|
||||
then
|
||||
$LOGTAIL ${LOGFILE} $STATEFILE | grep "[[:space:]][oi][[:space:]]" > ${TEMP_FILE}
|
||||
ftp_get=`grep "[[:space:]]o[[:space:]]" ${TEMP_FILE} | wc -l`
|
||||
ftp_put=`grep "[[:space:]]i[[:space:]]" ${TEMP_FILE} | wc -l`
|
||||
|
||||
/bin/rm -f $TEMP_FILE
|
||||
fi
|
||||
|
||||
echo "ftp_get.value ${ftp_get}"
|
||||
echo "ftp_put.value ${ftp_put}"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue