1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

- have some dirs

This commit is contained in:
Steve Schnepp 2012-02-13 18:24:46 +01:00
parent 0b089ea777
commit 08346aac58
687 changed files with 0 additions and 0 deletions

23
plugins/ftp/proftpd Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/perl
#
# By InboX
# Site: www.wolfy.fr
#
if ($ARGV[0] and $ARGV[0] eq "config")
{
print "graph_args --base 1000 -l 0\n";
print "graph_title Serveur FTP\n";
print "graph_category Ftp\n";
print "graph_vlabel Stats Proftpd\n";
print "succes.label Login succes\n";
print "succes.draw AREA\n";
print "failed.label Login failed\n";
print "failed.draw AREA\n";
exit 0;
}
$succes = `cat /var/log/proftpd/proftpd.log | grep -c "successful"`;
$failed = `cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`;
print "succes.value $succes";
print "failed.value $failed";

64
plugins/ftp/proftpd_bytes Executable file
View 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/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/ftp/proftpd_count Executable file
View 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/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}"

77
plugins/ftp/pure-ftpd Executable file
View file

@ -0,0 +1,77 @@
#!/bin/sh
#
# Plugin to monitor pure-ftpd status
#
# (c) Julien Danjou <julien@danjou.info>
#
# GPLv2 licensed
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Config variables:
#
# spooldir - Override what exim says
# exim - Where's exim?
# queuewarn - When to warn
# queuecrit - When to crit
#
# Configuration:
# Maybe need to add folowing lines to plugins config file
# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho
# as user with apropirate privilegs then restart munin-node.
#
# [pure-ftpd]
# user root
#
# 2008/02/01 - TMS
# - Little Configuration documentation
# - Added monitoring IDLE connections
#
# 2007/05/07 - jd
# First release
#
# Magic markers (optional - used by installation scripts and
# munin-config):
#
#%# family=contrib
#%# capabilities=autoconf
PW=`which pure-ftpwho 2>/dev/null`
GRAPHTITLE='FTP connections'
test -n "$pw" && PW=$pw
test -n "$graphtitle" && GRAPHTITLE=$graphtitle
if [ "$1" = "autoconf" ]; then
if test -x $PW; then
echo yes
exit 0
else
echo "no (pure-ftpwho not found)"
exit 0
fi
fi
if [ "$1" = "config" ]; then
echo "graph_title $GRAPHTITLE"
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel connections'
echo 'graph_category ftp'
echo 'upload.label Upload'
echo 'download.label Download'
echo 'idle.label Idle'
echo 'upload.draw AREA'
echo 'download.draw STACK'
echo 'idle.draw STACK'
exit 0
fi
printf "download.value "
$PW -n -s | grep -c ' DL '
printf "upload.value "
$PW -n -s | grep -c ' UL '
printf "idle.value "
$PW -n -s | grep -c 'IDLE'

47
plugins/ftp/pureftpd_count Executable file
View file

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

58
plugins/ftp/vsftpd Executable file
View file

@ -0,0 +1,58 @@
LOGFILE=/var/log/vsftpd.log
if [ "$1" = "autoconf" ]; then
if [ -f "${LOGFILE}" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title FTP Server'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Requests'
echo 'graph_category FTP'
echo 'ftp_c.label connections'
echo 'ftp_sl.label successful_logins'
echo 'ftp_fl.label failed_logins'
echo 'ftp_su.label successful_uploads'
echo 'ftp_fu.label failed_uploads'
echo 'ftp_sd.label successful_downloads'
echo 'ftp_fd.label failed_downloads'
echo 'ftp_sde.label successful_deletes'
echo 'ftp_fde.label failed_deletes'
exit 0
fi
ftp_c=U
ftp_sl=U
ftp_fl=U
ftp_su=U
ftp_fu=U
ftp_sd=U
ftp_fd=U
ftp_sde=U
ftp_fde=U
ftp_c=`grep "CONNECT" ${LOGFILE} | wc -l`
ftp_sl=`grep "OK LOGIN" ${LOGFILE} | wc -l`
ftp_fl=`grep "FAIL LOGIN" ${LOGFILE} | wc -l`
ftp_su=`grep "OK UPLOAD" ${LOGFILE} | wc -l`
ftp_fu=`grep "FAIL UPLOAD" ${LOGFILE} | wc -l`
ftp_sd=`grep "OK DOWNLOAD" ${LOGFILE} |wc -l`
ftp_fd=`grep "FAIL DOWNLOAD" ${LOGFILE} | wc -l`
ftp_sde=`grep "OK DELETE" ${LOGFILE} |wc -l`
ftp_fde=`grep "FAIL DELETE" ${LOGFILE} | wc -l`
echo "ftp_c.value ${ftp_c}"
echo "ftp_sl.value ${ftp_sl}"
echo "ftp_fl.value ${ftp_fl}"
echo "ftp_su.value ${ftp_su}"
echo "ftp_fu.value ${ftp_fu}"
echo "ftp_sd.value ${ftp_sd}"
echo "ftp_fd.value ${ftp_fd}"
echo "ftp_sde.value ${ftp_sde}"
echo "ftp_fde.value ${ftp_fde}"

112
plugins/ftp/vsftpd-rel Executable file
View file

@ -0,0 +1,112 @@
#! /bin/bash
# Copyright (C) 2008 Joey Schulze <joey@infodrom.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
# Source: http://www.infodrom.org/Infodrom/tools/munin.html
# Supported configuration:
#
# [vsftpd-rel]
# user root
# env.logfile /var/log/vsftpd.log
# env.logtail /usr/bin/logtail
PROGNAME=vsftpd
STATEDIR=/var/lib/munin/plugin-state
LOGFILE=${logfile:-/var/log/vsftpd.log}
LOGTAIL=${logtail:-`which logtail`}
OFFSET=${STATEDIR}/${PROGNAME}.offset
STATE=${STATEDIR}/${PROGNAME}.state
PIVOT=${STATEDIR}/${PROGNAME}.pivot
install_ok()
{
tempfile=$(which tempfile)
if [ ! -r ${LOGFILE} -o \
-z "${LOGTAIL}" -o ! -x "${LOGTAIL}" -o \
-z "${tempfile}" -o ! -x "${tempfile}" ]
then
return 1
fi
return 0
}
if [ "$1" = "autoconf" ]
then
tmpfile=`which tempfile`
if install_ok
then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]
then
echo 'system.type ABSOLUTE'
echo 'graph_title Very Secure FTP Server'
echo 'graph_vlabel Requests'
echo 'graph_category FTP'
echo 'ftp_conn.label connections'
echo 'ftp_loginok.label successful logins'
echo 'ftp_loginfail.label failed logins'
echo 'ftp_uploadok.label successful uploads'
echo 'ftp_uploadfail.label failed uploads'
echo 'ftp_downloadok.label successful downloads'
echo 'ftp_downloadfail.label failed downloads'
echo 'ftp_deleteok.label successful deletes'
echo 'ftp_deletefail.label failed deletes'
exit 0
fi
test install_ok || exit 1
touch -d now-5minutes+30seconds $PIVOT
TEMP=`tempfile`
trap "rm -f ${PIVOT} ${TEMP}" INT EXIT
test -n "$TEMP" -a -w "$TEMP" || exit 1
if [ ! -s ${OFFSET} ]
then
$LOGTAIL ${LOGFILE} ${OFFSET} > ${TEMP}
exit 0
fi
if [ $STATE -ot $PIVOT ]
then
$LOGTAIL ${LOGFILE} ${OFFSET} > ${TEMP}
echo -n > ${STATE}
echo "ftp_conn.value $(grep 'CONNECT' ${TEMP} | wc -l)" >> $STATE
echo "ftp_loginok.value $(grep 'OK LOGIN' ${TEMP} | wc -l)" >> $STATE
echo "ftp_loginfail.value $(grep 'FAIL LOGIN' ${TEMP} | wc -l)" >> $STATE
echo "ftp_uploadok.value $(grep 'OK UPLOAD' ${TEMP} | wc -l)" >> $STATE
echo "ftp_uploadfail.value $(grep 'FAIL UPLOAD' ${TEMP} | wc -l)" >> $STATE
echo "ftp_downloadok.value $(grep 'OK DOWNLOAD' ${TEMP} | wc -l)" >> $STATE
echo "ftp_downloadfail.value $(grep 'FAIL DOWNLOAD' ${TEMP} | wc -l)" >> $STATE
echo "ftp_deleteok.value $(grep 'OK DELETE' ${TEMP} | wc -l)" >> $STATE
echo "ftp_deletefail.value $(grep 'FAIL DELETE' ${TEMP} | wc -l)" >> $STATE
fi
cat $STATE