2 Replies Latest reply on Aug 7, 2008 7:48 PM by mrgordonz

    Monitor user sessions in JBoss

    mrgordonz

      Hi there,

      I provide application hosting for a particular J2EE application (Saba), and as part of my service I want to provide my customers with a monthly report that gives them visibility into how the users use the application.

      I have been evaluating a number of monitoring systems (Hyperic, Nagios, Zenoss, and AdventNet Applications Manager) and so far I have not been able to find one which will poll JBoss to find out how many active user sessions there are. Most of them seem to have no problem monitoring things like:

      Application up time
      Application down time (apart from scheduled outages)
      CPU and memory usage, JVM memory usage, etc

      This is all useful info for my report, but I REALLY NEED to know about user sessions: average, peak, etc.

      The technology stack is:

      Windows Server 2003
      JBoss 4.0.5
      Apache 2.0.58
      SQL Server 2005

      Can anyone suggest how I can do this? Please note - I know very little about the "guts" of JBoss. I have seen a number of posts in various forums refer to "jmx-console" but I don't know what this is or how to use it.

      Cheers,

      Paul

        • 1. Re: Monitor user sessions in JBoss
          peterj

          I have never seen anything that tracks the number of active session, but there is data about the current number of active requests - the currentThreadsBusy attribute of the jboss.web:name=http-127.0.0.1-8080,type=ThreadPool mbean (your mbean might be named differently based on the IP address your app server is bound to).

          Most monitoring tools use JMX, and the MBeans provided by JBossAS, to provide their data. The jmx-console is an MBean browser for JBossAS. To access it, use the url: http://hostname:8080/jmx-console. (If this doesn't work, make sure that the app server has the directory server/xxx/deploy/jmx-console.war - some people remove this directory for production.) Once you know the MBean name and attribute it is usually simple to configure the monitoring tool to access the data.

          • 2. Re: Monitor user sessions in JBoss
            mrgordonz

            Hi Peter,

            Thanks for that info. I tried browsing to http://localhost:8180/jmx-console/ on the server and I got a huge listing of stuff (I don't even know what the stuff is!). What I do know is the application I host (Saba) has a single ear file which I deploy (D:\SabaWeb\JBoss_Tomcat\server\default\deploy\saba.ear), and in the ear file is a saba.war file and a saba.jar file, which as I understand it is pretty much standard for J2EE applications. What I am interested in is how many people have an active session in that application.

            I found what I think is the mbean you mentioned:

            name=http-0.0.0.0-8180,type=ThreadPool

            And when I follow the link it shows a value for currentThreadsBusy. I did a test by logging in as several different people, and then refreshed the mbean view, but nothing changed.

            I find it odd that there is no easy way to find out how many users have an active session in a particular application - I would have thought that was a metric which most system administrators would like to monitor from time to time.

            Cheers,

            Paul Hobbs