| 1 |
#!/usr/local/bin/perl5 |
| 2 |
# -*- mode: Perl -*- |
| 3 |
################################################################## |
| 4 |
# Config file creator |
| 5 |
################################################################## |
| 6 |
# Created by Laurie Gellatly <[email protected]> |
| 7 |
# based on mrtg cfgmaker by Tobias Oetiker <[email protected]> |
| 8 |
# this produces a config file for one router, by pulling info |
| 9 |
# off the router via snmp and then writing files ready for |
| 10 |
# snmpCollect to use (via xnmcollect) and later ovcvtfile calls |
| 11 |
################################################################# |
| 12 |
# |
| 13 |
# Distributed under the GNU copyleft |
| 14 |
# |
| 15 |
# $Id: ovcols,v 1.1.1.1 2002/02/26 10:16:36 oetiker Exp $ |
| 16 |
# |
| 17 |
use Socket; |
| 18 |
use strict; |
| 19 |
use vars '$DEBUG'; |
| 20 |
use ovmrtg; |
| 21 |
my $DEBUG = 0; |
| 22 |
my($op,$router,@res); |
| 23 |
|
| 24 |
sub main { |
| 25 |
$op = $ARGV[0]; |
| 26 |
$router = $ARGV[1]; |
| 27 |
die <<USAGE unless ($router && (($op eq "+") || ($op eq "-"))); |
| 28 |
|
| 29 |
USAGE: ovcols +/- 'router IP ADDRESS/S' |
| 30 |
|
| 31 |
EXAMPLE: ovcols + 193.21.1.2 |
| 32 |
|
| 33 |
USAGE |
| 34 |
@res=ovcols(@ARGV); |
| 35 |
for($op=0;$op<@res;++$op){ |
| 36 |
print $res[$op]."\n"; |
| 37 |
} |
| 38 |
} |
| 39 |
main; |
| 40 |
exit(0); |
| 41 |
|