Commit ffe16b88 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Minor change to ssh and port printout; jailed nodes, non-jailed nodes,

jailed nodes with their own IP ...
parent 47b27f22
...@@ -137,20 +137,26 @@ if (($state eq EXPTSTATE_ACTIVE) || ...@@ -137,20 +137,26 @@ if (($state eq EXPTSTATE_ACTIVE) ||
($state eq EXPTSTATE_TESTING)) { ($state eq EXPTSTATE_TESTING)) {
my $query_result = my $query_result =
DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,". DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,".
" n.sshdport from reserved as r ". " n.sshdport,n.jailflag,nt.isremotenode ".
" from reserved as r ".
"left join nodes as n on r.node_id=n.node_id ". "left join nodes as n on r.node_id=n.node_id ".
"left join os_info as o on o.osid=n.def_boot_osid ". "left join os_info as o on o.osid=n.def_boot_osid ".
" where r.pid='$pid' and r.eid='$eid'"); "left join node_types as nt on nt.type=n.type ".
"where r.pid='$pid' and r.eid='$eid'");
while (($v,$p,$t,$m,$o,$s) = $query_result->fetchrow_array()) { while (($v,$p,$t,$m,$o,$s,$j,$r) = $query_result->fetchrow_array()) {
if (!$v) { if (!$v) {
$v = $p; $v = $p;
} }
$v2pmap{$v} = $p; $v2pmap{$v} = {
$p2type{$p} = $t; PNODE => $p,
$p2osid{$p} = $o; TYPE => $t,
$vv2pmap{$p} = $m; OSID => $o,
$sshdport{$p}= $s; VVP => $m,
SSHDPORT => $s,
JAILED => $j,
ISREMOTE => $r,
};
} }
} }
...@@ -208,10 +214,10 @@ if ($showmap && ...@@ -208,10 +214,10 @@ if ($showmap &&
print "--------------- ------------ --------------- ------------\n"; print "--------------- ------------ --------------- ------------\n";
foreach $v (keys(%v2pmap)) { foreach $v (keys(%v2pmap)) {
$p = $v2pmap{$v}; my $p = $v2pmap{$v}->{PNODE};
$t = $p2type{$p}; my $t = $v2pmap{$v}->{TYPE};
$o = $p2osid{$p}; my $o = $v2pmap{$v}->{OSID};
$m = $vv2pmap{$p}; my $m = $v2pmap{$v}->{VVP};
printf "%-15s %-12s %-15s %s", $v, $t, $o, $p; printf "%-15s %-12s %-15s %s", $v, $t, $o, $p;
if ($m ne $p) { if ($m ne $p) {
printf " ($m)"; printf " ($m)";
...@@ -236,11 +242,11 @@ if ($showmap && ...@@ -236,11 +242,11 @@ if ($showmap &&
printf "%-15s %-10s %-20s\n", "ID", "Port", "SSH command"; printf "%-15s %-10s %-20s\n", "ID", "Port", "SSH command";
print "--------------- ---------- ----------------------\n"; print "--------------- ---------- ----------------------\n";
foreach $v (keys(%v2pmap)) { foreach $v (keys(%v2pmap)) {
my $p = $v2pmap{$v}; my $p = $v2pmap{$v}->{PNODE};
my $s = $sshdport{$p}; my $s = $v2pmap{$v}->{SSHDPORT};
my $m = $vv2pmap{$p}; my $m = $v2pmap{$v}->{VVP};
my $q = "$v.$eid.$pid.$DOMAIN"; my $q = "$v.$eid.$pid.$DOMAIN";
if ($m ne $p) { if ($v2pmap{$v}->{JAILED} && $v2pmap{$v}->{ISREMOTE}) {
printf "%-15s %-10s %-20s", $v, $s, "ssh -p $s $q"; printf "%-15s %-10s %-20s", $v, $s, "ssh -p $s $q";
print "\n"; print "\n";
} }
...@@ -332,7 +338,7 @@ if ($showlinks) { ...@@ -332,7 +338,7 @@ if ($showlinks) {
while (($vname,$member,$delay,$bandwidth,$lossrate) while (($vname,$member,$delay,$bandwidth,$lossrate)
= $result->fetchrow_array()) { = $result->fetchrow_array()) {
$member =~ /(.+):(\d+)/; $member =~ /(.+):(\d+)/;
my ($pname,$card) = ($v2pmap{$1},$2); my ($pname,$card) = ($v2pmap{$1}->{PNODE}, $2);
# #
# Check to see if the 'physical' node name is just a # Check to see if the 'physical' node name is just a
......
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