2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/disk/log_sizes
2012-02-13 18:24:46 +01:00

30 lines
604 B
Bash
Executable file

#!/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