<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Bericht</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>I run a cron job that runs the following
script.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>[root@mrtg ~]# cat mrtg_run<BR>#!
/bin/bash</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>for fn in /etc/mrtg/*.cfg;
do<BR> env LANG=C /usr/bin/mrtg "$fn"
&<BR>done</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>[root@mrtg ~]# </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>Job runs ever 5 minutes and maintenance only needs to
be done to the config files in the /etc/mrtg directory. if you don't want a
config to be processes change the file type to something other than
.cfg.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007>Hope this is what you were looking
for.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=662150214-23082007></SPAN></FONT> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mrtg-bounces@lists.oetiker.ch
[mailto:mrtg-bounces@lists.oetiker.ch] <B>On Behalf Of </B>Koelstra, J.
(Jan)<BR><B>Sent:</B> Thursday, August 23, 2007 3:21 AM<BR><B>To:</B> Brad
Lodgen; mrtg@lists.oetiker.ch<BR><B>Subject:</B> Re: [mrtg] MRTG Daemon at
Startup with hundreds of configs<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff size=2>What about a few
'master config' files only containing some basic setup and 'include: ..'
statements to all your existing config files? </FONT></SPAN></DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff
size=2>In this way you only need to start your master config
files.</FONT></SPAN></DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff
size=2>HTH,</FONT></SPAN></DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=657031308-23082007><FONT color=#0000ff
size=2>Jan.</FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=nl dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
mrtg-bounces@lists.oetiker.ch [mailto:mrtg-bounces@lists.oetiker.ch] <B>On
Behalf Of </B>Brad Lodgen<BR><B>Sent:</B> Wednesday, August 22, 2007 11:56
PM<BR><B>To:</B> mrtg@lists.oetiker.ch<BR><B>Subject:</B> [mrtg] MRTG Daemon
at Startup with hundreds of configs<BR><BR></FONT></DIV>Hi there,<BR><BR>I'm
looking at a project to switch a server that is using MRTG to monitor hundreds
of devices over to running MRTG in daemon mode, for efficiency. As one could
infer, there are hundreds of config files to go along with those hundreds of
devices. Since MRTG has to be started once for each config, I'm trying to
develop a Linux startup script that will execute all of the configs. I will
copy/paste the startup script I'm currently working with. Does anyone have any
idea how to change this to make it start up all of the configs? It may be an
easy answer, but I'm very fresh on shell scripting and have spent hours
searching for this info, to no avail. Please help! <BR><BR>Thanks in advance
for any advice or help you may provide...here is the startup script I
found....<BR><BR><BR><PRE class=alt2 dir=ltr style="BORDER-RIGHT: 1px inset; PADDING-RIGHT: 6px; BORDER-TOP: 1px inset; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; MARGIN: 0px; OVERFLOW: auto; BORDER-LEFT: 1px inset; WIDTH: 640px; PADDING-TOP: 6px; BORDER-BOTTOM: 1px inset; HEIGHT: 498px; TEXT-ALIGN: left">#!/bin/bash<BR>#<BR># mrtg This shell script starts mrtg<BR>#<BR># Author: Stefan SF <BR>#<BR># chkconfig: 345 90 35<BR>#<BR># description: mrtg The Multi Router Traffic Grapher<BR># processname: mrtg<BR>
# config: /etc/mrtg/mrtg.conf<BR>#<BR>### BEGIN INIT INFO<BR># Provides: mrtg<BR># Required-Start: $network<BR># Default-Stop: 0 1 6<BR># Short-Description: Starts the The Multi Router Traffic Grapher<BR># Description: The Multi Router Traffic Grapher (MRTG) is a tool to monitor \
<BR># the traffic load on network-links. MRTG generates HTML pages \<BR># containing GIF/PNG images which provide a live visual \<BR># representation of this traffic.<BR>### END INIT INFO
<BR><BR># source function library<BR>. /etc/rc.d/init.d/functions<BR><BR>MRTG="/usr/bin/mrtg"<BR>CONFIG="/etc/mrtg/mrtg.cfg"<BR>PIDFILE="/var/run/mrtg.pid"<BR>LOCKFILE="/var/lock/mrtg/mrtg"
<BR>OPTIONS="--daemon"<BR><BR>RETVAL=0<BR><BR>start() {<BR>        echo -n $"Enabling MRTG: "<BR>        rm -f ${LOCKFILE} 2> /dev/null<BR>        env LANG=C ${MRTG} --pid-file=${PIDFILE} --lock-file=${LOCKFILE} ${OPTIONS} ${CONFIG}
<BR>        RETVAL=$?<BR>        echo<BR>}<BR><BR>stop() {<BR>        echo -n $"Disabling MRTG: "<BR>        kill `cat ${PIDFILE}` && rm -f ${LOCKFILE}<BR>        RETVAL=$?<BR>        echo<BR>}<BR><BR>restart() {<BR>        stop<BR>        start<BR>}<BR><BR>case "$1" in
<BR> start)<BR>        start<BR>        ;<BR> stop) <BR>        stop<BR>        ;<BR> restart|force-reload)<BR>        restart<BR>        ;<BR> status)<BR>        if [ -f $LOCKFILE ]; then<BR>                echo $"MRTG is enabled."<BR>                RETVAL=0<BR>        else<BR>                echo $"MRTG is disabled."
<BR>                RETVAL=3<BR>        fi<BR>        ;<BR> *)<BR>        echo $"Usage: $0 {start|stop|status|restart|force-reload}"<BR>        exit 1<BR>esac<BR><BR>exit $RETVAL</PRE><BR></BLOCKQUOTE>
<TABLE>
<TBODY>
<TR>
<TD bgColor=#ffffff><FONT
color=#000000>_________________________________________________________<BR><BR>Dit
bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet
de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden,
wordt u verzocht dat aan de afzender te melden en het bericht te
verwijderen. De staat aanvaardt geen aansprakelijkheid voor schade, van
welke aard ook, die verband houdt met risico's verbonden aan het
elektronisch verzenden van
berichten.<BR>_________________________________________________________<BR><BR>This
message may contain information that is not intended for you. If you are
not the addressee or if this message was sent to you by mistake, you are
requested to inform the sender and delete the message. The state accepts
no liability for damage of any kind resulting from the risks inherent in
the electronic transmission of
messages.<BR>_________________________________________________________<BR></FONT></TD></TR></TBODY></TABLE><p></p><p>CONFIDENTIAL NOTICE:<br>This e-mail message and any attachment(s) (collectively, this 'Email') are intended <br>only for the confidential use of the recipient(s) named above. If the reader of this <br>message is not the intended recipient named above or an agent responsible for <br>delivering it to the intended recipient named above, you have received this Email in error. <br>Please notify the sender immediately and permanently delete this Email and any copies thereof.</BODY></HTML>