In part 1 we have installed a Linux and Tomcat 6 application server. A must requirement to install and run Java Application Performance Monitoring (Java APM) is, that your application server is deeply monitored using Java Enterprise Edition (JEE) management pack for Tomcat 6. Some time ago I did write a blog post how to do that, you can find it here.
Of course before we can start we need first to install SCOM 2012 R2 Preview on Windows Server 2012 R2 Preview. A very fast and easy setup can be found here in form of a trial VHD.
The very first steps are installing the Ubuntu (Debian) Universal management pack and deploying the SCOM agent. In a next step, we are importing and configuring the JEE monitoring management pack for Tomcat 6 and finally we need to manually discover the Tomcat application server using PowerShell scripts.
Let’s start…
Prerequisites
Install first SCOM 2012 R2 and download the Linux and JEE management packs.
- Installation source SCOM 2012 R2 Preview edition
- Download System Center 2012 Monitoring Pack for UNIX and Linux Operating Systems
- Download System Center Monitoring Pack for Java EE
Import Management Pack Ubuntu 12.04.2 (Debian)
I created a folder called C:\MP on SCOM 2012 R2 where I store all my MP file. Extract the “System Center 2012 MPs for UNIX and Linux” to C:\MP…
In a subfolder called SCOM 2012 SP1 we will find the necessary MP files for Ubuntu. Note here that Ubuntu is based on the Debian distribution and because of that we need to import these management packs…
- Microsoft.Linux.Universal.Library.mp
- Microsoft.Linux.Universal.Monitoring.mp
- Microsoft.Linux.UniversalD.1.mpb (to support Debian and Ubuntu Linux agents)
- Microsoft.Unix.Library.mp
From the root directory of the MP we need in addition the Microsoft.Linux.Library.mp…
If select these files in the wizard you will see that everything seems to be ready to import…
After the MP’s have been imported create the RunAs accounts and profiles, discover and deploy the SCOM agent as described in a previous blog post here.
If everything goes well you will have successfully deployed a SCOM agent…
…and after a while a healthy monitored Linux server will pop up.
Import Java JEE Management Pack Tomcat 6
Next, we are going to install the management packs for Tomcat 6 monitoring. Download the MP to C:\MP and extracted the MSI file. It will look like this…
The files you need to import are the following:
- Microsoft.JEE.Library.mpb
- Microsoft.JEE.Templates.Library.mpb
- Microsoft.JEE.Tomcat.6.mp
- Microsoft.JEE.Tomcat.Library.mp
If you selected these files in the MP import wizard you will have green checkmarks everywhere…
Next, create a RunAs account for JEE monitoring, associate this account with the JEE Monitoring Account AND JEE Invoke Account profile as described in this previous blog post here and the MP guide. In part 1 we created a user called tomcat, this is the user you are going to use for the RunAs accounts and profiles.
Manually Discover Tomcat 6
Usually the application server and applications gets discovered automatically. In some cases it will not happen and you need to do it manually. Luckily Microsoft provides PowerShell scripts to do so. Christopher Crammond has written a great blog post how to do it exactly and what you can expect to see.
For your convenience, I have uploaded the scripts to skydrive where you can download it.
Note: There is a chicken and egg problem, because you only can get these PowerShell files if your server already has been discovered by running the Copy BeanSpy and Universal discovery files task in the next step. But this is only possible if the server is known to SCOM / has been already discovered. Well there is a solution to get these files without running this task, Christopher Crammond has written a short post about this problem.
In our case we need to run .\NewJEEAppServer.ps1 with the following parameters…
Almost immediately the server will appear under Universal application servers/Configured application servers . If this is the case, select the server and run the Copy BeanSpy and Universal discovery files task on the right hand side. This tasks will copy BeanSpy and the PowerShell scripts which I provided above to C:\Windows\Temp.
Now on your SCOM server go to C:\Windows\Temp and rename the file BeanSpy.HTTP.NoAuth.war to BeanSpy.war…
Go go the Tomcat management page (http://ubuntu01:8080/manager.html) and deploy the BeanSpy.war by selecting the Browse… button under WAR file to deploy…
If you get prompted to login, use the tomcat account we created in part 1.
After some time your applications gets discovered on Tomcat…
…and you also see some detailed properties on your application server…
If you take a look at the HealthExplorer of an application, you will notice that only the Availability node has a monitor (this will change when we import the Java APM management pack).
To check the deep monitoring functionality make sure you see performance counters and data for each of the performance views…
That’s it for part 2, at this moment we have a deep monitored Tomcat 6 application server.