Cheshire Cat Computing

Software support and information
It is currently Sun Dec 07, 2025 7:13 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject:
PostPosted: Wed Jan 07, 2004 4:53 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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


Top
 Profile Send private message  
 
 Post subject: You could try this
PostPosted: Tue Jan 13, 2004 10:49 am 
Offline
Silver User

Joined: Sat Nov 08, 2003 11:04 am
Posts: 23
Location: Chicago IL.
#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.


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Jan 14, 2004 1:51 am 
Offline
User

Joined: Thu Dec 11, 2003 9:38 pm
Posts: 2
Hi steve,

can you post your script? Or is it not Open Source :lol: ?

Thanks
Joerg


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Jan 14, 2004 9:33 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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 :D

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.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group