[JDEV] How to get current number of users?

Ralph Meijer jabber.org at ralphm.ik.nu
Wed Jan 22 06:56:50 CST 2003


On Wed, Jan 22, 2003 at 01:27:29PM +0100, Sylvain Roberdeau wrote:
> HI,
> 
>     I'm looking for a way to get current number of connected users for a
> stat service and RRD Tools.
>     First, I thought that an admin command  or an jabberd module exist.
> 
>     Before create a specific module, I would like to know if there is an
> existing way to do that.
> 
>     Thanks for the anwser
> 
> Sylvain
> 

The easiest way to measure this outside jabber is to count the number of
incoming connections to port 5222. You can do this by parsing the output of
netstat -a, but if you are familiar with snmp, use cricket and have an snmpd
running, the information is available there, too.

You can try querying:

	tcp.tcpConnTable.tcpConnEntry.tcpConnState.x.x.x.x.5222.y.y.y.y.p
	
where x.x.x.x is your external IP address, y.y.y.y is the other party and p is
the port their local port. If y.y.y.y is 0.0.0.0 and p is 0 you found the
listen entry (value is 2), established connections have a value of 5.

-- 
Groetjes,

Ralphm



More information about the JDev mailing list