Commit 21bb0b46 authored by Mac Newbold's avatar Mac Newbold

Prints out an IR file with the vlans that are currently on the switch.

parent c1a3ad69
#!/usr/local/bin/perl -w
#
# savevlans - Saves vlans from the switches into a .ir file, suitable for
# restoring with 'snmpit -f <file>'.
#
open(LIST,"snmpit -l |");
print "START vlan\n";
while(<LIST>) {
chop;
if (/(^ID)|(^--)/) { next; }
s/[\t ]+/ /g;
/(\d+)\s+(\S+)\s+(.*)/;
if ($2 ne "System") {
(my $name, my @IDs) = ($2,split(" ",$3));
print "$name @IDs\n";
}
}
print "END vlan\n";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment