#!/bin/sh

# $Log$
# Revision 1.4  2004/12/10 10:47:49  jimmyo
# Change name from ${scale} to ${graph_period}, to be more consistent.
#
# Revision 1.3  2004/12/09 22:12:56  jimmyo
# Added "graph_period" option, to make "graph_sums" usable.
#
# Revision 1.2  2004/11/21 00:17:12  jimmyo
# Changed a lot of plugins so they use DERIVE instead of COUNTER.
#
# Revision 1.1  2004/01/02 18:50:01  jimmyo
# Renamed occurrances of lrrd -> munin
#
# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
# Import of LRRD CVS tree after renaming to Munin
#
# Revision 1.4  2003/11/07 22:12:50  jimmyo
# Changed deprecated plugin options
#
# Revision 1.3  2003/11/07 17:43:16  jimmyo
# Cleanups and log entries
#

if [ "$1" = "config" ]; then
	echo "host_name $HOSTNAME"
	echo "graph_order down up" 
	echo "graph_title ADSL Traffic"
	echo 'graph_args --base 1000'
	echo 'graph_vlabel bits in (-) / out (+) per ${graph_period}'
	echo 'down.label received'
        echo 'down.type DERIVE'
        echo 'down.graph no'
        echo 'down.cdef down,8,*'
	echo "down.max $DOWNMAX"
	echo "down.min 0"
        echo 'up.label bps'
	echo 'up.type DERIVE'
	echo 'up.negative down'
	echo 'up.cdef up,8,*'
	echo "up.max $UPMAX"
	echo "up.min 0"
	exit 0
fi;

echo -n "down.value "
snmpget -Ov $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifInOctets.3 | sed 's/^.*: //'
echo -n "up.value "
snmpget -Ov $HOSTNAME $COMMUNITY interfaces.ifTable.ifEntry.ifOutOctets.3 | sed 's/^.*: //'
