By default we can retrieve server statistics using XMPP. After a successful setup of the section called “Setting Up Remote Monitoring in the Server” we can enable additional@@, configured methods (JMX, HTTP, etc).
Accessing statistics over XMPP protocol requires any XMPP client capable of executing XEP-0050: Ad-Hoc Commands. It’s essential to remember, that only administrator (a user whose JID is configured as administrative) can access the statistics.
For the purpose of this guide a Psi client will be used. After successfully configuring and connecting to account with administrative privileges we need to access Service Discovery, either from application menu or from context menu of the particular account account:
In the Service Discovery window we need to find Server Statistics component:
We can either access statistics for all components or select particular component after expanding the tree. To execute ad-hoc command simply double click on the particular node which will open window with statistics:
In this window, in addition to see the statistics, we can adjust Stats level by selecting desired level from the list and confiming by presing Finish.
In order to access statistics over JMX we need to enable support for it in Tigase - the section called “Activation”. Afterwards we can use a number of tools, for example following:
After opening JConsole we either select local process or provide details of the remote process, including IP, port and credentials from etc/jmx.* files:
Afterwards we navigate to MBeans tab from where we can access tigase.stats
MBean. It offers similar options to XMPP - either accessing statistics for all components or only for particular component as well as adjusting level for which we want to obtain statistics:
In order to collect statistics over period of time following groovy script can be used: StatsDumper.groovy. It’s a Simple JMX client that connects to Tigase and periodically save all statistics to files.
It takes following parameters:
$ groovy StatsDumper.groovy [hostname] [username] [password] [dir] [port] [delay(ms)] [interval(ms)] [loadhistory(bool)]