| 1 |
#!/usr/local/bin/perl5 |
| 2 |
# -*- mode: Perl -*- |
| 3 |
################################################################## |
| 4 |
# This file controls the creation of all the MRTG config files from OV |
| 5 |
################################################################## |
| 6 |
# Created by Laurie Gellatly <[email protected]> |
| 7 |
# See newrtrov.txt for a description of what is performed |
| 8 |
################################################################# |
| 9 |
# |
| 10 |
# Distributed under the GNU copyleft |
| 11 |
# |
| 12 |
# $Id: ovtst,v 1.1.1.1 2002/02/26 10:16:36 oetiker Exp $ |
| 13 |
# |
| 14 |
use Socket; |
| 15 |
use strict; |
| 16 |
use vars '$DEBUG'; |
| 17 |
my $DEBUG = 0; |
| 18 |
my $webdir = "/var/opt/ns-fasttrack/docs/mrtg/"; |
| 19 |
my $rundir = "/opt/mrtg/run"; |
| 20 |
my $testout = "test.out"; |
| 21 |
my $roothtml = "routers.html"; |
| 22 |
|
| 23 |
my($router,$sysn,$sysncfg,$sysnhtml,$cnt,@sysipnms,@mrtgc,@sysnms); |
| 24 |
|
| 25 |
sub main { |
| 26 |
|
| 27 |
chdir $rundir; |
| 28 |
@sysnms=%ENV; |
| 29 |
chomp(@sysipnms); |
| 30 |
open (MRTGC,">".$testout); |
| 31 |
for ($cnt = 0; $cnt < @sysnms ; $cnt++){ |
| 32 |
print MRTGC "$sysnms[$cnt]\n"; |
| 33 |
} |
| 34 |
close (MRTGC); |
| 35 |
} |
| 36 |
main; |
| 37 |
exit(0); |
| 38 |
|