#!/bin/bash
#
# trafmon-summary
#
# Create Top20 Summary; require that at least one host involved
# in the converstion is not local (excludes intranet<->comm traffic)
#
RECIPIENT=root

LOG=${1:-/var/log/trafmon}
shift

CONF=/etc/sysconfig/trafmon

test -f $CONF && . $CONF

if [ -z "$RECIPIENT" ]; then
        RECIPIENT=root
fi

# Give up on empty log file
test -s $LOG || exit 1

trafmon -l $LOG -ss -t 20 -S bytes-total \!10.0.0.0/8 $* |
	mailx -s "Daily Traffic Stats" $RECIPIENT
