[mrtg] Re: multiple configs

David Gabler dgabler at americomusa.net
Wed Oct 13 17:31:00 MEST 1999


try this perl script
Command to run is "/usr/local/mrtg-bin/mrtg-all /home/httpd/stats/configs >
/dev/null 2 >&1"


#!/usr/bin/perl

$mrtgBIN = "/usr/local/mrtg-bin/mrtg";
while (@ARGV) {
  $StartDir = shift (@ARGV);

  if (not (-e $StartDir)) {
    print "$StartDir does not exist.\n";
    exit;
  }

  $Command = "/usr/bin/find $StartDir -name \"*.mrtg.cfg\"";
  open(FILES,"$Command |");
  while ($File = <FILES>) {
    chop($File);
    system("$mrtgBIN $File");
  }
} 

----------
David Gabler                  Production Systems Supervisor
Americom USA       Phone 805.545.5078

----------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.oetiker.ch/pipermail/mrtg/attachments/19991013/bb9afcc8/attachment.html 


More information about the mrtg mailing list