Current time: 12-23-2024, 05:29 PM Hello There, Guest! (LoginRegister)


Post Reply 
proftpd munin plugin install problem
Author Message
romantik Offline
Junior Member
*

Posts: 54
Joined: Mar 2009
Reputation: 0
Post: #1
Question proftpd munin plugin install problem
Hi all.

I'm installed 2 munin plugin:
proftpd_count
proftpd_bytes

My problem: munin doesn't count for anything. What can i need to change the configuration?
Code:
#!/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}"


proftpd_bytes:
Code:
#!/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}"


Thank you in advance!
(This post was last modified: 11-12-2010 12:17 PM by romantik.)
11-12-2010 12:15 PM
Find all posts by this user Quote this message in a reply
romantik Offline
Junior Member
*

Posts: 54
Joined: Mar 2009
Reputation: 0
Post: #2
RE: proftpd munin plugin install problem
topic up
11-15-2010 07:56 AM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #3
RE: proftpd munin plugin install problem
make sure, that you have an xferlog file written from proftpd.
But this is out of scope here - please read in the proftpd manual howto enable such.

normally it should be something like :
Quote:TransferLog /var/log/xferlog
Only for the sake of it - if you got a solution or a hint - feel free to post it here maybe someone else stumbles upon this.
But this is not directly connected to ispCP ...
(This post was last modified: 11-20-2010 09:47 AM by ephigenie.)
11-20-2010 09:45 AM
Visit this user's website Find all posts by this user Quote this message in a reply
romantik Offline
Junior Member
*

Posts: 54
Joined: Mar 2009
Reputation: 0
Post: #4
RE: proftpd munin plugin install problem
Yes, my xferlog path is /var/log/proftpd/xferlog, but it's not working...
11-25-2010 06:34 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)