Rev 5 | Rev 69 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#! /usr/bin/env perl
# just a simple script for people more familiar with
# perl syntax than YAML. Modify %config below, then run
# this script. It will create the configuration file for
# you.
use strict;
use warnings;
use YAML::Tiny; # apt-get libyaml-tiny-perl under debian
use File::Spec; # find location of script so we can put storage in same directory
use File::Basename;
my %config = (
# one or more switches and their corresponding
# community name. Use v1 snmp only
'switches' => {
'DNS or IP' => { # enter a DNS name or an IP address to be scanned.
'community' => 'snmp community name',
# the following list can be used to ignore ports on this switch. Note that these are the port numbers
# returned by OID iso.3.6.1.2.1.2.2.1.8
'portsToIgnore' => [port,numbers,to,ignore]
},
'DNS or IP' => {
'community' => 'snmp community name',
'portsToIgnore' => [port,numbers,to,ignore]
}
},
# You must include at least one router.
# this will be queried to resolve IP's to MAC
# using its arp table
# put IP and community name into the hash
'routers' => {
'DNS or IP' => {
'community' => 'snmp community name',
},
'DNS or IP' => {
'community' => 'snmp community name',
}
}
);
my $scriptDir = dirname( File::Spec->rel2abs( __FILE__ ) );
my $CONFIGFILE = $scriptDir . '/mapSwitches.config.yaml';
my $yaml = YAML::Tiny->new( \%config );
$yaml->write( $CONFIGFILE );