This week I explored the process of activating JEE monitoring of my Centos 6.4 Tomcat server. The process of monitoring JAVA webapps is not the same as for monitoring .NET applications. In the picture below you can see the process of monitoring JAVA applications:
As you can see JAVA monitoring is not something that works out-of-the-box. There are some steps needed to activate the monitoring part. See below the steps I have taken to activate JAVA Monitoring. My starting point was a fresh installed Centos 6.4 x86_x64 server. I installed the following Tomcat components:
1. Add the host to SCOM 2012. In my case I added the host to Unix/Linux Computers;
2. Verify that the host is monitored and is ‘Green’ inside the SCOM console;
3. Import the JEE Management Packs needed for Tomcat. The MP’s can be download at the following location: http://www.microsoft.com/en-us/download/confirmation.aspx?id=29270. You need to import at least:
– Microsoft.JEE.Tomcat.<Version>.mp (In my case ‘Microsoft.JEE.Tomcat.6.mp’)
4. After importing the MP’s normally the Tomcat instance will be discovered. In my case this was not the case. After investigating the scx.log I saw the following errors:
5. I tried different things to fix the error, but none of them worked. I decided to go further with the process and I was hoping that the problem was solved automatically.
The next step was to install and configure the Beanspy component, this component is needed for Deep Application Monitoring. There are different installation versions of Beanspy and you can find them in subfolders of this folder:
C:\Program Files\System Center 2012\Operations Manager\Server\Health Service State\Resources
Because on my server authentication is used I needed to install the BeanSpy.WAR. I did this through the Tomcat Web Application Monitor. If installed you can find the manager at this link http://servername:portnumber/manager/html.
On this page you can install .WAR files through the GUI. Go to this section of the page and install the Beanspy.WAR file.
When Beanspy is deployed you need to configure 2 users in the tomcat webserver. In the config file /usr/share/tomcat6/conf/tomcat-users.xml you need to add a user with the roles ‘Invoke’ and ‘Monitoring’. When configured this user you need to restart the tomcat webserver service.
6. Create a RunAs Account (Basic Authentication) for that user in SCOM and link them to the JEE Inboke Account profile and the JEE Monitoring Account Profile.
7. At this point my Tomcat webserver was still not discovered in SCOM. I searched for this problem and found some links that this is also the case when Tomcat is running as a service on a Windows Server. The solution is to add your server through a powershell cmdlet. You need to copy these 2 files to 1 folder:
These files can be found in subfolders in this folder: C:\Program Files\System Center 2012\Operations Manager\Server\Health Service State\Resources
8. Run the NewJEEAppServer.ps1 with the following commandline to add your Tomcat Server to SCOM:
.\NewJEEAppServer.ps1 -Target http://tomcat_servername:portnumber -UserName <<Username_from_step_5 >>
If the command executes successfully you will see the following output:
9. After executing this account you will see your server as discovered inside SCOM and you will see that the Deep Monitoring capabilities are also activated.