----- Original Message ----- From: "Philippe Pegon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Pierre DAVID" <[EMAIL PROTECTED]>; <courier-imap@lists.sourceforge.net>
Sent: Monday, April 03, 2006 7:07 AM
Subject: Re: [Courier-imap] How to count distinct users?


[EMAIL PROTECTED] wrote:

----- Original Message ----- From: "Pierre DAVID" <[EMAIL PROTECTED]>
To: <courier-imap@lists.sourceforge.net>
Sent: Monday, April 03, 2006 1:37 AM
Subject: [Courier-imap] How to count distinct users?


Hi,

for our stats, we would like to count the number of distinct users
connected through IMAP/IMAPS/POP/POP3S.

Our settings:
FreeBSD 6.0-RELEASE-p6
courier-imap 4.1.0
courier-authlib 0.58
~ 80k accounts authenticated with LDAP

We've attempted to:
- ps ax | grep couriertls, or
- netstat -an | grep 993 ... <and 143, 110, 995> | grep ESTABLISHED
   => doesn't count distinct users, since one user may open
many connections

- netstat -an | grep 993 ... | count-each-ip-address
   => doesn't count distinct users, since one IP address may
hide many users (multi-user computer or NAT-gateway)

- tail -f /var/log/mail.log | parse-output
   => not real-time, fragile if log format changes, and subject
to interruptions if syslogd fails

Our dream would be to have a record somewhere of active connexions
with the user login, the protocol and the start-time. However, a
"setproctitle()" with the user login would be nice.

Do you have any clue?

Thanks in advance,

Pierre David

This is for Linux - may work for you:

ps -ef | grep -v root | grep "imapd\|pop3d" | awk '{print $1}'| sort | uniq | wc -l

with ldap authentication, each imad/pop3d process belongs to the same user, then it doesn't work.

i think process perent for each user is the same, so:

ps -ef | grep -v root | grep "imapd\|pop3d" | awk '{print $3}'| sort | uniq | wc -l

should work.
i might be wrong though


Vadim

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to