| 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: ovsho,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 $rundir = "/opt/mrtg/run"; |
| 19 |
my $dnsfile = "ovmrtgc.csv"; |
| 20 |
|
| 21 |
my($line,@sysnms); |
| 22 |
|
| 23 |
sub main { |
| 24 |
|
| 25 |
chdir $rundir; |
| 26 |
|
| 27 |
open (DNSFILE,"<".$dnsfile); |
| 28 |
while(<DNSFILE>){ |
| 29 |
chomp; |
| 30 |
$line = $_; |
| 31 |
$sysnms[@sysnms]= (split /\,/,$line)[2]; |
| 32 |
} |
| 33 |
close (DNSFILE); |
| 34 |
`ovtgts $ENV{OVwSessionID} @sysnms`; |
| 35 |
|
| 36 |
} |
| 37 |
main; |
| 38 |
exit(0); |
| 39 |
|