Commit 85bc6655 authored by Robert Ricci's avatar Robert Ricci

Show the new widearea_nodeinfo.{hostname,site} columns on the web

and in reports.
parent cd239a75
......@@ -56,6 +56,8 @@ my %v2pmap;
my %p2type;
my %p2osid;
my %vv2pmap;
my $hasremote = 0;
my $hasplab = 0;
getopts('hnmdlevbr',\%opt);
......@@ -157,6 +159,12 @@ if (($state eq EXPTSTATE_ACTIVE) ||
ISREMOTE => $r,
PLAB => $d,
};
if ($r) {
$hasremote = 1;
}
if ($d) {
$hasplab = 1;
}
}
}
......@@ -226,6 +234,28 @@ if ($showmap &&
}
print "\n";
if ($hasremote || $hasplab) {
my $widearea_info_result =
DBQueryFatal("select vname, hostname from reserved as r left join ".
"nodes as n on r.node_id=n.node_id left join " .
"widearea_nodeinfo as w on w.node_id=n.phys_nodeid " .
"where pid='$pid' and eid='$eid'");
print "Wide-Area Node Hostnames:\n";
printf "%-15s %-15s %-45s \n", "ID", "Physical", "Hostname";
print "--------------- --------------- --------------------\n";
while (($vname,$hostname) = $widearea_info_result->fetchrow_array()) {
next unless
($v2pmap{$vname}->{ISREMOTE} || $v2pmap{$vname}->{PLAB});
my $pnode = $v2pmap{$vname}->{VVP};
if (!defined($hostname)) {
$hostname = "--";
}
printf "%-15s %-15s %-45s\n", $vname, $pnode, $hostname;
}
print "\n";
}
my $range_result =
DBQueryFatal("select low,high from ipport_ranges ".
"where pid='$pid' and eid='$eid'");
......
......@@ -81,7 +81,8 @@ elseif (! strcmp($showtype, "widearea")) {
"wani.city,wani.state,wani.country,wani.zip), ".
"'USA, ','')".
"AS location, ".
"wani.connect_type";
"wani.connect_type, ".
"wani.hostname";
$additionalLeftJoin = "LEFT JOIN widearea_nodeinfo AS wani ".
"ON n.node_id=wani.node_id";
......@@ -243,12 +244,14 @@ while ($row = mysql_fetch_array($query_result)) {
$pid = $row[pid];
$eid = $row[eid];
$vname = $row[vname];
$hostname = $row[hostname];
$status = $row[status];
if (!strcmp($showtype, "widearea")) {
$machine_type = $row[machine_type];
$location = $row[location];
$connect_type = $row[connect_type];
$vname = $row[hostname];
}
echo "<tr>";
......
......@@ -2017,6 +2017,8 @@ function SHOWWIDEAREANODE($node_id, $embedded = 0) {
$state = $row[state];
$zip = $row[zip];
$country = $row[country];
$hostname = $row[hostname];
$site = $row[site];
if (! $embedded) {
echo "<table border=2 cellpadding=0 cellspacing=2
......@@ -2067,6 +2069,16 @@ function SHOWWIDEAREANODE($node_id, $embedded = 0) {
<td class=left>$country</td>
</tr>\n";
echo "<tr>
<td>Hostname:</td>
<td class=left>$hostname</td>
</tr>\n";
echo "<tr>
<td>Site:</td>
<td class=left>$site</td>
</tr>\n";
if (! $embedded) {
echo "</table>\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