On Thu, May 12, 2005 at 12:28:31PM -0400, Oktay, Alan F. *HS wrote:
Any way to have Hobbit read the Title Tag in the MRTG Configuration File and thus label the graphs accordingly?
Not directly, but the attached patch lets you have an external script decide what the title is.
I've tried it on my own MRTG setup and it appears to work fine. I used this script to generate the title from mrtg.cfg (note that you may have to change the permissions on mrtg.cfg to let the CGI user read it):
#!/bin/sh
HOSTNAME="$1"; shift GTYPE="$1"; shift LEGEND="$1"; shift
RRD="$1"; shift #echo "RRD=$RRD, rest is $*" >>/tmp/title.log
MRTGSET="echo $RRD | sed -e's/\.rrd$//'"
#echo "MRTGSET=$MRTGSET" >>/tmp/title.log
MRTGTITLE=grep -i "Title\[$MRTGSET\]:" /etc/mrtg.cfg | cut -d: -f2-
#echo "TITLE=$MRTGTITLE" >>/tmp/title.log
echo "$MRTGTITLE $LEGEND" exit 0
Regards, Henrik