Commit 11b554a2 authored by Binh Nguyen's avatar Binh Nguyen

Merge branch 'master' of gitlab.flux.utah.edu:binh/sripv6-linux

parents c6271070 c92a8184
......@@ -4,17 +4,23 @@
echo "#!/bin/bash" > net_info.sh
SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "
GET_INTERFACES_HELPER="$HOME/get_interface_map.pl"
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
echo "Get info of node $hn ..."
./get_info.sh >> net_info.sh
for i in 0 2 3 4 5 6
for i in 2 3 4
do
echo "Get info of node $i ..."
scp get_info.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "./get_info.sh" >> net_info.sh
scp ${GET_INTERFACES_HELPER} node${i}.$domain:~/ > /dev/null
ssh ${SSH_ARGS} node$i.$domain "./get_info.sh" >> net_info.sh
done
echo "DONE. See net_info.sh"
#!/bin/bash
LB_IP=197
INF="/proj/PhantomNet/binh/simeca_scripts/get_interface_map.pl"
INF="$HOME/get_interface_map.pl"
#NODE0
hn=$(hostname | awk -F'.' '{print $1}')
......
#!/usr/bin/perl -w
BEGIN {
require "/etc/emulab/paths.pm";
import emulabpaths;
}
use libsetup;
my $FINDIF = "$BINDIR/findif";
# lans that this node is a member of.
#
my %ifmap = ();
my @ifconfigs = ();
if (getifconfig(\@ifconfigs) != 0) {
warn "Could not fetch Emulab interfaces configuration!";
return undef;
}
foreach my $ifconfig (@ifconfigs) {
my $ip = $ifconfig->{IPADDR};
my $mac = $ifconfig->{MAC};
my $lan = $ifconfig->{LAN};
next unless $mac && $lan;
#print "Debug: checking interface: $mac/$ip/$lan\n"
my $iface = `$FINDIF -m $mac`;
chomp $iface;
if ($? != 0 || !$iface) {
warn "Emulab's findif tool failed for ip address: $ip\n";
next;
}
print "$lan -> $iface -> $ip -> $mac\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