Monitoring Apache with GlassFish Web Stack 1.5
By Jeff Trawick on Aug 04, 2009
One of the new capabilities in GlassFish Web Stack 1.5 is the Web Stack Enterprise Manager. In the following screenshots I'll "demo" the manager with Apache on Solaris 10. (It should be no different with the Web Stack on Red Hat Enterprise Linux.)
I've already installed and started the Web Stack Enterprise Manager. For the IPS/pkg(5) distribution, that's as simple as
bin/pkg install sun-wsadmin followed by
bin/sun-wsadmin start. With a non-root IPS/pkg(5) installation, you'll be prompted for a user id and password when you start the Enterprise Manager the first time.
Now let's access the enterprise manager and log in:
The next screen shows CPU, memory monitors, and service control buttons in the left pane, and the dashboard in the right pane shows how-to information, since I haven't chosen to monitor anything.
Next I'll start Apache HTTP Server (Apache) and Apache Tomcat (Tomcat) by clicking the play icons next to Apache and Tomcat. (Sorry, Tomcat-istas!) Now the stop icon is displayed for those services and messages about server startup have been written to the alert section.
The + icon next to "apache2.2 has started" in the alerts display can be expanded to see the log messages written by Apache during startup.
Now I'll use the "Add Graphs" drop-down to monitor the number of Apache threads sending replies (from the scoreboard).
That requires a change to the Apache configuration (enable mod_status and set ExtendedStatus to On). I'm prompted by Enterprise Manager before that step is taken.
The next window indicates that Apache is restarting and now I can add the graph. You can see in the background that Apache stopped and started again.
Next I try again to add the graph and it is accepted, since Apache monitoring has already been enabled. After starting some load on the web server and waiting a few minutes, the graph is able to chart some activity.
While graphing of current Apache load continues, I'll scroll up the left pane of the display to see the server memory and CPU usage clearly. Unfortunately, this tiny VirtualBox image is maxed out on memory, and CPU is spiking periodically.
This is just a quick introduction; the Enterprise Manager documentation has far more information.
In particular, note the Analytics views which allow you to move through different time scales in order to understand the state of the servers over time.
What about the orange banner at the top which says "Evaluation Period Remaining - 29 Days?"
Unlike the rest of Web Stack, which is free for use, the Web Stack Enterprise Manager as distributed is for evaluation only and will stop working after 30 days. GlassFish Portfolio subscribers can access and install an additional package which removes the time limitation. GlassFish Portfolio is a support offering which covers GlassFish Web Stack, GlassFish Enterprise Server, and a number of other products in the web space.