#!/moira/bin/perl
# $Header$
-chdir($ARGV[1]);
+chdir($ARGV[0]);
($sec, $min, $hour, $mday, $month) = localtime($^T);
@MONTHS = ( "Jan", "Feb", "Mar", "Apr", "May", "Jun",
undef %TYPES;
-open(CLUSTERS, "cluster") || die "Cannot open cluster file for input.\n";
+open(CLUSTERS, "clusters") || die "Cannot open clusters file for input.\n";
$total = 0;
printf("%5d Clusters\n\n", $total);
-open(PRINTCAP, "printcap") || die "Cannot open printcap file for input.\n";
+open(PRINTERS, "printers") || die "Cannot open printers file for input.\n";
$total = 0;
-while (<PRINTCAP>) {
- split(/\|/, $_, 7);
- if ($_[5]) { $auth++; }
+while (<PRINTERS>) {
+ split(/\|/, $_, 11);
+ if ($_[9]) { $auth++; }
$total++;
}
-close(PRINTCAP);
+close(PRINTERS);
printf("%5d Printers, %d with authentication (%d%%).\n\n", $total, $auth,
(100 * $auth + $total/2)/$total);
while (<USERS>) {
s/\|/\e/g; s/\\\e/\|/g;
- split(/\e/, $_, $27);
- $total++; $STATUS{$_[7]}++;
- if ($_[7] != 3) { $classtotal++; $CLASS{$_[9]}++; }
- if ($_[7] == 1) { $CLASSA{$_[9]}++; }
- if ($_[7] == 1 || $_[7] == 6) { $pototal++; $POTYPE{$_[25]}++; }
+ split(/\e/, $_, 28);
+ $total++; $STATUS{$_[8]}++;
+ if ($_[8] != 3) { $classtotal++; $CLASS{$_[10]}++; }
+ if ($_[8] == 1) { $CLASSA{$_[10]}++; }
+ if ($_[8] == 1 || $_[8] == 6) { $pototal++; $POTYPE{$_[26]}++; }
}
close(USERS);