Skip to content

Commit

Permalink
Print host name and online CPU on netlink html.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluhm committed Jan 25, 2024
1 parent d4d0f90 commit c5e6489
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Hostctl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ sub collect_version {
my $version = "version-$host.txt";
logeval { logcmd({
cmd => ['ssh', "$user\@$host", 'sysctl',
'kern.version', 'hw.machine', 'hw.ncpu'],
'kern.version', 'hw.machine', 'hw.ncpu', 'hw.ncpuonline'],
outfile => $version,
})};
if ($@) {
Expand Down
2 changes: 2 additions & 0 deletions Html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ sub parse_version_file {
}
/^hw.machine=(\w+)$/ and $v{arch} = $1;
/^hw.ncpu=(\w+)$/ and $v{ncpu} = $1;
# override if more specific value exists
/^hw.ncpuonline=(\w+)$/ and $v{ncpu} = $1;
}
return %v;
}
Expand Down
11 changes: 9 additions & 2 deletions netlink-html.pl
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,13 @@ sub list_dates {

sub html_hier_top {
my ($html, $date, @cvsdates) = @_;
my $setup = $D{$date}{setup};
my $dv = $D{$date};
my $setup = $dv->{setup};
my $link = uri_escape($setup, "^A-Za-z0-9\-\._~/");
my $href = $setup ? "<a href=\"../$link\">" : "";
my $enda = $href ? "</a>" : "";
my $hostname = $dv->{host};
my $ncpu = $dv->{ncpu};
print $html <<"HEADER";
<table>
<tr>
Expand All @@ -134,7 +137,11 @@ sub html_hier_top {
<td><a href="../$date/netlink.html">$date</a></td>
</tr>
<tr>
<th>setup</th>
<th>test host with cpu cores</th>
<td>$hostname/$ncpu</td>
</tr>
<tr>
<th>machine setup</th>
<td>${href}info$enda</td>
</tr>
</table>
Expand Down

0 comments on commit c5e6489

Please sign in to comment.