| 1 |
#!/bin/perl |
| 2 |
# |
| 3 |
# |
| 4 |
|
| 5 |
my ($filelist,$file,$result); |
| 6 |
my @f_list; |
| 7 |
|
| 8 |
# Change the path to the folder where you store the mrtg .cfg files |
| 9 |
$deleted=`del /F /Q c:\\mrtg\\conf\\*_l`; # this is to remove the _l files before running Mrtg |
| 10 |
$filelist=`dir /B c:\\mrtg\\conf\\*.cfg`; # Get the list of the cfg files |
| 11 |
@f_list=split(/\n/,$filelist); |
| 12 |
|
| 13 |
foreach $file (@f_list){ |
| 14 |
if($file||($file ne "File not Found")||($file=~/\.cfg$/)){ |
| 15 |
$result=`perl.exe e:\\mrtg\\bin\\mrtg e:\\mrtg\\conf\\$file`; # Run Mrtg for each host with a cfg file. |
| 16 |
} |
| 17 |
} |