Tomcat discovery in SCOM 2012 RC

Out of the box SCOM 2012 RC will not discover Tomcat servers running as Windows services. There are a few steps required before they will show up as being monitored in SCOM 2012 RC.

I’ve previously installed Tomcat and imported the JEE Management packs to my SCOM 2012 RC test environment.

First of all I’ll check that my Tomcat server is running, in my case Tomcat 7.0 on a Windows Server 2008 R2.

Tomcat Windows service

Tomcat Splash page

Tomcat seems to be running so I create a new text-file called “config_Tomcat.txt” and list all JEE Application Servers per URL. In my case one: “http://tomcat:8081.

Next, it is time to install BeanSpy. BeanSpy is an application that ships with the JEE MP and will run on the Tomcat server passing information to our SCOM server.

There are four files listed in the BeanSpy directory; BeanSpy.ear, BeanSpy.HTTP.NoAuth.ear, BeanSpy.HTTP.NoAuth.war and BeanSpy.war. Since I’m not using authentication I’ll rename “BeanSpy.HTTP.NoAuth.war” to “BeanSpy.war”. Either put the war-file in the webapps directory to autoimport BeanSpy or manually import it in the Tomcat manager.

Import BeanSpy

“Message: OK” and the BeanSpy application is listed.

BeanSpy imported ok

Verify that BeanSpy can query the server by trying the URL in a web browser:


You can also try it with a JMXQuery. It will output the result as an XML-file.

BeanSpy verification

Import the MP from the Sample folder called “Microsoft.JEE.UniversalSample.xml”.

Import the Microsoft.JEE.UniversalSample.xml MP

This will generate a new folder under “JEE Application Servers” called “Universal application servers”.

MP imported

Next it’s time to import the applications servers. Start the Operations Manager Shell. Run

./New-JEEAppServer.ps1 -help

to get a list of parameters.

Import servers with PS script

In my case the command line was:

type .\config_Tomcat.txt | .\New-JEEAppServer.ps1 -ManagementServer OM2012 -JEEAppServerType Tomcat -JEEAppServerVersion 7

Import Tomcat server

After a few minutes of waiting the the server will be displayed in “Deep monitored configurations”.

Deep monitoring configurations

And the applications will be listed under “Applications”.

Tomcat applications

The Tomcat server and it’s applications are now discovered. For reference, I used the guides that come with the JEE MP’s; “OpsMgr_MP_Tomcat.docx” and “SC2012_JEE_RC_GettingStarted.docx”.

JEE, Management Pack, SCOM 2012, Tomcat

17 responses to Tomcat discovery in SCOM 2012 RC

  1. Where do you put the “config_Tomcat.txt”? Is this on the tomcat server? What directory? Does it have to be on the management server?

  2. Markus

    Put it anywhere on the MS and use the path with the New-JEEAppServer.ps1 cmdlet.
    In my case I put all files in the same directory, hence type .\config_Tomcat.txt | .\New-JEEAppServer.ps1 -ManagementServer OM2012 -JEEAppServerType Tomcat -JEEAppServerVersion 7

    • Edward

      MY powersheel Opmr dont recognize the New-JEEAppServer.ps1, I found like “NewJEEAppServer.ps1” when execute it, shows:
      “The term ‘.\JEEAppServerLibrary.ps1’ is not recognized as the name of a cmdlet, function, script file…”

      Please, can you help me?


      • Markus

        Locate and copy all three Powershell files to the same folder. You need the Library file to get the other two scripts to work.


        • Edward

          Hi Marcus!
          Thanks I resolved it with your help
          “Locate and copy all three Powershell files to the same folder”

  3. Pingback: Random, Happy Dev Thoughts

  4. Joren


    I followed your guide (thx btw), and i now have my 2 tomcat servers under the configured application servers view. They are also under the deep monitored configuration. But the state there is not monitored. Do you know why this is? Also when i look under applications, only applications from 1 server are being shown. Also not monitored… Any ideas?


  5. Markus

    Did you run the import-script successfully? Is the Bean-spy application running?
    It takes some time before the applications show up in the console. As always, you can try to restart the Operations Manager agent on the server to speed things up.
    Look in the Event log if there are some failed discovery script listings.

  6. Michael

    Hi. Only one application shows up in the “Applications” view, and with no details – it is healthy though.

    The Deep Monitoring view also contains one healthy component, and i get all the performance.

    Any idea why my Tomcat applications doesnt show?

    • Markus

      If you only have one Tomcat server, you should only see that one in the Deep Monitoring view.
      As to why you only see one application, did the install script run successfully? Any errors in the log? If you have defined a user account running Tomcat you have to set up a RunAs account in SCOM.

  7. Juan

    Hi Markus, great post!
    Im having problems to discovery my tomcat instance, i get the next error when i run the ps command

    New-Object : Exception calling “.ctor” with “1” argument(s): “The requested name is valid, but no data of the
    type was found”
    At C:\Users\_srv_scom_adm\Desktop\Alg\JEEAppServerLibrary.ps1:139 char:19
    + return new-object <<<< Microsoft.EnterpriseManagement.ManagementGroup($Computername)
    + CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

    You cannot call a method on a null-valued expression.
    At C:\Users\_srv_scom_adm\Desktop\Alg\JEEAppServerLibrary.ps1:125 char:60
    + $monitoringClasses = $managementGroup.GetMonitoringClasses <<<< ($className)
    + CategoryInfo : InvalidOperation: (GetMonitoringClasses:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    The variable '$monitoringClasses' cannot be retrieved because it has not been set.
    At C:\Users\_srv_scom_adm\Desktop\Alg\JEEAppServerLibrary.ps1:127 char:27
    + return $monitoringClasses <<<< [0];
    + CategoryInfo : InvalidOperation: (monitoringClasses:Token) [], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined

    Failed to load class (Microsoft.JEE.Universal.ApplicationServer) from the imported MP's,

    • Markus

      It looks like the connection to your Management Group isn’t working.
      Have you specified the correct name to a Management Server?
      Are you starting the script in an Operations Manager Shell?
      Have you imported the MP:s in your OM environment prior to running the script?

  8. hello i have problem , i do all but in deep monitor servers look like not monitored.what can i do? i crated run as acount and add in to acounts.

  9. Markus

    Sorry for the late reply. Did you receive any errors running the import script?

  10. Steph

    We recently put some app servers (Tomcat 5) onto SCOM. The two which are HTTP/no authentication are fine, but we’ve had problems with the four that are HTTPS/basic authentication.

    We get the following logged on the SCOM MS running the Health Service Script:

    Source: Health Service Script

    Event ID: 100


    HTTPGet.vbs : HTTP commucation failed with: appserver:443/BeanSpy/Stats – Send Error – -2147024891

    So far have tried re-creating runas accounts/profiles, re-distributing them to the app servers, checked DNS, switched off firewalls/anti-virus (proven since doing TCP traces that communication is ok).

    If I click on the URL which is inline in the event log on the calling management server (e.g. HTTPGet.vbs : HTTP commucation failed with: appserver:443/BeanSpy/Stats – Send Error – -2147024891) – that link on the SCOM management server opens the URL in IE, prompts for the authentication details, and if I enter them manually (as per what’s in the Basic Authentication runas account/profile), it returns the XML fine! :/

    In the BeanSpy section, in Health Explorer, its reporting a 401 (which is what you’d get it you don’t authenticate with the username/password to the app server URL):

    HTTP Status Code 401
    Unreachable false
    Error Code 2147942487
    DNS Resolution Failure false
    DNS Resolution Time (seconds) 0
    TCP Connect Time (seconds) 0
    Time To First Byte (seconds) 0
    Time To Last Byte (seconds) 0
    Redirect Time (seconds) 0
    Download Time (seconds) 0
    Total Response Time (seconds) 0
    Content Size (bytes) 0
    Secure Failure Code 0
    Certificate will expire in (days) 695
    Verb GET
    Version HTTP/1.1
    Certificate Expired false
    Certificate Authority Untrusted false
    Certificate CN Invalid false
    Response Headers HTTP/1.1 401 Unauthorized Cache-Control: no-cache Date: Fri, 06 Dec 2013 10:05:03 GMT Pragma: No-cache Content-Length: 954 Content-Type: text/html;charset=utf-8 Expires: Thu, 01 Jan 1970 01:00:00 GMT Server: Apache-Coyote/1.1 WWW-Authenticate: Basic realm=”myrealm”
    Response Url
    Request Headers
    GET /BeanSpy/Stats HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Connection: Keep-Alive
    Response Body See end of page for full Response Body

    Any ideas? That is works using the URL and manually supplying the basic authentication credentials (as per what’s in the runas account) seems to prove that BeanSpy is all running ok. But cannot find anything about what this ‘Send Error’ entails?!

  11. Andreas

    Hi there,
    I put on application to SCOM, but the state is “not monitored” since days…
    I got no errors with import Script.
    Processed app server: http://:8080 type: Tomcat Version: 7
    All Eventlogs are clean.

    I still have a problem to query ageinst the FQDN. It seems to be a Proxy Case. Do that have to the FQDN?

  12. Bhaskar Rajamani

    I am using Websphere when I am running NewJEEAppServer.ps1, I am getting this given error though I imported all the MPs for Websphere 8.
    Failed to load class (Microsoft.JEE.Universal.ApplicationServer) from the imported MP’s,
    please ensure MP’s JEE MP’s are imported.

    And after imported the Management packs and deployed the BeanSpy, I am not able to see the Websphere Details in SCOM 2012 R2. Any idea to make it success..

Leave a Reply

Your email address will not be published. Required fields are marked *