This one time, at band camp, Paolo Lucente wrote:
>Hello Jamie,
>
>On Thu, Aug 18, 2005 at 12:27:30PM +1000, Jamie Wilkinson wrote:
>
>> I'm testing out 0.9.1 at the moment, and have a question about the stats
>> when pmacctd receives SIGUSR1.
>> 
>> Is the first number in parentheses the unix time of the log message?
>
>Precisely ! I've thought it might be useful when analyzing the log.
>A script can take the current time; send the signal; and parse the log 
>searching for the saved timestamp.

I've got a patch that also puts the interface name in the log, because I run
a couple of pmacctds on different interfaces.

--- orig/signals.c
+++ mod/signals.c
@@ -147,8 +147,8 @@
   if (config.acct_type == ACCT_PM) {
     if (config.dev) {
       if (pcap_stats(glob_pcapt, &ps) < 0) Log(LOG_INFO, "\npcap_stats: %s\n", 
pcap_geterr(glob_pcapt));
-      Log(LOG_NOTICE, "\n(%u) %u packets received by filter\n", now, 
ps.ps_recv);
-      Log(LOG_NOTICE, "(%u) %u packets dropped by kernel\n", now, ps.ps_drop);
+      Log(LOG_NOTICE, "\n%s (%u) %u packets received by filter\n", config.dev, 
now, ps.ps_recv);
+      Log(LOG_NOTICE, "%s (%u) %u packets dropped by kernel\n", config.dev, 
now, ps.ps_drop);
     }
   }


Reply via email to