[mrtg] Re: Setting up MRTG as a Windows Service

William Owen william.owen at profilesmail.com
Thu Jan 6 22:20:45 MET 2005


I have yet to look at the .bat file that you are using to run your service,
but if you run Win2k+, you might try using a .vbs file to kick off your
service.  If setup correctly, you can spawn a new perl instance for each
config file listed (or you can group them with an include: in a master
config as suggested).  For readability, I left the --logging stuff off.  I
actually use a modified version of this script from scheduled task that
creates a daily log file that can later be archived.

EX:

OPTION EXPLICIT

Dim oShell

Set oShell = Createobject("WScript.Shell")

oShell.run "perl C:\Path\to\mrtg C:\path\to\cfg1"
oShell.run "perl C:\path\to\mrtg C:\path\to\cfg2"



-----Original Message-----
From: Shier, Jon [mailto:JonS at mtrx.com] 
Sent: Thursday, January 06, 2005 3:05 PM
To: Westley Chang; mrtg at list.ee.ethz.ch
Cc: oetiker at ee.ethz.ch
Subject: [mrtg] Re: Setting up MRTG as a Windows Service

I have one file that call all for all my cfg files, In my batch file I
have

Perl c:\mrtg\bin\mrtg --logging=eventlog c:\mrtg\config\mrtg (I don't
have an extension on this file)

In the mrtg file I have

Workdir: c:\mrtgdata\
LogFormat: rrdtool
PathAdd: c:\rddtool\perl-shared
RunAsDaemon:Yes 
Interval: 5
Refresh: 300
WithPeak[_]: ymwd
Options[_]: growright, bits, unknaszero

Include: C:\mrtgdata\mrtg1.cfg
Include: C:\mrtgdata\mrtg2.cfg
Include: C:\mrtgdata\mrtg3.cfg
And so on.

That way you only have one perl.exe running on the system

Jon

-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch]
On Behalf Of Westley Chang
Sent: Thursday, January 06, 2005 12:58 PM
To: mrtg at list.ee.ethz.ch
Cc: oetiker at ee.ethz.ch
Subject: Spam Filter:[mrtg] Setting up MRTG as a Windows Service

Hello,
   I just got the new version of mrtg-2.11.1 installed.  Thanks Tobias!
 However I am having a bit of a problem with setting up MRTG as a
windows service.  
   Apparently I have MRTG running fine as a service with one entry in
the mrtg.bat file.  However, if you add more than one command line in
the mrtg.bat file (please see example below), the MRTG service will only
execute one at a time.  Therefore, if I have a mrtg.bat file as such:


perl c:\mrtg\bin\mrtg --logging=eventlog c:\mrtg\config\mrtg.cfg perl
c:\mrtg\bin\mrtg --logging=eventlog c:\mrtg\config\mrtg2.cfg perl
c:\mrtg\bin\mrtg --logging=eventlog c:\mrtg\config\mrtg3.cfg

The MRTG service will only invoke the first mrtg.cfg file.  HOWEVER, if
you stop the MRTG service and restart it again, it will execute the
second one.  And so on.  Is there any way the mrtg.bat file can execute
several .cfg files at once instead of starting and stopping a service. 
Please advise.  Thanks!


            Wes

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list