innreport nnrpd_resource is not working
Kenichi Okada
okada at opaopa.org
Tue Jul 9 20:26:08 UTC 2002
Hi,
I use inn-CURRENT-20020609.
nnrpd_resource is not working on innreport_inn.pm.
Old style (inn-stable):
/(\S+) times user (\S+) system (\S+) elapsed (\S+)$/
New Style (inn-current):
/(\S+) times user (\S+) system (\S+) idle (\S+) elapsed (\S+)$/
This patch is a fix for the nnrpd_resource bug and a kludge for
which records user names at authinfo.
--
Kenichi Okada
mailto:okada at opaopa.org
--- samples/innreport.conf.in-orig Thu Jul 4 02:00:02 2002
+++ samples/innreport.conf.in Thu Jul 4 02:03:23 2002
@@ -2113,21 +2113,67 @@
};
};
+section nnrpd_auth {
+ title "NNRP auth users:";
+ data "%nnrpd_auth";
+ top 20;
+ sort "$nnrpd_auth{$b} <=> $nnrpd_auth{$a}";
+ column {
+ name "User";
+ format "%-71.71s";
+ value "$key";
+ format_total "TOTAL: %-64.64s";
+ total "$num";
+ };
+ column {
+ name "Conn";
+ format_name "%7s";
+ format "%7d";
+ value "$nnrpd_auth{$key}";
+ total "total(%nnrpd_auth)";
+ };
+};
+
section nnrpd_resource {
title "NNRP total resource statistics:";
- data "%nnrpd_resource";
+ data "%nnrpd_resource_elapsed";
+ top 20;
+ sort "$nnrpd_resource_elapsed{$b} <=> $nnrpd_resource_elapsed{$a}";
column {
- name "User";
- format_name "%10s";
- format "%10.3f";
+ name "System";
+ format "%-40.40s";
+ format_total "TOTAL: %-33.33s";
value "$key";
+ total "$num";
};
column {
- name "Time";
- format_name "%10s";
- format "%13s";
- value "time_ms($nnrpd_resource{$key})";
+ name "User(ms)";
+ format_name "%9s";
+ format "%9.3f";
+ value "$nnrpd_resource_user{$key}";
+ total "total(%nnrpd_resource_user)";
};
+ column {
+ name "System(ms)";
+ format_name "%9s";
+ format "%9.3f";
+ value "$nnrpd_resource_system{$key}";
+ total "total(%nnrpd_resource_system)";
+ };
+ column {
+ name "Idle(ms)";
+ format_name "%9s";
+ format "%9.3f";
+ value "$nnrpd_resource_idle{$key}";
+ total "total(%nnrpd_resource_idle)";
+ };
+ column {
+ name "Elapsed";
+ format_name "%8s";
+ format "%9s";
+ value "time($nnrpd_resource_elapsed{$key})";
+ total "time(total(%nnrpd_resource_elapsed))";
+ };
};
section nnrpd_curious {
--- scripts/innreport_inn.pm-orig Thu Jul 4 02:04:16 2002
+++ scripts/innreport_inn.pm Thu Jul 4 02:05:12 2002
@@ -1261,6 +1261,12 @@
$nnrpd_no_permission{$cust}++;
return 1;
}
+ # authinfo
+ if ($left =~ /\S+ user (\S+)$/o) {
+ my $user = $1;
+ $nnrpd_auth{$user}++;
+ return 1;
+ }
# unrecognized + command
if ($left =~ /(\S+) unrecognized (.*)$/o) {
my ($cust, $error) = ($1, $2);
@@ -1286,14 +1292,15 @@
return 1;
}
# times
- if ($left =~ /(\S+) times user (\S+) system (\S+) elapsed (\S+)$/o) {
- my ($cust, $user, $system, $elapsed) = ($1, $2, $3, $4);
+ if ($left =~ /(\S+) times user (\S+) system (\S+) idle (\S+) elapsed (\S+)$/o) {
+ my ($cust, $user, $system, $idle, $elapsed) = ($1, $2, $3, $4, $5);
$cust = lc $cust unless $CASE_SENSITIVE;
my $dom = &host2dom($cust);
$nnrpd_times{$cust} += $elapsed;
- $nnrpd_resource{'user'} += $user;
- $nnrpd_resource{'sys'} += $system;
- $nnrpd_resource{'elapsed'} += $elapsed;
+ $nnrpd_resource_user{$cust} += $user;
+ $nnrpd_resource_system{$cust} += $system;
+ $nnrpd_resource_idle{$cust} += $idle;
+ $nnrpd_resource_elapsed{$cust} += $elapsed;
$nnrpd_dom_times{$dom} += $elapsed;
return 1;
}
--
Kenichi Okada
mailto:okada at opaopa.org
More information about the inn-workers
mailing list