X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=aptcheck%2Faptcheck.pl;h=22ad13f339a6d835c00c81329e8fbf8ceeced9ca;hb=d57c0508b74bf0b6bc7917ae3674d22376faebeb;hp=c5d17be7d0863094432dab624c1517b1f9a9d9dd;hpb=f7535a3e90a312d10eb50178cfb28f04598460df;p=git-tools-moved-to-github.git diff --git a/aptcheck/aptcheck.pl b/aptcheck/aptcheck.pl index c5d17be..22ad13f 100755 --- a/aptcheck/aptcheck.pl +++ b/aptcheck/aptcheck.pl @@ -31,6 +31,7 @@ my %normhosts; my %normpkgs; my %okhosts; my %skiphosts; +my %allhosts; my $sectot = 0; my $owntot = 0; my $normtot = 0; @@ -43,6 +44,7 @@ for $hline ( split("\n",$hostlist) ) { next if ($H =~ /^commands/ ); next if ($H =~ /^servicegroups/ ); print "Checking $H\n" if $debug; + $allhosts{$H}=1; my $apt = `ssh $H apt-get upgrade -s -o 'Debug::NoLocking=true' `; # Note, do not append -qq, we want some output even when nothing to do if ( !$apt ) { @@ -103,6 +105,7 @@ for $hline ( split("\n",$hostlist) ) { $table .= " $own from indexdata " if $own; } else { $table .= "ok"; + $okhosts{$H} = 1; } my $updlink = $wikilink . ucfirst($H) . "Updates" . $year; $table .= " Upd"; @@ -113,7 +116,7 @@ for $hline ( split("\n",$hostlist) ) { } $table .= "\n"; -# Produce page +# Page header my $outfile = "/tmp/aptcheck.html"; open F, ">$outfile" or die "Could not open $outfile for writing: $!"; @@ -123,43 +126,63 @@ print F "
\n"; print F "" ; -print F " | Security " . scalar(keys(%sechosts)) . +print F " | Hosts | \n"; +print F "Packages |
Security " . scalar(keys(%sechosts)) . " / " . scalar(keys(%secpkgs)) . " / $sectot | \n" ;
-print F "Indexdata " . scalar(keys(%ownhosts)) . + print F " | "; + for $HH ( sort(keys(%sechosts)) ) { + print F "$HH "; + } + print F " | " . join(" ",sort(keys(%secpkgs))) . " | "; + print F "
Indexdata " . scalar(keys(%ownhosts)) . " / " . scalar(keys(%ownpkgs)) . " / $owntot | \n" ;
-print F "Normal " . scalar(keys(%normhosts)) . - " / " . scalar(keys(%normpkgs)) . " / $normtot | " . "||
Hosts | \n"; - - -print F ""; -for $HH ( sort(keys(%sechosts)) ) { - print F "$HH "; + print F " | "; + for $HH ( sort(keys(%ownhosts)) ) { + print F "$HH "; + } + print F " | " . join(" ",sort(keys(%ownpkgs))) . " | "; + print F "" . join(" ",sort(keys(%sechosts))) . " | "; -#print F "" . join(" ",sort(keys(%ownhosts))) . " | "; -print F ""; -for $HH ( sort(keys(%ownhosts)) ) { - print F "$HH "; +if ( $normtot ) { + print F " |
Indexdata " . scalar(keys(%normhosts)) . + " / " . scalar(keys(%normpkgs)) . " / $normtot | \n" ;
+ print F ""; + for $HH ( sort(keys(%normhosts)) ) { + print F "$HH "; + } + print F " | " . join(" ",sort(keys(%normpkgs))) . " | "; + print F "" . join(" ",sort(keys(%normhosts))) . " | \n"; -print F ""; -for $HH ( sort(keys(%normhosts)) ) { - print F "$HH "; +if ( %skiphosts ) { + print F " |
Skipped: " . scalar(keys(%skiphosts)) . " | \n"; + print F ""; + for $HH ( sort(keys(%skiphosts)) ) { + print F "$HH "; + } + print F " | ||
Ok: " . scalar(keys(%okhosts)) . " | \n"; + print F ""; + for $HH ( sort(keys(%okhosts)) ) { + print F "$HH "; + } + print F " | ||
Packages | \n"; -print F "" . join(" ",sort(keys(%secpkgs))) . " | "; -print F "" . join(" ",sort(keys(%ownpkgs))) . " | "; -print F "" . join(" ",sort(keys(%normpkgs))) . " |