#!/bin/sh

#H=`echo $0 | awk -F_ '{print $2}'`

#LOGFILES=`ls /var/log/messages /var/log/syslog /var/log/daemon.log /myapplication/logs/*.log`
LOGFILES="/var/log/messages /var/log/syslog /var/log/daemon.log"

if [ "$1" = "config" ] ; then

	echo "graph_title log sizes"
	echo "graph_category disk"
	echo "graph_info this graph shows sizes of log files"
	echo "graph_vlabel size (bytes)"

	for F in $LOGFILES
	do
		MF=`echo $F | sed 's/[-\/\.]/_/g'`
		echo "$MF.label $F"
	done

else

	for F in $LOGFILES
	do
		MF=`echo $F | sed 's/[-\/\.]/_/g'`
		echo -n "$MF.value "
		stat --printf="%s\n" $F
	done

fi
