| Cheshire Cat Computing http://www.steveshipway.org/forum/ |
|
| What program do you use to make it a service? http://www.steveshipway.org/forum/viewtopic.php?f=2&t=108 |
Page 1 of 1 |
| Author: | stevesh [ Wed Jan 07, 2004 4:53 pm ] |
| Post subject: | |
I'm running under UNIX, but the problem is similar. I have a script that runs every 5 mins, which checks for all .cfg files in all directories. It creates a separate special .cfg file for each directory, which has the Forks: command and Include:s all the others. Then it calls MRTG sequentially on these special master cfg files. The reason for doing this is to take advantage of the MRTG Forks:10 command to parallelise everything, but keep directories separate (since Include: can cause some problems with global definitions, and I don't want one mis-configured file to prevent everything from running). Also, it means I can add new .cfg files into the conf/test directory without having to change any of the main code. Of course this is not completely appropriate for Windows, but it is the same premise. Steve |
|
| Author: | BigDaddy [ Tue Jan 13, 2004 10:49 am ] |
| Post subject: | You could try this |
#create mrtg.cfg using a batch file #then call mrtg with the new cfg #then call this batch file ever min(or 5 mins) copy /Y e:\mrtgrrd\mrtg.cfg e:\mrtgrrd\mrtg.bak del e:\mrtgrrd\mrtg.cfg # use for to find all cfg files, (including subdirectories) for /r %%f in (*.cfg) do echo Include: %%f >>e:\mrtgrrd\mrtg.cfg # you could use something like this as well: for /r %%f in (a*.cfg) do echo Include: %%f >>e:\mrtgrrd\amrtg.cfg for /r %%f in (b*.cfg) do echo Include: %%f >>e:\mrtgrrd\bmrtg.cfg #then change the lines below where needed (or remove) # a few extra blank spaces #echo. >>e:\mrtgrrd\mrtg.cfg #echo. >>e:\mrtgrrd\mrtg.cfg #echo. >>e:\mrtgrrd\mrtg.cfg # I like putting my globals at the end. #echo WorkDir: e:/bb-web/data >>e:\mrtgrrd\mrtg.cfg #echo LogDir: /bb-web/data >>e:\mrtgrrd\mrtg.cfg #echo PathAdd: e:/bb-web/cgi >>e:\mrtgrrd\mrtg.cfg #echo Icondir: /mrtg/icons >>e:\mrtgrrd\mrtg.cfg #change this to meet your requirements... #echo Interval:1 >>e:\mrtgrrd\mrtg.cfg #echo Unscaled[_]: dwmy >>e:\mrtgrrd\mrtg.cfg #echo Refresh: 300 >>e:\mrtgrrd\mrtg.cfg #echo LogFormat: rrdtool >>e:\mrtgrrd\mrtg.cfg e:\perl\wperl.exe e:\mrtg\bin\mrtg e:\mrtgrrd\mrtg.cfg Hope this helps. |
|
| Author: | joerg123 [ Wed Jan 14, 2004 1:51 am ] |
| Post subject: | |
Hi steve, can you post your script? Or is it not Open Source Thanks Joerg |
|
| Author: | stevesh [ Wed Jan 14, 2004 9:33 am ] |
| Post subject: | |
Well, its not that my script is not open source, just that it is very tailored to our site and that it is rough and tatty code Really, if you have any coding knowledge, such a script would be easy to knock up (see the example posted above). If you dont have coding knowledge, then it is doubtful you'd be able to modify my local script to work on your system. |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|