MRTG-based Graphs in Trends Section
Hey everyone.
Love Hobbit! It's fast and configurable.
We are having trouble with the above. The problem deals with the Title Tag in the MRTG configuration file of the host. I have several routers which contain many interfaces being monitored. Unless we create a separate rrd configuration section for each interface, the title of the graph is the same.
Any way to have Hobbit read the Title Tag in the MRTG Configuration File and thus label the graphs accordingly?
Thanks everyone...
Alan
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
participants (2)
-
AFO8N@hscmail.mcc.virginia.edu
-
henrik@hswn.dk