Commit c1b406ae authored by Robert Ricci's avatar Robert Ricci

Beefed up the comments in the '#defines' section at the top of the file,

so that others editing it will have an easier time of it.
parent 17b85f13
......@@ -2,7 +2,7 @@
use strict;
# macgrabber.pl, a new script to harvest MAC address (as printed out by Mike's
# 'showmac' kernel) from cature logs. It prints out SQL commands to insert the
# 'whoami' kernel) from cature logs. It prints out SQL commands to insert the
# addresses to stdout. Change the values in the '#defines' section below
# depeding on the nodes you're harvesting info for.
......@@ -12,27 +12,47 @@ if (@ARGV != 3) {
my ($startNode, $endNode, $startFile) = @ARGV;
#
# '#defines' - Change depeding on the machines you're harvesting MACs for
#
# Number of cards (incl. control net) in each node.
my $numCards = 5;
# Interface type (from the interface_types) table of the cards
my $interfaceType = "fxp";
my $iface = "eth";
my $port = 1;
my $IPalias = "NULL";
my $currentSpeed = 100;
my $duplex = "full";
# Which of the interfaces (as printed by showmac) is the control net
# Which of the interfaces (as printed by whoami) is the control net
my $controlInterface = 0;
# Subnet for the control net
my $subnet = "155.101.132.";
# Where the last octet of the nodes' IP addresses will start. For example,
# if pc1 is 155.101.132.1, this should be 1. If pc1 is 155.101.143.131, this
# should be 131.
my $base = 1;
# Mapping of interface numbers, as printed by the showmac kernel, to
# Mapping of interface numbers, as printed by the whoami kernel, to
# cannonical database order. For example, on Utah's pc850's, what
# showmac reports as eth0 is saved as eth2 in the database (since this
# is its name under Linux 2.4.x
my %cardmap = ( 0 => 2, 1 => 3, 2 => 4, 3 => 0, 4 => 1);
# is its name under Linux 2.4.x . In general, the best way to get this
# mapping is to boot both the whoami kernel and a Linux kernel, and
# compare the ordering. There should be as many entries in this list
# as recorded in $numCards above.
my %cardmap = ( 0 => 2,
1 => 3,
2 => 4,
3 => 0,
4 => 1 );
# You can leave the following alone, unless you're sure you need to change them
my $iface = "eth";
my $port = 1;
my $IPalias = "NULL";
my $currentSpeed = 100;
my $duplex = "full";
# end of '#defines'
$startNode =~ /^(\D+)(\d+)$/;
......@@ -66,7 +86,7 @@ for (my $i = $startNum; $i <= $endNum; $i++) {
for (my $j = 0; $j < @MACs; $j++) {
my $IP;
if ($j == $controlInterface) {
$IP = $subnet . $i;
$IP = $subnet . ($base + $i -1);
} else {
$IP = "";
}
......
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