diff --git a/attic/extract_saml2sp.pl b/attic/extract_saml2sp.pl deleted file mode 100755 index 5b7e92be..00000000 --- a/attic/extract_saml2sp.pl +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl -w - -use Xalan; - -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_saml2sp.xsl|") || die "could not open input file"; -while () { - my ($id, $result) = split; - $results{$id} = $result; - print $_; -} -close XML; - -open(IDS, "ids.txt") || die "could not open ids file"; -while () { - chop; - $id = $_; - if (defined $results{$id}) { - $result = $results{$id}; - } else { - $result = 'SP?'; - } - print "$result\n"; -} -close IDS; diff --git a/attic/extract_saml2sp.xsl b/attic/extract_saml2sp.xsl deleted file mode 100644 index aa59a0db..00000000 --- a/attic/extract_saml2sp.xsl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - yes - no - - - - - - - - - diff --git a/attic/keynames.pl b/attic/keynames.pl deleted file mode 100755 index a917025d..00000000 --- a/attic/keynames.pl +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env perl - -# -# keynames.pl -# -# Extracts statistics about KeyName elements from the published metadata. -# -use warnings; -use lib "../build"; -use Xalan; -use Months; - -# Parse command line arguments -use Getopt::Long; -my $allMonths; -GetOptions('all' => \$allMonths); - -# By default, only show results for the most recent month -if (!$allMonths) { - # reduce months table to one element - my $oneMonth = pop @months; - @months = ( $oneMonth ); -} - -# ingest files -foreach $month (@months) { - print "processing $month\n"; - my $fn = "cache/$month.xml"; - my $command = xalanCall . " -IN $fn -XSL ../build/extract_embedded.xsl -OUT temp.tmp"; - # print "command is $command\n"; - system($command); # || print "ignoring claimed failure in sub command\n"; - #print "Xalan run on $fn\n"; - open(TXT, "perl keynames_inner.pl -q ) { - if (/^Total: (\d+)$/) { - $count = $1; - } - print $_ unless $allMonths; - } - close TXT; - push @counts, "$month: $count"; -} - -if ($allMonths) { - print "KeyName count:\n"; - foreach $count (@counts) { - print "$count\n"; - } -} diff --git a/attic/keynames_inner.pl b/attic/keynames_inner.pl deleted file mode 100755 index 3778f942..00000000 --- a/attic/keynames_inner.pl +++ /dev/null @@ -1,351 +0,0 @@ -#!/usr/bin/env perl - -use warnings; -use POSIX qw(floor); -use File::Temp qw(tempfile); -use Date::Format; -use Date::Parse; -use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); - -sub error { - my($s) = @_; - push(@olines, ' *** ' . $s . ' ***'); - $printme = 1; -} - -sub warning { - my ($s) = @_; - push(@olines, ' ' . $s); - $printme = 1; -} - -sub comment { - my($s) = @_; - push(@olines, ' (' . $s . ')'); -} - -# -# Process command-line options. -# -while (@ARGV) { - $arg = shift @ARGV; - $quiet = 1 if $arg eq '-q'; -} - -# -# Hash of already-seen blobs. -# -# Each entry in the hash is indexed by the blob itself. Each blob is a concatenated -# sequence of information that uniquely identifies an already checked key. This is -# used to avoid processing the same blob more than once. -# -my %blobs; - -# -# Blob currently being constructed. -# -my $blob; - -# -# The day that follows the end of each bin. -# -# Bin 0, running from 2014-01-01 to 2014-01-31, -# is followed by the start of bin 1 on 2014-02-01. -# -my @binNextDays = ( - "2014-02-01", - "2014-03-01", - "2014-04-01", - "2014-05-01", - "2014-06-01", - "2014-07-01", - "2014-08-01", - "2014-09-01", - "2014-10-01", - "2014-11-01", - "2014-12-01", - "2015-01-01", # 1Q2015 - "2015-04-01", # 2Q2015 - "2015-07-01", # 3Q2015 - "2015-10-01", # 4Q2015 - "2016-01-01", # 2016 - "2017-01-01", # 2017 - "2018-01-01", # 2018... -); - -# -# Names for bins. The index into this array is -# displaced by 1, so that the first element (index 0) -# gives the name for bin -1 ("expired"). -# -my @binNames = ( - "expired", - "Jan 14", - "Feb 14", - "Mar 14", - "Apr 14", - "May 14", - "Jun 14", - "Jul 14", - "Aug 14", - "Sep 14", - "Oct 14", - "Nov 14", - "Dec 14", - "2015Q1", - "2015Q2", - "2015Q3", - "2015Q4", - "2016", - "2017", -); - -my $binEndTimes = (); -for $startDay (@binNextDays) { - #print "startDay is $startDay\n"; - my $endTime = str2time($startDay . "T00:00:00")-1; - push(@binEndTimes, $endTime); - # local $endTimeText = time2str('%Y-%m-%dT%H:%M:%S', $endTime); - # print "end time corresponding to $startDay is $endTime ($endTimeText)\n"; -} - -# -# Proposed evolution deadline. -# -my $deadline = "2015-01-01T00:00:00"; -my $deadlineTime = str2time($deadline); - -# -# Start of the current month, as an approximation of what we want -# to regard as an "expired" certificate. Ideally, this would be -# passed in as a parameter. -# -#my $nowYearMonth = '2012-08-01T00:00:00'; -my $nowYearMonth = time2str('%Y-%m-01T00:00:00', time()); -my $validStart = str2time($nowYearMonth); - -# -# Total size of deduplicated blobs. -# -my $dedupTotal = 0; - -while (<>) { - - # - # Discard blank lines. - # - next if /^\s*$/; - - # - # Handle Entity/KeyName header line. - # - if (/^Entity:/) { - @olines = (); - $printme = 0; - @args = split; - $entity = $args[1]; - $keyname = $args[3]; - - # - # Output header line. - # - $oline = "Entity $entity "; - $hasKeyName = !($keyname eq '(none)'); - if ($hasKeyName) { - $oline .= "has KeyName $keyname"; - } else { - $oline .= "has no KeyName"; - } - push(@olines, $oline); - - # Start the blob like this if you want per-entity deduplication - # $blob = $oline; # start building a new blob - - # Start the blob like this if you want global deduplication - $blob = ""; - - # - # Create a temporary file for this certificate in PEM format. - # - ($fh, $filename) = tempfile(UNLINK => 1); - #print "temp file is: $filename\n"; - - # do not buffer output to the temporary file - select((select($fh), $|=1)[0]); - next; - } - - # - # Put other lines into a temporary file. - # - print $fh $_; - $blob .= '|' . $_; - - # - # If this is the last line of the certificate, actually do - # something with it. - # - if (/END CERTIFICATE/) { - - # - # If the certificate is not associated with a KeyName, - # we ignore it entirely. - # - if (!$hasKeyName) { - # print "ignoring certificate with no KeyName\n"; - close $fh; - next; - } - - # - # Have we seen this blob before? If so, close (and delete) the - # temporary file, and go and look for a new certificate to process. - # - $total_certs++; - if (defined($blobs{$blob})) { - $dedupTotal += (length($blob) - length($_) - 1); - # print "skipping a blob\n"; - close $fh; - next; - } - - # - # Otherwise, remember this blob so that we won't process it again. - # - $blobs{$blob} = 1; - $distinct_certs++; - - # - # Don't close the temporary file yet, because that would cause it - # to be deleted. We've already arranged for buffering to be - # disabled, so the file can simply be passed to other applications - # as input, perhaps multiple times. - # - - # - # Collection of names this certificate contains - # - my %names; - - # - # Use openssl to convert the certificate to text - # - my(@lines, $issuer, $subjectCN, $issuerCN); - $cmd = "openssl x509 -in $filename -noout -text -nameopt RFC2253 -modulus |"; - open(SSL, $cmd) || die "could not open openssl subcommand: $!"; - $expiryBin = -1; - while () { - push @lines, $_; - - if (/^\s*Issuer:\s*(.*)$/) { - $issuer = $1; - if ($issuer =~ /CN=([^,]+)/) { - $issuerCN = $1; - } else { - $issuerCN = $issuer; - } - next; - } - - if (/^\s*Subject:\s*.*?CN=([a-zA-Z0-9\-\.]+).*$/) { - $subjectCN = $1; - $names{lc $subjectCN}++; - # print "subjectCN = $subjectCN\n"; - next; - } - - if (/Not After : (.*)$/) { - $notAfter = $1; - $notAfterTime = str2time($notAfter); - $days = ($notAfterTime-$validStart)/86400.0; - next; - } - } - close SSL; - - # - # Check KeyName if one has been supplied. - # - if ($hasKeyName && !defined($names{lc $keyname})) { - my $nameList = join ", ", sort keys %names; - error("KeyName mismatch: $keyname not in {$nameList}"); - } - - # - # Use openssl to ask whether this matches our trust fabric or not. - # - my $error = ''; - - # - # Close the temporary file, which will also cause - # it to be deleted. - # - close $fh; - - # - # Expiry binning is on the basis of calendar period bins. - # - # Bin -1 is for expired certificates, bin 99 is for those that - # expire on or after 2018-01-01T00:00:00. - # - if ($days < 0) { - $expiryBin = -1; - } else { - $expiryBin = 99; - my $bin = 0; - for $binEndTime (@binEndTimes) { - if ($notAfterTime <= $binEndTime) { - $expiryBin = $bin; - last; - } - $bin++; - } - } - # print "date $notAfter gets bin $expiryBin\n"; - $expiryBinCount{$expiryBin}++; - - # - # Print any interesting things related to this certificate. - # - if ($printme || !$quiet) { - foreach $oline (@olines) { - print $oline, "\n"; - } - print "\n"; - } - } -} - -sub numerically { - $a <=> $b; -} - -if ($total_certs > 1) { - - print "Total certificates: $total_certs\n"; - if ($distinct_certs != $total_certs) { - print "Distinct certificates: $distinct_certs\n"; - } - - print "\nExpiry bins:\n"; - $total = 0; - for $bin (sort numerically keys %expiryBinCount) { - if (defined($expiryBinCount{$bin})) { - $count = $expiryBinCount{$bin}; - } else { - $count = 0; # nothing was put in that bin - } - $total += $count; - if ($bin == 99) { - $binName = ">=2018"; - } else { - $binName = $binNames[$bin+1]; - } - print " $binName: $count\n"; - } - print "Total: $total\n"; - - print "\n"; - - print "Deduplication saves: $dedupTotal\n"; -} diff --git a/build.xml b/build.xml index 1c8348cf..83bf53f2 100644 --- a/build.xml +++ b/build.xml @@ -100,6 +100,27 @@ + + + + + + + + + + + + + + + @@ -173,7 +201,7 @@ --> - + @@ -243,7 +271,6 @@ - - + - Verifying MDQ held at ${mdq.dist.name} - - - + Verifying MDQ held at ${cdi-master.name}${cdi-master.mdq.path.name} + + + + Verifying MDQ held at ${mdq.dist.name} + + + @@ -1449,6 +1495,9 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pushing UK Federation metadata files to MD dist. + -> CDI-master + + + + + -> MD-NE-01 @@ -2099,6 +2096,12 @@ Push mdq cache tar to the MD dist servers --> Pushing UK Federation mdq cache to MD dist. + -> CDI-master + + + + + -> MD-NE-01 @@ -2307,8 +2310,10 @@ - + + + + Extracting embedded certificates - + + + + + + Extracting embedded certificates - + + + + + + Checking embedded certificates Note: ignore expiry on eduGAIN entities >>" . xalanCall . "<<<\n"; - -1; diff --git a/build/check_entity.pl b/build/check_entity.pl index f891783c..50003122 100755 --- a/build/check_entity.pl +++ b/build/check_entity.pl @@ -1,5 +1,4 @@ #!/usr/bin/perl -w -use Xalan; use File::Temp qw(tempfile); use Date::Parse; use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); @@ -28,16 +27,16 @@ # temporary file $temp = '../xml/embedded.pem'; unlink($temp) if -e $temp; - + # extract embedded certificates - open(EXTRACT, xalanCall . " -IN $fn -OUT $temp -XSL extract_embedded.xsl|") + open(EXTRACT, "xsltproc --output $temp extract_embedded.xsl $fn|") || die "could not open certificate extract process"; while () { print $_; } close EXTRACT; die "no embedded certificates extracted" unless -e $temp; - + # check embedded certificates open(CHECK, "cd ../xml; perl ../build/check_embedded.pl <$temp|") || die "could not open certificate check process"; @@ -47,7 +46,7 @@ print $_; } close CHECK; - + # clean up unlink($temp) if -e $temp; } diff --git a/build/extract_embedded.xsl b/build/extract_embedded.xsl index 751a6a91..9242daba 100644 --- a/build/extract_embedded.xsl +++ b/build/extract_embedded.xsl @@ -17,8 +17,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:mdxTextUtils="xalan://uk.ac.sdss.xalan.md.TextUtils"> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> @@ -49,7 +48,7 @@ -----BEGIN CERTIFICATE----- - + -----END CERTIFICATE----- diff --git a/build/extract_locs.pl b/build/extract_locs.pl index a516194d..97fa27c9 100755 --- a/build/extract_locs.pl +++ b/build/extract_locs.pl @@ -1,8 +1,6 @@ #!/usr/bin/perl -w -use Xalan; - -open(XML, xalanCall . " -IN ../mdx/uk/collected.xml -XSL extract_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_locs.xsl ../mdx/uk/collected.xml|") || die "could not open input file"; while () { chop; if (/^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) { diff --git a/build/extract_locs_edugain.pl b/build/extract_locs_edugain.pl index daf44512..e882d0ca 100755 --- a/build/extract_locs_edugain.pl +++ b/build/extract_locs_edugain.pl @@ -1,8 +1,6 @@ #!/usr/bin/perl -w -use Xalan; - -open(XML, xalanCall . " -IN ../mdx/int_edugain/imported.xml -XSL extract_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_locs.xsl ../mdx/int_edugain/imported.xml|") || die "could not open input file"; while () { chop; if (/^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) { diff --git a/build/extract_locs_noports.pl b/build/extract_locs_noports.pl index 68eeb366..24502aa6 100755 --- a/build/extract_locs_noports.pl +++ b/build/extract_locs_noports.pl @@ -1,8 +1,6 @@ #!/usr/bin/perl -w -use Xalan; - -open(XML, xalanCall . " -IN ../mdx/uk/collected.xml -XSL extract_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_locs.xsl ../mdx/uk/collected.xml|") || die "could not open input file"; while () { chop; if (/^https:\/\/([^\/:]+)(:\d+)?(\/|$)/) { diff --git a/build/probe_certs.pl b/build/probe_certs.pl index 5772c566..58f553fa 100755 --- a/build/probe_certs.pl +++ b/build/probe_certs.pl @@ -1,10 +1,9 @@ #!/usr/bin/perl -w use ExtractCert; -use Xalan; print "Loading endpoint locations...\n"; -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_cert_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_cert_locs.xsl ../xml/ukfederation-metadata.xml|") || die "could not open input file"; while () { if (/^http:/) { print "skipping http location: $_"; @@ -37,7 +36,7 @@ # Remove any old copy of the DER file. # unlink $temp_der; - + # # Separate location into host and port. # @@ -58,7 +57,7 @@ $failed{$loc} = 1; next; } - + # # Use openssl to convert the certificate to text # @@ -75,7 +74,7 @@ $subject = $1; } } - + if ($subject eq $issuer) { $issuer = "(self-signed certificate)"; } @@ -101,7 +100,7 @@ print "$n: $issuer\n"; foreach $loc (sort keys %locs) { print " $loc\n"; - } + } } # diff --git a/build/probe_nk_certs.pl b/build/probe_nk_certs.pl index 36554355..337e3e66 100755 --- a/build/probe_nk_certs.pl +++ b/build/probe_nk_certs.pl @@ -3,7 +3,6 @@ use POSIX qw(floor); use Date::Parse; use ExtractCert; -use Xalan; sub error { my($s) = @_; @@ -28,7 +27,7 @@ sub comment { my $longExpiredDays = 30*3; # about three months print "Loading endpoint locations...\n"; -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nk_cert_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_nk_cert_locs.xsl ../xml/ukfederation-metadata.xml|") || die "could not open input file"; while () { my ($entity, $url) = split; if ($url =~ /^https:\/\/([^\/:]+(:\d+)?)\//) { @@ -61,7 +60,7 @@ sub comment { # Remove any old copy of the DER file. # unlink $temp_der; - + # # Separate location into host and port. # @@ -82,7 +81,7 @@ sub comment { $failed{$loc} = 1; next; } - + # # Use openssl to convert the certificate to text # @@ -122,7 +121,7 @@ sub comment { } next; } - + if (/Not After : (.*)$/) { $notAfter = $1; $notAfterTime = str2time($notAfter); @@ -143,7 +142,7 @@ sub comment { } } - + if ($pubSize < 2048) { warning("short public key: $pubSize bits, certificate expires $notAfter"); } @@ -173,7 +172,7 @@ sub comment { print "$n: $issuer\n"; foreach $loc (sort keys %locs) { print " $loc\n"; - } + } } # diff --git a/build/probe_nk_nocerts.pl b/build/probe_nk_nocerts.pl index 808f6ac6..07932fb4 100755 --- a/build/probe_nk_nocerts.pl +++ b/build/probe_nk_nocerts.pl @@ -3,7 +3,6 @@ use POSIX qw(floor); use Date::Parse; use ExtractCert; -use Xalan; sub error { my($s) = @_; @@ -30,7 +29,7 @@ sub comment { my $longExpiredDays = 30*3; # about three months print "Loading endpoint locations...\n"; -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nk_nocert_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_nk_nocert_locs.xsl ../xml/ukfederation-metadata.xml|") || die "could not open input file"; while () { my ($entity, $url) = split; if ($url =~ /^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) { @@ -62,12 +61,12 @@ sub comment { my $entity = $locations{$loc}; print "$count: probing $entity: $loc\n"; $count--; - + # # Remove any old copy of the DER file. # unlink $temp_der; - + # # Separate location into host and port. # @@ -88,7 +87,7 @@ sub comment { $failed{$loc} = 1; next; } - + # # Use openssl to convert the certificate to text # @@ -128,7 +127,7 @@ sub comment { } next; } - + if (/Not After : (.*)$/) { $notAfter = $1; $notAfterTime = str2time($notAfter); @@ -179,7 +178,7 @@ sub comment { print "$n: $issuer\n"; foreach $loc (sort keys %locs) { print " $loc\n"; - } + } } # diff --git a/build/probe_nocerts.pl b/build/probe_nocerts.pl index fbb0771c..cd6f5d8d 100755 --- a/build/probe_nocerts.pl +++ b/build/probe_nocerts.pl @@ -1,12 +1,11 @@ #!/usr/bin/perl -w use ExtractCert; -use Xalan; $known_bad{'census.data-archive.ac.uk:8080'} = 1; # it is really http, not https print "Loading endpoint locations...\n"; -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_nocert_locs.xsl ../xml/ukfederation-metadata.xml|") || die "could not open input file"; while () { chop; if (/^http:/) { @@ -39,12 +38,12 @@ foreach $loc (sort keys %locations) { print "$count: probing: $loc\n"; $count--; - + # # Remove any old copy of the DER file. # unlink $temp_der; - + # # Separate location into host and port. # @@ -65,7 +64,7 @@ $failed{$loc} = 1; next; } - + # # Use openssl to convert the certificate to text # @@ -108,7 +107,7 @@ print "$n: $issuer\n"; foreach $loc (sort keys %locs) { print " $loc\n"; - } + } } # diff --git a/build/probe_openssl.pl b/build/probe_openssl.pl index d71e759a..1b2e83cb 100755 --- a/build/probe_openssl.pl +++ b/build/probe_openssl.pl @@ -1,12 +1,11 @@ #!/usr/bin/perl -w use ExtractCert; -use Xalan; $known_bad{'census.data-archive.ac.uk:8080'} = 1; # it is really http, not https print "Loading endpoint locations...\n"; -open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file"; +open(XML, "xsltproc extract_nocert_locs.xsl ../xml/ukfederation-metadata.xml|") || die "could not open input file"; while () { chop; if (/^http:/) { @@ -39,12 +38,12 @@ foreach $loc (sort keys %locations) { print "$count: probing: $loc\n"; $count--; - + # # Remove any old copy of the DER file. # unlink $temp_der; - + # # Separate location into host and port. # diff --git a/charting/mdui.pl b/charting/mdui.pl index fb2a6bfd..2651703b 100755 --- a/charting/mdui.pl +++ b/charting/mdui.pl @@ -4,8 +4,7 @@ # mdui.pl # use warnings; -use lib "../build"; -use Xalan; +use lib '.'; use Months; # Parse command line arguments @@ -29,9 +28,9 @@ foreach $month (@months) { print "Processing $month\n"; - my $command = xalanCall . " -IN cache/$month.xml -XSL statistics_mdui.xsl"; + my $command = "xsltproc statistics_mdui.xsl cache/$month.xml"; # print "command is $command\n"; system($command); # || print "ignoring claimed failure in sub command\n"; - # print "Xalan run on $fn\n"; + # print "xsltproc run on $fn\n"; print "\n"; } diff --git a/charting/saml2.pl b/charting/saml2.pl index fd790429..0542f210 100755 --- a/charting/saml2.pl +++ b/charting/saml2.pl @@ -6,8 +6,7 @@ # Extracts statistics about SAML 2 adoption from the published metadata. # use warnings; -use lib "../build"; -use Xalan; +use lib "."; use Months; # Parse command line arguments @@ -25,7 +24,7 @@ # ingest files foreach $month (@months) { my $fn = "cache/$month.xml"; - open(TXT, xalanCall . " -IN $fn -XSL saml2.xsl|") || die "could not open input file"; + open(TXT, "xsltproc saml2.xsl $fn|") || die "could not open input file"; $_ = ; chop; # print "$month: $_\n"; diff --git a/charting/scopes.pl b/charting/scopes.pl index 3927471b..8a8c6692 100755 --- a/charting/scopes.pl +++ b/charting/scopes.pl @@ -6,8 +6,7 @@ # Extracts statistics about number of scopes from the published metadata. # use warnings; -use lib "../build"; -use Xalan; +use lib "."; use Months; # Parse command line arguments @@ -31,7 +30,7 @@ foreach $month (@months) { my $fn = "cache/$month.xml"; my %scopes; - open(TXT, xalanCall . " -IN $fn -XSL scopes.xsl|") || die "could not open input file"; + open(TXT, "xsltproc scopes.xsl $fn|") || die "could not open input file"; while () { chop; my $scope = $_; diff --git a/charting/sizes.pl b/charting/sizes.pl index 004c6e3f..7f9fa924 100755 --- a/charting/sizes.pl +++ b/charting/sizes.pl @@ -4,9 +4,8 @@ # sizes.pl # use warnings; -use lib "../build"; +use lib "."; use File::stat; -use Xalan; use Months; # Parse command line arguments @@ -47,10 +46,10 @@ # Now generate a reduced version of the archived # file that contains only UK federation registered entities. # - my $command = xalanCall . " -IN $fn -XSL just_ours.xsl -OUT temp.tmp"; + my $command = "xsltproc --output temp.tmp just_ours.xsl $fn"; # print "command is $command\n"; system($command); # || print "ignoring claimed failure in sub command\n"; - # print "Xalan run on $fn\n"; + # print "xsltproc run on $fn\n"; # # Process the reduced version of the archived file. diff --git a/mdx/_rules/check_future_1.xsl b/mdx/_rules/check_future_1.xsl index ed05b114..c6d5d479 100644 --- a/mdx/_rules/check_future_1.xsl +++ b/mdx/_rules/check_future_1.xsl @@ -27,4 +27,31 @@ --> + + + + more than one SingleLogoutService with SAML 2.0 HTTP-POST binding + + + + + + more than one SingleLogoutService with SAML 2.0 HTTP-POST-SimpleSign binding + + + + + + more than one SingleLogoutService with SAML 2.0 HTTP-Redirect binding + + + + diff --git a/mdx/_rules/check_future_2.xsl b/mdx/_rules/check_future_2.xsl index ee51f733..0b697102 100644 --- a/mdx/_rules/check_future_2.xsl +++ b/mdx/_rules/check_future_2.xsl @@ -27,4 +27,27 @@ --> + + + + + + + + mismatched xml:lang='en' DisplayNames: ' + + ' in mdui vs. ' + + ' in ODN + + + + + diff --git a/mdx/_rules/check_future_4.xsl b/mdx/_rules/check_future_4.xsl index 8a7084f8..ef19cc39 100644 --- a/mdx/_rules/check_future_4.xsl +++ b/mdx/_rules/check_future_4.xsl @@ -17,6 +17,7 @@ xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" xmlns:set="http://exslt.org/sets" + xmlns:alg="urn:oasis:names:tc:SAML:metadata:algsupport" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" @@ -27,4 +28,73 @@ --> + + + + + + + + + + Does not contain a GCM EncryptionMethod specified in new saml2int + + + + + + Does not contain a Key Transport EncryptionMethod specified in new saml2int + + + + + + + + + + + + + + Does not contain a SigningMethod specified in new saml2int + + + + + + Does not contain a DigestMethod specified in new saml2int + + + + + diff --git a/mdx/_rules/check_future_5.xsl b/mdx/_rules/check_future_5.xsl index 8ebfc25d..ca6bcd72 100644 --- a/mdx/_rules/check_future_5.xsl +++ b/mdx/_rules/check_future_5.xsl @@ -13,6 +13,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui" + xmlns:mdxURL="xalan://uk.ac.sdss.xalan.md.URLchecker" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" xmlns:set="http://exslt.org/sets" @@ -23,4 +24,16 @@ --> + + + + + ' + + ' is not a valid URL: + + + + + diff --git a/mdx/_rules/check_future_9.xsl b/mdx/_rules/check_future_9.xsl index 54911d3d..546f4275 100644 --- a/mdx/_rules/check_future_9.xsl +++ b/mdx/_rules/check_future_9.xsl @@ -6,7 +6,8 @@ Checking ruleset containing rules that we don't currently implement, but which we may implement in the future. - Author: Ian A. Young + This is to warn if an SP suggests that it wants signed assertions. + Typically, it is the response that should be signed. --> + + + SP sets WantAssertionsSigned, although typically you would want Responses signed not Assertions + + + diff --git a/mdx/_rules/check_reqattr.xsl b/mdx/_rules/check_reqattr.xsl index 455d35e8..3bdb565d 100644 --- a/mdx/_rules/check_reqattr.xsl +++ b/mdx/_rules/check_reqattr.xsl @@ -28,6 +28,10 @@ http://www.terena.org/registry/terena.org/attribute-def/ http://www.terena.org/registry/terena.org/schac/ Assuming encoding rules equivalent to MACEAttr. + + * eduroam.cz + Currently only a single attribute, documented at: + https://www.eduroam.cz/attributes/eduroamUID Author: Ian A. Young @@ -482,6 +486,12 @@ + + + + - https://zididp.uni-graz.at/idp/shibboleth diff --git a/mdx/common-beans.xml b/mdx/common-beans.xml index db6b1d20..1ec9a4b1 100644 --- a/mdx/common-beans.xml +++ b/mdx/common-beans.xml @@ -259,6 +259,14 @@ + + + - + + - + + + @@ -306,26 +317,39 @@ + + + - + + + + + + + + + + + @@ -354,9 +378,12 @@ http://www.edugain.org/technical/status.php --> + + + @@ -374,6 +401,7 @@ + @@ -385,8 +413,10 @@ + + @@ -394,17 +424,27 @@ + - - + + + + + - - + + + + + + + + @@ -424,6 +464,21 @@ + + + + + + #{T(net.shibboleth.metadata.WarningStatus)} + + + + + + - - + + + + + + + + + + + + + + administrative + + + + + + + + + + + + + + + + + + + + + + @@ -102,26 +164,12 @@ - - - - - - - - - - - - - - - + - - - - administrative - - - - + - - - - - + + + + + + + + + + + + + + + - @@ -294,20 +361,23 @@ - - + + + + + - - - - + + + - + diff --git a/mdx/_rules/mdui_dn_en_present.xsl b/mdx/uk/check_uk_mdui_dn_en_present.xsl similarity index 90% rename from mdx/_rules/mdui_dn_en_present.xsl rename to mdx/uk/check_uk_mdui_dn_en_present.xsl index e5364e11..b8d11d36 100644 --- a/mdx/_rules/mdui_dn_en_present.xsl +++ b/mdx/uk/check_uk_mdui_dn_en_present.xsl @@ -1,7 +1,7 @@ - + diff --git a/mdx/uk/final_tweak.xsl b/mdx/uk/final_tweak.xsl index c52acc4c..76d4353a 100644 --- a/mdx/uk/final_tweak.xsl +++ b/mdx/uk/final_tweak.xsl @@ -44,30 +44,23 @@ This parameter determines the number of days between the aggregation instant and the end of validity of the signed metadata. --> - + - - - - - - - + + + - - - - + + + + U K F E D E R A T I O N M E T A D A T A diff --git a/mdx/uk/generate.xml b/mdx/uk/generate.xml index 0c679ef1..459f39d2 100644 --- a/mdx/uk/generate.xml +++ b/mdx/uk/generate.xml @@ -37,6 +37,19 @@ ***************************** --> + + + + + + + + + + + + + - - - - + p:XSLResource="classpath:uk/final_tweak.xsl"/> + + + + + + + + + + + + + + @@ -80,17 +111,6 @@ - - - - - - - @@ -340,7 +360,7 @@ - + @@ -412,6 +431,7 @@ + @@ -456,7 +476,7 @@ - + @@ -469,7 +489,6 @@ - @@ -494,6 +513,7 @@ + @@ -519,10 +539,9 @@ - + - @@ -547,6 +566,7 @@ + @@ -573,10 +593,9 @@ - + - @@ -601,6 +620,7 @@ + @@ -697,11 +717,10 @@ - + - @@ -813,11 +832,10 @@ - + - @@ -898,6 +916,15 @@ + + + + + + + + + + @@ -67,7 +76,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mdx/uk/statistics-charting.xsl b/mdx/uk/statistics-charting.xsl index c8cf91fe..abebbcef 100644 --- a/mdx/uk/statistics-charting.xsl +++ b/mdx/uk/statistics-charting.xsl @@ -144,7 +144,7 @@ - Algorithm support: + Algorithm support: of SP entities @@ -207,6 +207,37 @@ + + + + + + Entities with mdui:UIInfo: + + ( + + ) + + + + + IdPs with mdui:UIInfo: + + ( + + ) + + + + + SPs with mdui:UIInfo: + + ( + + ) + + + diff --git a/mdx/uk/verbs.xml b/mdx/uk/verbs.xml index cfed773c..c5a88d82 100644 --- a/mdx/uk/verbs.xml +++ b/mdx/uk/verbs.xml @@ -259,6 +259,32 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -309,13 +335,16 @@ + + + - - - - + + + + + diff --git a/mdx/validation-beans.xml b/mdx/validation-beans.xml index f7ed527f..980bd328 100644 --- a/mdx/validation-beans.xml +++ b/mdx/validation-beans.xml @@ -220,36 +220,10 @@ - - - - - - diff --git a/preprod.properties b/preprod.properties index ef97e089..75d6c668 100644 --- a/preprod.properties +++ b/preprod.properties @@ -46,3 +46,10 @@ md.dist.path.name=/ # mdq.dist.name=mdq-test.ukfederation.org.uk mdq.cache=mdqcache-test.tar.gz + +# +# Preprod T&I CDI uses different settings for temp location and +# +cdi-master.temploc.name=/tmp/legacy-ukf-test +cdi-master.md.path.name=/legacy-ukf-test-md/ +cdi-master.mdq.path.name=/legacy-ukf-test-mdq/ diff --git a/tools/ukf-mda/ukf-mda-0.9.5.jar b/tools/ukf-mda/ukf-mda-0.9.5.jar deleted file mode 100644 index de2941e6..00000000 Binary files a/tools/ukf-mda/ukf-mda-0.9.5.jar and /dev/null differ diff --git a/tools/ukf-mda/ukf-mda-0.9.8.jar b/tools/ukf-mda/ukf-mda-0.9.8.jar new file mode 100644 index 00000000..7e672883 Binary files /dev/null and b/tools/ukf-mda/ukf-mda-0.9.8.jar differ diff --git a/utilities/addresses.pl b/utilities/addresses.pl index 1c9772d5..bc605208 100755 --- a/utilities/addresses.pl +++ b/utilities/addresses.pl @@ -1,8 +1,5 @@ #!/usr/bin/perl -use lib "../build"; -use Xalan; - # # Load extra addresses. # @@ -24,7 +21,7 @@ # # UK addresses # -open(XML, xalanCall . " -IN ../mdx/uk/collected.xml -XSL ../build/extract_addresses.xsl|") || die "could not open input file"; +open(XML, "xsltproc ../build/extract_addresses.xsl ../mdx/uk/collected.xml|") || die "could not open input file"; while () { if (/(mailto:)?(.*)<\/EmailAddress>/) { $metadata{$2} = 1; diff --git a/utilities/check_embedded.pl b/utilities/check_embedded.pl index 6919014b..f630b871 100755 --- a/utilities/check_embedded.pl +++ b/utilities/check_embedded.pl @@ -32,20 +32,20 @@ my $longExpiredDays = 30*3; # about three months sub error { - my($s) = @_; - push(@olines, ' *** ' . $s . ' ***'); - $printme = 1; + my($s) = @_; + push(@olines, ' *** ' . $s . ' ***'); + $printme = 1; } sub warning { - my ($s) = @_; - push(@olines, ' ' . $s); - $printme = 1; + my ($s) = @_; + push(@olines, ' ' . $s); + $printme = 1; } sub comment { - my($s) = @_; - push(@olines, ' (' . $s . ')'); + my($s) = @_; + push(@olines, ' (' . $s . ')'); } # @@ -105,211 +105,211 @@ sub comment { while (<>) { - # - # Discard blank lines. - # - next if /^\s*$/; - - # - # Handle Entity/KeyName header line. - # - if (/^Entity:/) { - @olines = (); - $printme = 0; - @args = split; - $entity = $args[1]; - $keyname = $args[3]; - - # - # Tidy entity ID if it includes a UK ID as well. - # - if ($entity =~ /^\[(.+)\](.+)$/) { - $entity = $2 . ' (' . $1 . ')'; - } - - # - # Output header line. - # - $oline = "Entity $entity"; - $hasKeyName = !($keyname eq '(none)'); - push(@olines, $oline); - if ($hasKeyName) { - error("descriptor has unexpected KeyName $keyname"); - } - - # - # Start building a new blob. - # - # The blob contains the entity name, so de-duplication - # only occurs within a particular entity and not across - # entities. - # - $blob = $oline; - - # - # Create a temporary file for this certificate in PEM format. - # - ($fh, $filename) = tempfile(UNLINK => 1); - #print "temp file is: $filename\n"; - - # do not buffer output to the temporary file - select((select($fh), $|=1)[0]); - next; - } - - # - # Put other lines into a temporary file. - # - print $fh $_; - $blob .= '|' . $_; - - # - # If this is the last line of the certificate, actually do - # something with it. - # - if (/END CERTIFICATE/) { - # - # Have we seen this blob before? If so, close (and delete) the - # temporary file, and go and look for a new certificate to process. - # - $total_certs++; - if (defined($blobs{$blob})) { - # print "skipping a blob\n"; - close $fh; - next; - } - - # - # Otherwise, remember this blob so that we won't process it again. - # - $blobs{$blob} = 1; - $distinct_certs++; - - # - # Don't close the temporary file yet, because that would cause it - # to be deleted. We've already arranged for buffering to be - # disabled, so the file can simply be passed to other applications - # as input, perhaps multiple times. - # - - # - # Collection of names this certificate contains - # - my %names; - - # - # Use openssl to convert the certificate to text - # - my(@lines, $subject, $issuer, $subjectCN, $issuerCN, $fingerprint); - $cmd = "openssl x509 -in $filename -noout -text -nameopt RFC2253 -modulus -fingerprint|"; - open(SSL, $cmd) || die "could not open openssl subcommand"; - while () { - push @lines, $_; - - if (/^\s*Issuer:\s*(.*)$/) { - $issuer = $1; - if ($issuer =~ /CN=([^,]+)/) { - $issuerCN = $1; - } elsif ($issuer =~ /,OU=VeriSign International Server CA - Class 3,/) { - $issuerCN = 'VeriSign International Server CA - Class 3'; - } else { - $issuerCN = $issuer; - } - next; - } - - if (/^\s*Subject:\s*(.*)$/) { - $subject = $1; - if ($subject =~ /CN=([^,]+)/) { - $subjectCN = $1; - $names{lc $subjectCN}++; - } else { - $subjectCN = $1; - } - next; - } - - # - # Extract the certificate fingerprint. - # - if (/^\s*SHA1 Fingerprint=(.+)$/) { - $fingerprint = uc $1; - if (defined($expiry_whitelist{$fingerprint})) { - $expiry_whitelist{$fingerprint} = 'used'; - } - } - - # - # Extract the public key size. This is displayed differently - # in different versions of OpenSSL. - # - if (/RSA Public Key: \((\d+) bit\)/) { # OpenSSL 0.9x - $pubSize = $1; - next; - } elsif (/^\s*Public-Key: \((\d+) bit\)/) { # OpenSSL 1.0 - $pubSize = $1; - next; - } - - if (/Not After : (.*)$/) { - $notAfter = $1; - $notAfterTime = str2time($notAfter); - - # - # Track certificate expiry year in a way that doesn't - # involve Unix epoch overflow. - # - if ($notAfter =~ /(\d\d\d\d)/) { - my $year = $1; - if ($year > $maxYear) { - $maxYear = $year; - } - if ($year >= 2038) { - $num2038++; - } - } - - # - # Track most distant notAfter. - # - if ($notAfterTime > $lastNotAfterTime) { - $lastNotAfter = $notAfter; - $lastNotAfterTime = $notAfterTime; - $lastNotAfterEntity = $entity; - } - - $days = ($notAfterTime-time())/86400.0; - next; - } - - # - # subjectAlternativeName - # - if (/X509v3 Subject Alternative Name:/) { - # - # Steal the next line, which will look like this: - # - # DNS:www.example.co.uk, DNS:example.co.uk, URI:http://example.co.uk/ - # - my $next = ; - - # - # Make an array of components, each something like "DNS:example.co.uk" - # - $next =~ s/\s*//g; - my @altNames = split /\s*,\s*/, $next; - # my $altSet = "{" . join(", ", @altNames) . "}"; - # print "Alt set: $altSet\n"; - - # - # Each "DNS" component is an additional name for this certificate. - # - while (@altNames) { - my ($type, $altName) = split(":", pop @altNames); - $names{lc $altName}++ if $type eq 'DNS'; - } - next; - } + # + # Discard blank lines. + # + next if /^\s*$/; + + # + # Handle Entity/KeyName header line. + # + if (/^Entity:/) { + @olines = (); + $printme = 0; + @args = split; + $entity = $args[1]; + $keyname = $args[3]; + + # + # Tidy entity ID if it includes a UK ID as well. + # + if ($entity =~ /^\[(.+)\](.+)$/) { + $entity = $2 . ' (' . $1 . ')'; + } + + # + # Output header line. + # + $oline = "Entity $entity"; + $hasKeyName = !($keyname eq '(none)'); + push(@olines, $oline); + if ($hasKeyName) { + error("descriptor has unexpected KeyName $keyname"); + } + + # + # Start building a new blob. + # + # The blob contains the entity name, so de-duplication + # only occurs within a particular entity and not across + # entities. + # + $blob = $oline; + + # + # Create a temporary file for this certificate in PEM format. + # + ($fh, $filename) = tempfile(UNLINK => 1); + #print "temp file is: $filename\n"; + + # do not buffer output to the temporary file + select((select($fh), $|=1)[0]); + next; + } + + # + # Put other lines into a temporary file. + # + print $fh $_; + $blob .= '|' . $_; + + # + # If this is the last line of the certificate, actually do + # something with it. + # + if (/END CERTIFICATE/) { + # + # Have we seen this blob before? If so, close (and delete) the + # temporary file, and go and look for a new certificate to process. + # + $total_certs++; + if (defined($blobs{$blob})) { + # print "skipping a blob\n"; + close $fh; + next; + } + + # + # Otherwise, remember this blob so that we won't process it again. + # + $blobs{$blob} = 1; + $distinct_certs++; + + # + # Don't close the temporary file yet, because that would cause it + # to be deleted. We've already arranged for buffering to be + # disabled, so the file can simply be passed to other applications + # as input, perhaps multiple times. + # + + # + # Collection of names this certificate contains + # + my %names; + + # + # Use openssl to convert the certificate to text + # + my(@lines, $subject, $issuer, $subjectCN, $issuerCN, $fingerprint); + $cmd = "openssl x509 -in $filename -noout -text -nameopt RFC2253 -modulus -fingerprint|"; + open(SSL, $cmd) || die "could not open openssl subcommand"; + while () { + push @lines, $_; + + if (/^\s*Issuer:\s*(.*)$/) { + $issuer = $1; + if ($issuer =~ /CN=([^,]+)/) { + $issuerCN = $1; + } elsif ($issuer =~ /,OU=VeriSign International Server CA - Class 3,/) { + $issuerCN = 'VeriSign International Server CA - Class 3'; + } else { + $issuerCN = $issuer; + } + next; + } + + if (/^\s*Subject:\s*(.*)$/) { + $subject = $1; + if ($subject =~ /CN=([^,]+)/) { + $subjectCN = $1; + $names{lc $subjectCN}++; + } else { + $subjectCN = $1; + } + next; + } + + # + # Extract the certificate fingerprint. + # + if (/^\s*SHA1 Fingerprint=(.+)$/) { + $fingerprint = uc $1; + if (defined($expiry_whitelist{$fingerprint})) { + $expiry_whitelist{$fingerprint} = 'used'; + } + } + + # + # Extract the public key size. This is displayed differently + # in different versions of OpenSSL. + # + if (/RSA Public Key: \((\d+) bit\)/) { # OpenSSL 0.9x + $pubSize = $1; + next; + } elsif (/^\s*Public-Key: \((\d+) bit\)/) { # OpenSSL 1.0 + $pubSize = $1; + next; + } + + if (/Not After : (.*)$/) { + $notAfter = $1; + $notAfterTime = str2time($notAfter); + + # + # Track certificate expiry year in a way that doesn't + # involve Unix epoch overflow. + # + if ($notAfter =~ /(\d\d\d\d)/) { + my $year = $1; + if ($year > $maxYear) { + $maxYear = $year; + } + if ($year >= 2038) { + $num2038++; + } + } + + # + # Track most distant notAfter. + # + if ($notAfterTime > $lastNotAfterTime) { + $lastNotAfter = $notAfter; + $lastNotAfterTime = $notAfterTime; + $lastNotAfterEntity = $entity; + } + + $days = ($notAfterTime-time())/86400.0; + next; + } + + # + # subjectAlternativeName + # + if (/X509v3 Subject Alternative Name:/) { + # + # Steal the next line, which will look like this: + # + # DNS:www.example.co.uk, DNS:example.co.uk, URI:http://example.co.uk/ + # + my $next = ; + + # + # Make an array of components, each something like "DNS:example.co.uk" + # + $next =~ s/\s*//g; + my @altNames = split /\s*,\s*/, $next; + # my $altSet = "{" . join(", ", @altNames) . "}"; + # print "Alt set: $altSet\n"; + + # + # Each "DNS" component is an additional name for this certificate. + # + while (@altNames) { + my ($type, $altName) = split(":", pop @altNames); + $names{lc $altName}++ if $type eq 'DNS'; + } + next; + } # # Track distinct RSA moduli @@ -319,114 +319,118 @@ sub comment { # print " modulus: '$modulus'\n"; $rsa_modulus{$modulus} = 1; } - } - close SSL; - #print " text lines: $#lines\n"; - - # - # Deal with certificate expiry. - # - if ($days < -$longExpiredDays) { - my $d = floor(-$days); - if (defined($expiry_whitelist{$fingerprint})) { - comment("EXPIRED LONG AGO ($d days; $notAfter)"); - } else { - error("EXPIRED LONG AGO ($d days; $notAfter)"); - comment("fingerprint $fingerprint"); - } - } elsif ($days < 0) { - if (defined($expiry_whitelist{$fingerprint})) { - comment("EXPIRED ($notAfter)"); - } else { - error("EXPIRED ($notAfter)"); - comment("fingerprint $fingerprint"); - } - } elsif ($days < $daysBeforeError) { - $days = int($days); - error("expires in $days days ($notAfter)"); - } elsif ($days < $daysBeforeWarning) { - $days = int($days); - warning("expires in $days days ($notAfter)"); - } - - - # - # Handle public key size. - # - $pubSizeCount{$pubSize}++; - # print " Public key size: $pubSize\n"; - - # - # Close the temporary file, which will also cause - # it to be deleted. - # - close $fh; - - # - # Count issuers. - # - if ($issuer eq $subject) { - $issuers{'(self-signed certificate)'}++; - } else { - $issuers{'Other'}++; - } - - # - # Print any interesting things related to this certificate. - # - if ($printme) { - foreach $oline (@olines) { - print $oline, "\n"; - } - print "\n"; - } - - } + } + close SSL; + #print " text lines: $#lines\n"; + + # + # Deal with certificate expiry. + # + if ($days < -$longExpiredDays) { + my $d = floor(-$days); + if (defined($expiry_whitelist{$fingerprint})) { + comment("EXPIRED LONG AGO ($d days; $notAfter)"); + } else { + error("EXPIRED LONG AGO ($d days; $notAfter)"); + comment("fingerprint $fingerprint"); + } + } elsif ($days < 0) { + if (defined($expiry_whitelist{$fingerprint})) { + comment("EXPIRED ($notAfter)"); + } else { + error("EXPIRED ($notAfter)"); + comment("fingerprint $fingerprint"); + } + } elsif ($days < $daysBeforeError) { + $days = int($days); + error("expires in $days days ($notAfter)"); + } elsif ($days < $daysBeforeWarning) { + $days = int($days); + warning("expires in $days days ($notAfter)"); + } + + + # + # Handle public key size. + # + $pubSizeCount{$pubSize}++; + # print " Public key size: $pubSize\n"; + + # + # Close the temporary file, which will also cause + # it to be deleted. + # + close $fh; + + # + # Count issuers. + # + if ($issuer eq $subject) { + $issuers{'(self-signed certificate)'}++; + } else { + $issuers{'Other'}++; + } + + # + # Print any interesting things related to this certificate. + # + if ($printme) { + foreach $oline (@olines) { + print $oline, "\n"; + } + print "\n"; + } + + } } if ($distinct_certs > 1) { - print "Total certificates: $total_certs\n"; - if ($distinct_certs != $total_certs) { - print "Distinct certificate/entity combinations: $distinct_certs\n"; - } - print "\n"; - - print "Key size distribution:\n"; - for $pubSize (sort keys %pubSizeCount) { - $count = $pubSizeCount{$pubSize}; - print " $pubSize: $count\n"; - } - print "\n"; - - print "Most distant certificate expiry: $lastNotAfter on $lastNotAfterEntity\n"; - print "Maximum certificate expiry year: $maxYear\n"; - if ($num2038 > 0) { - print "Certificates expiring during or after 2038: $num2038\n"; - } - print "\n"; - - print "Certificate issuers:\n"; - foreach $issuer (sort keys %issuers) { - my $count = $issuers{$issuer}; - my $mark = $issuerMark{$issuer} ? $issuerMark{$issuer}: ' '; - print " $mark $issuer: $count\n"; - } - print "\n"; + print "Total certificates: $total_certs\n"; + if ($distinct_certs != $total_certs) { + print "Distinct certificate/entity combinations: $distinct_certs\n"; + } + print "\n"; + + print "Key size distribution:\n"; + for $pubSize (sort keys %pubSizeCount) { + $count = $pubSizeCount{$pubSize}; + print " $pubSize: $count\n"; + } + print "\n"; + + print "Most distant certificate expiry: $lastNotAfter on $lastNotAfterEntity\n"; + print "Maximum certificate expiry year: $maxYear\n"; + if ($num2038 > 0) { + print "Certificates expiring during or after 2038: $num2038\n"; + } + print "\n"; + + print "Certificate issuers:\n"; + foreach $issuer (sort keys %issuers) { + my $count = $issuers{$issuer}; + my $mark = $issuerMark{$issuer} ? $issuerMark{$issuer}: ' '; + print " $mark $issuer: $count\n"; + } + print "\n"; $distinct_moduli = scalar keys %rsa_modulus; if ($distinct_moduli > 1) { print "Distinct RSA moduli: $distinct_moduli\n"; } - my $first = 1; - foreach $fingerprint (sort keys %expiry_whitelist) { - if ($expiry_whitelist{$fingerprint} eq 'unused') { - if ($first) { - $first = 0; - print "\n"; - print "Unused expiry whitelist fingerprints:\n"; - } - print " $fingerprint\n"; - } - } + if (%expiry_whitelist) { + print "\n"; + my $nwhite = scalar(keys(%expiry_whitelist)); + print "Expiry whitelist size: $nwhite\n"; + } + my $first = 1; + foreach $fingerprint (sort keys %expiry_whitelist) { + if ($expiry_whitelist{$fingerprint} eq 'unused') { + if ($first) { + $first = 0; + print "Unused expiry whitelist fingerprints:\n"; + } + print " $fingerprint\n"; + } + } } diff --git a/utilities/contacts-from-sf.sh b/utilities/contacts-from-sf.sh new file mode 100755 index 00000000..18fb219e --- /dev/null +++ b/utilities/contacts-from-sf.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# This script processes a Salesforce report "UKfed-contacts-export" which lists all contacts with +# UK Federation Contact Roles and their corresponding Jisc Organisation ID (ukforg) and Organisation Name +# +# The current report can be found here https://eu3.salesforce.com/00Ow0000007MXhK, it needs to be exported as a CSV file +# which ends up as 'reportnnnnnnnnnnnnn.csv' +# +# The input to the script is the above CSV file. +# +# The output of the script is as follows; +# +# * A copy of the Salesforce report in $CSVDEST +# * A list of Management Contact email addresses in $MGMTDEST +# * A list of all contact email addresses in $CONTACTDEST +# +# To use this script please follow the process here; +# +# https://repo.infr.ukfederation.org.uk/ukf/ukf-systems/wikis/HOW-to-process-UKfed-contacts-export-report +# +# Author: Jon Agland +# + +SFREPORTNAME="UKfed-contacts-export" +CSVDEST=../../ukf-data/contacts/sf-contacts.csv +CONTACTDEST=../../ukf-data/contacts/sf-contacts.txt +MGMTDEST=../../ukf-data/contacts/sf-contacts-mc.txt + +if [ -z "$1" ]; then + echo "ERROR: No file name supplied" + exit 1 +fi + +if [ ! -f "$1" ]; then + echo "ERROR: file $1 does not exist" + exit 1 +fi + +if ! grep -q \"$SFREPORTNAME\" $1; then + echo "ERROR: this doesn't appear to be the output of $SFREPORTNAME" + exit 2 +fi + +cat $1 | awk -F\, '{ print $1 }' | grep @ | sed -e 's/\"//g' | sort -u > $CONTACTDEST +grep "\,\"UK Federation Management Contact\"" $1 | awk -F\, '{ print $1 }' | grep @ | sed -e 's/\"//g' | sort -u > $MGMTDEST + +cp $1 $CSVDEST + diff --git a/utilities/list_addresses.pl b/utilities/list_addresses.pl new file mode 100755 index 00000000..77841152 --- /dev/null +++ b/utilities/list_addresses.pl @@ -0,0 +1,164 @@ +#!/usr/bin/perl -w +# +# Script to extract technical and administrative contact email addresses +# from a SAML metadata file, and add extra addresses from a well-known location. +# +# Author: Alex Stuart, alex.stuart@jisc.ac.uk +# + +# +# Parameters +# + +# An EntitiesDescriptor of all UKF-registered entities +$metadata = '../mdx/uk/collected.xml'; + +# A file of email addresses for people who have opted-in to the list +$extra_addresses = '../../ukf-data/members/extra_addresses.txt'; + +# Default list of contacts from Salesforce, processed by contacts-from-sf.sh +$sf_contacts = '../../ukf-data/contacts/sf-contacts-mc.txt'; + +# +# Subroutines +# +use Getopt::Long; +use XML::LibXML; + +sub usage { + print <] [--security] [--mc] [-c ] + + -h - prints this help text and exits + -f - takes metadata from this file, not the pre-defined file + --security - also extract the security contacts + --mc - add Management Contacts from a well-known location + -c - Use this contacts file not the well-known location + + Extracts email addresses of contacts in a metadata file. + + By default, this extracts the technical and administrative contacts + from the metadata file, and includes extra addresses. + +EOF +} + +# +# Options processing +# +my $help; +my $file; +my $security; +my $mc; +my $contacts = $sf_contacts; +GetOptions( "help" => \$help, + "file=s" => \$file, + "security" => \$security, + "mc" => \$mc, + "c:s" => \$contacts + ); + +if ( $help ) { + usage(); + exit 0; +} + +if ( $file ) { + $metadata = $file; +} + +if ( ! $metadata ) { + print "ERROR: could not find metadata file $metadata\n"; + usage(); + exit 1; +} + +if ( ! -r $metadata ) { + print "ERROR: metadata file $metadata must be readable\n"; + usage(); + exit 2; +} + + +# +# Extract addresses from metadata file +# +my $dom = XML::LibXML->load_xml( location => $metadata ); +my $xpc = XML::LibXML::XPathContext->new( $dom ); +$xpc->registerNs( 'md', 'urn:oasis:names:tc:SAML:2.0:metadata' ); +@tech_contacts = $xpc->findnodes( '//md:EntityDescriptor/md:ContactPerson/md:EmailAddress[../@contactType="technical"]'); +foreach( @tech_contacts ) { + $email = ${_}->to_literal; + $email =~ s/^mailto://i; + $metadata{$email} = 1; +} + + +@admin_contacts = $xpc->findnodes( '//md:EntityDescriptor/md:ContactPerson/md:EmailAddress[../@contactType="administrative"]'); +foreach( @admin_contacts ) { + $email = ${_}->to_literal; + $email =~ s/^mailto://i; + $metadata{$email} = 1; +} + +if ( $security ) { + $xpc->registerNs( 'remd', 'http://refeds.org/metadata' ); + @security_contacts = $xpc->findnodes( '//md:EntityDescriptor/md:ContactPerson/md:EmailAddress + [../@contactType="other"] + [../@remd:contactType="http://refeds.org/metadata/contactType/security"]' + ); + foreach( @security_contacts ) { + $email = ${_}->to_literal; + $email =~ s/^mailto://i; + $metadata{$email} = 1; + } +} + +# +# Load extra addresses. +# +# One extra address per line. Blank lines and lines starting with '#' are +# ignored. +# +open(EXTRAS, "$extra_addresses") || die "could not open extra addresses file $extra_addresses"; +while () { + chomp; # remove \n + next if /^#/; + $extras{$_} = 1 unless $_ eq ''; +} +close EXTRAS; + +# +# Now figure out the addresses we want to see in the mailing list. +# Make them lower case for comparisons. +# +foreach $addr (keys %extras) { + $wanted{lc $addr} = $addr; +} +foreach $addr (keys %metadata) { + $wanted{lc $addr} = $addr; +} + +# +# And if we want to include Management Contact emails too +# +if ( $mc ) { + open(SFCONTACTS, "$contacts") || die "could not open contacts file $contacts"; + while () { + chomp; + $sfcontacts{$_} = 1 unless $_ eq ''; + } + close SFCONTACTS; + foreach $addr (keys %sfcontacts) { + $wanted{lc $addr} = $addr; + } +} + +# +# List all wanted addresses. +# +foreach $addr (sort keys %wanted) { + my $a = $wanted{$addr}; + print "$a\n"; +} diff --git a/utilities/stats-generate.sh b/utilities/stats-generate.sh index 2debef68..da9c4463 100755 --- a/utilities/stats-generate.sh +++ b/utilities/stats-generate.sh @@ -179,18 +179,18 @@ fi # Get the filesize of the latest uncompressed main aggregate. # Since this is just used for estimation, we'll just take the biggest # unique filesize for the relevant periods -aggrfilesizebytes=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | grep -v "GZIP" | cut -f 10 -d " " | sort -r | uniq | head -1) +aggrfilesizebytes=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | grep -v "GZIP" | cut -f 10 -d " " | sort -r | uniq | head -1) # # Download counts # # Aggregate requests. Everything for .xml (HEAD/GET, 200 and 304) -mdaggrcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | wc -l) +mdaggrcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | wc -l) mdaggrcountfriendly=$(echo $mdaggrcount | awk '{ printf ("%'"'"'d\n", $0) }') # Main Aggregate requests. Everything for ukfederation-metadata.xml (HEAD/GET, 200 and 304) -mdaggrmaincount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | wc -l) +mdaggrmaincount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | wc -l) mdaggrmaincountfriendly=$(echo $mdaggrmaincount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrmaincount" -ne "0" ]]; then mdaggrmainpc=$(echo "scale=4;($mdaggrmaincount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') @@ -200,42 +200,42 @@ fi # Other aggregate requests (don't calculate these if doing daily stats) if [[ "$timeperiod" != "day" ]]; then - mdaggrbackcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-back.xml" | wc -l) + mdaggrbackcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-back.xml" | wc -l) mdaggrbackcountfriendly=$(echo $mdaggrbackcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrbackcount" -ne "0" ]]; then mdaggrbackpc=$(echo "scale=4;($mdaggrbackcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') else mdaggrbackpc="0.0" fi - mdaggrcdsallcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-cdsall.xml" | wc -l) + mdaggrcdsallcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-cdsall.xml" | wc -l) mdaggrcdsallcountfriendly=$(echo $mdaggrcdsallcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrcdsallcount" -ne "0" ]]; then mdaggrcdsallpc=$(echo "scale=4;($mdaggrcdsallcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') else mdaggrcdsallpc="0.0" fi - mdaggrexportpreviewcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-export-preview.xml" | wc -l) + mdaggrexportpreviewcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-export-preview.xml" | wc -l) mdaggrexportpreviewcountfriendly=$(echo $mdaggrexportpreviewcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrexportpreviewkcount" -ne "0" ]]; then mdaggrexportpreviewpc=$(echo "scale=4;($mdaggrexportpreviewcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') else mdaggrexportpreviewpc="0.0" fi - mdaggrexportcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-export.xml" | wc -l) + mdaggrexportcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-export.xml" | wc -l) mdaggrexportcountfriendly=$(echo $mdaggrexportcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrexportcount" -ne "0" ]]; then mdaggrexportpc=$(echo "scale=4;($mdaggrexportcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') else mdaggrexportpc="0.0" fi - mdaggrtestcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-test.xml" | wc -l) + mdaggrtestcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-test.xml" | wc -l) mdaggrtestcountfriendly=$(echo $mdaggrtestcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrtestcount" -ne "0" ]]; then mdaggrtestpc=$(echo "scale=4;($mdaggrtestcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') else mdaggrtestpc="0.0" fi - mdaggrwayfcount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-wayf.xml" | wc -l) + mdaggrwayfcount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-wayf.xml" | wc -l) mdaggrwayfcountfriendly=$(echo $mdaggrwayfcount | awk '{ printf ("%'"'"'d\n", $0) }') if [[ "$mdaggrwayfcount" -ne "0" ]]; then mdaggrwayfpc=$(echo "scale=4;($mdaggrwayfcount/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') @@ -245,11 +245,11 @@ if [[ "$timeperiod" != "day" ]]; then fi # Aggregate downloads (i.e. GETs with HTTP 200 responses only) -mdaggrcountfull=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404| grep "\" 200" | grep "GET" | wc -l) +mdaggrcountfull=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404| grep "\" 200" | grep "GET" | wc -l) mdaggrcountfullfriendly=$(echo $mdaggrcountfull | awk '{ printf ("%'"'"'d\n", $0) }') # Main Aggregate downloads (i.e. GETs with HTTP 200 responses only) -mdaggrmaincountfull=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | wc -l) +mdaggrmaincountfull=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | wc -l) mdaggrmaincountfullfriendly=$(echo $mdaggrmaincountfull | awk '{ printf ("%'"'"'d\n", $0) }') # Percentage of GETs with HTTP 200 responses compared to total requests @@ -260,11 +260,11 @@ else fi # Compressed downloads for all -mdaggrcountfullcompr=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) +mdaggrcountfullcompr=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) mdaggrcountfullcomprfriendly=$(echo $mdaggrcountfullcompr | awk '{ printf ("%'"'"'d\n", $0) }') # Compressed downloads for main aggregate -mdaggrmaincountfullcompr=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) +mdaggrmaincountfullcompr=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) # Percentage of GZIPPED HTTP 200 responses compared to total full downloads if [[ "$mdaggrcountfull" -ne "0" ]]; then @@ -274,18 +274,18 @@ else fi # Unique IP addresses requesting aggregates -mdaggruniqueip=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) +mdaggruniqueip=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) mdaggruniqueipfriendly=$(echo $mdaggruniqueip | awk '{ printf ("%'"'"'d\n", $0) }') # Unique IP addresses requesting aggregates, full D/Ls only -mdaggruniqueipfull=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) +mdaggruniqueipfull=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) # # Data shipped # # Total data shipped, all .xml files -mdaggrtotalbytes=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 10 -d " " | awk '{sum+=$1} END {print sum}') +mdaggrtotalbytes=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 10 -d " " | awk '{sum+=$1} END {print sum}') if [[ "$mdaggrtotalbytes" -gt "0" ]]; then mdaggrtotalhr=$(bytestohr $mdaggrtotalbytes) else @@ -293,7 +293,7 @@ else fi # Total data shipped, ukfederation-metadata.xml file -mdaggrmaintotalbytes=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | cut -f 10 -d " " | awk '{sum+=$1} END {print sum}') +mdaggrmaintotalbytes=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "ukfederation-metadata.xml" | grep "\" 200" | grep "GET" | cut -f 10 -d " " | awk '{sum+=$1} END {print sum}') if [[ "$mdaggrtotalbytes" -gt "0" ]]; then mdaggrmaintotalhr=$(bytestohr $mdaggrmaintotalbytes) else @@ -323,32 +323,32 @@ fi # IPv4 vs IPv6 traffic (don't calculate these if doing daily stats) # Some v6 traffic has traditionally passed through v6v4proxy1/2, so to count v4 we're counting all accesses, minus those from the v4 proxy IP addresses, minus actual v6 addresses if [[ "$timeperiod" != "day" ]]; then - mdaggrv4count=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep -v ":" | wc -l) + mdaggrv4count=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep -v ":" | wc -l) mdaggrv4pc=$(echo "scale=4;($mdaggrv4count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') mdaggrv6count=$(( mdaggrcount - mdaggrv4count )) mdaggrv6pc=$(echo "scale=4;($mdaggrv6count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') # Per-server request count - mdaggrmd1count=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmd1count=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmd1pc=$(echo "scale=4;($mdaggrmd1count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmd2count=$(grep $apachesearchterm $logslocation/md/md2/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmd2count=$(grep -s $apachesearchterm $logslocation/md/md2/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmd2pc=$(echo "scale=4;($mdaggrmd2count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmd3count=$(grep $apachesearchterm $logslocation/md/md3/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmd3count=$(grep -s $apachesearchterm $logslocation/md/md3/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmd3pc=$(echo "scale=4;($mdaggrmd3count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmdne01count=$(grep $apachesearchterm $logslocation/md/md-ne-01/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmdne01count=$(grep -s $apachesearchterm $logslocation/md/md-ne-01/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmdne01pc=$(echo "scale=4;($mdaggrmdne01count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmdne02count=$(grep $apachesearchterm $logslocation/md/md-ne-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmdne02count=$(grep -s $apachesearchterm $logslocation/md/md-ne-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmdne02pc=$(echo "scale=4;($mdaggrmdne02count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmdwe01count=$(grep $apachesearchterm $logslocation/md/md-we-01/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmdwe01count=$(grep -s $apachesearchterm $logslocation/md/md-we-01/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmdwe01pc=$(echo "scale=4;($mdaggrmdwe01count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') - mdaggrmdwe02count=$(grep $apachesearchterm $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) + mdaggrmdwe02count=$(grep -s $apachesearchterm $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 5 -d "/" | wc -l) mdaggrmdwe02pc=$(echo "scale=4;($mdaggrmdwe02count/$mdaggrcount)*100" | bc | awk '{printf "%.1f\n", $0}') fi # Min queries per IP if [[ $mdaggrcount -gt "0" ]]; then - mdaggrminqueriesperip=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdaggrminqueriesperip=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdaggrinqueriesperip="0" fi @@ -362,14 +362,14 @@ fi # Max queries per IP if [[ $mdaggrcount -gt "0" ]]; then - mdaggrmaxqueriesperip=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdaggrmaxqueriesperip=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdaggrmaxqueriesperip="0" fi # Min queries per IP, full D/L only if [[ $mdaggrcountfull -gt "0" ]]; then - mdaggrminqueriesperipfull=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdaggrminqueriesperipfull=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdaggrinqueriesperipfull="0" fi @@ -383,7 +383,7 @@ fi # Max queries per IP, full D/L only if [[ $mdaggrcountfull -gt "0" ]]; then - mdaggrmaxqueriesperipfull=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdaggrmaxqueriesperipfull=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdaggrmaxqueriesperipfull="0" fi @@ -393,7 +393,7 @@ if [[ "$timeperiod" != "day" ]]; then # Top 10 downloaders and how many downloads / total data shipped (full downloads only) if [[ "$timeperiod" != "day" ]]; then - mdaggrtoptenipsbycount=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -10) + mdaggrtoptenipsbycount=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -10) fi # @@ -415,7 +415,7 @@ if [[ "$timeperiod" != "day" ]]; then countfriendly=$(echo $count | awk '{ printf ("%'"'"'d\n", $0) }') # Figure out total traffic shipped to this IP - totaldataforthisip=$(grep $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep $ipaddr | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') + totaldataforthisip=$(grep -s $apachesearchterm $logslocation/md/md1/metadata.uou-access_log* $logslocation/md/md2/metadata.uou-access_log* $logslocation/md/md3/metadata.uou-access_log* $logslocation/md/md-ne-01/metadata.uou-access_log* $logslocation/md/md-ne-02/metadata.uou-access_log* $logslocation/md/md-we-01/metadata.uou-access_log* $logslocation/md/md-we-02/metadata.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep ".xml" | grep -v 404 | grep "\" 200" | grep "GET" | grep $ipaddr | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') if [[ "$totaldataforthisip" -gt "0" ]]; then totaldataforthisiphr=$(bytestohr $totaldataforthisip) else @@ -443,11 +443,11 @@ fi # ===== # MDQ requests -mdqcount=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep -v 404 | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | wc -l) +mdqcount=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep -v 404 | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | wc -l) mdqcountfriendly=$(echo $mdqcount | awk '{ printf ("%'"'"'d\n", $0) }') # MDQ downloads (i.e. HTTP 200 responses only) -mdqcountfull=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep "GET" | wc -l) +mdqcountfull=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep "GET" | wc -l) mdqcountfullfriendly=$(echo $mdqcountfull | awk '{ printf ("%'"'"'d\n", $0) }') # Percentage of HTTP 200 responses compared to total requests @@ -458,7 +458,7 @@ else fi # Compressed downloads -mdqfullcomprcount=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) +mdqfullcomprcount=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep "GET" | grep "\"GZIP\"" | wc -l) mdqfullcomprcountfriendly=$(echo $mdqfullcomprcount | awk '{ printf ("%'"'"'d\n", $0) }') # Percentage of GZIPPED HTTP 200 responses compared to total full downloads @@ -474,7 +474,7 @@ fi if [[ "$timeperiod" != "day" ]]; then # Some v6 traffic has traditionally passed through v6v4proxy1/2, so to count v4 we're counting all accesses, minus those from the v4 proxy IP addresses, minus actual v6 addresses if [[ "$mdqcount" -ne "0" ]]; then - mdqv4count=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep -v ":" | wc -l) + mdqv4count=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep -v ":" | wc -l) mdqv4pc=$(echo "scale=4;($mdqv4count/$mdqcount)*100" | bc | awk '{printf "%.1f\n", $0}') mdqv6count=$(( mdqcount - mdqv4count )) mdqv6pc=$(echo "scale=4;($mdqv6count/$mdqcount)*100" | bc | awk '{printf "%.1f\n", $0}') @@ -485,8 +485,8 @@ if [[ "$timeperiod" != "day" ]]; then fi # MDQ requests for entityId based names -mdqcountentityidhttp=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/http" | wc -l) -mdqcountentityidurn=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/urn" | wc -l) +mdqcountentityidhttp=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/http" | wc -l) +mdqcountentityidurn=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/urn" | wc -l) mdqcountentityid=$((mdqcountentityidhttp+mdqcountentityidurn)) if [[ "$mdqcount" -ne "0" ]]; then mdqcountentityidpc=$(echo "scale=3;($mdqcountentityid/$mdqcount)*100" | bc | awk '{printf "%.1f\n", $0}') @@ -496,7 +496,7 @@ fi mdqcountentityidfriendly=$(echo $mdqcountentityid | awk '{ printf ("%'"'"'d\n", $0) }') # MDQ requests for hash based names -mdqcountsha1=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep sha1 | wc -l) +mdqcountsha1=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep sha1 | wc -l) if [[ "$mdqcount" -ne "0" ]]; then mdqcountsha1pc=$(echo "scale=3;($mdqcountsha1/$mdqcount)*100" | bc | awk '{printf "%.1f\n", $0}') else @@ -506,14 +506,14 @@ mdqcountsha1friendly=$(echo $mdqcountsha1 | awk '{ printf ("%'"'"'d\n", $0) }') # MDQ requests for all entities -mdqcountallentities=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities " | grep -v 404 | wc -l) +mdqcountallentities=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities " | grep -v 404 | wc -l) # Unique IP addresses requesting MDQ -mdquniqueip=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) +mdquniqueip=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq | wc -l) mdquniqueipfriendly=$(echo $mdquniqueip | awk '{ printf ("%'"'"'d\n", $0) }') # Total data shipped -mdqtotalbytes=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') +mdqtotalbytes=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') if [[ "$mdqtotalbytes" -gt "0" ]]; then mdqtotalhr=$(bytestohr $mdqtotalbytes) else @@ -522,7 +522,7 @@ fi # Min queries per IP if [[ $mdqcount -gt "0" ]]; then - mdqminqueriesperip=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v 404 | grep -v "/entities/ " | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdqminqueriesperip=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v 404 | grep -v "/entities/ " | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | tail -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdqminqueriesperip="0" fi @@ -536,14 +536,14 @@ fi # Max queries per IP if [[ $mdqcount -gt "0" ]]; then - mdqmaxqueriesperip=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v 404 | grep -v "/entities/ " | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') + mdqmaxqueriesperip=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities" | grep -v 404 | grep -v "/entities/ " | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -1 | awk '{print $1}' | awk '{ printf ("%'"'"'d\n", $0) }') else mdqmaxqueriesperip="0" fi if [[ "$timeperiod" != "day" ]]; then # Top 10 downloaders and how many downloads / total data shipped - mdqtoptenipsbycount=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep "/entities" | grep -v "/entities/ " | grep -v 404 | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -10) + mdqtoptenipsbycount=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep -v 193.63.72.83 | grep -v 194.83.7.211 | grep "/entities" | grep -v "/entities/ " | grep -v 404 | grep -v "/entities/ " | cut -f 1 -d " " | cut -f 2-9 -d ":" | sort | uniq -c | sort -nr | head -10) # # Manipute results of the top 10 @@ -564,7 +564,7 @@ if [[ "$timeperiod" != "day" ]]; then countfriendly=$(echo $count | awk '{ printf ("%'"'"'d\n", $0) }') # Figure out total traffic shipped to this IP - totaldataforthisip=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep $ipaddr | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') + totaldataforthisip=$(grep -s $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep "/entities/" | grep -v "/entities/ " | grep -v 404 | grep "\" 200" | grep $ipaddr | cut -f 10 -d " " | grep -v - | awk '{sum+=$1} END {print sum}') if [[ "$totaldataforthisip" -gt "0" ]]; then totaldataforthisiphr=$(bytestohr $totaldataforthisip) else @@ -587,7 +587,7 @@ if [[ "$timeperiod" != "day" ]]; then # Top 10 queries and how many downloads / total data shipped - mdqtoptenqueriesbycount=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* $logslocation/md/md-ne-01/mdq.uou-access_log* $logslocation/md/md-ne-02/mdq.uou-access_log* $logslocation/md/md-we-01/mdq.uou-access_log* $logslocation/md/md-we-02/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer|monitis)" | grep /entities/ | grep -v 404 | grep -v "/entities/ " | grep -v "/entities/ " | awk '{print $7}' | cut -f 3 -d "/" | sed "s@+@ @g;s@%@\\\\x@g" | printf "%b\n" $(