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: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; 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>