Manually Discovering JEE Application Servers with SCOM 2012

Out-of-the-box, System Center Operations Manager can discover several different application server platforms and versions (support matrix is here); however, this is not every version of every application server.  Also, for an application server to be discovered and monitored in Operations Manager, the machine it runs on must be discoverd and monitored by Operations Manager.  Luckily, the System Center 2012 Operations Manager monitoring packs includes PowerShell scripts for manually discovering JEE application servers where such application servers cannot be automatically discovered. 

The following steps (taken from the README.txt - see here for feature download) describe how to manually discover a JEE application server.

Step #1: Deploy BeanSpy to your JEE application server. 

 

Step #2: If your application server requires authentication, create a Run As account to be associated with "JEE Monitoring Account" Run As profile for monitoring.  Create another Run As account to be associated with "JEE Invoke Account" Run As profile for invoking methods on MBeans.

 

Step #3: Obtain PowerShell scripts using one of the following methods:

1) If you have at least one JEE application server automatically discovered by Operations Manager, go to Operations Console, select an automatically discovered JEE application server instance, and run the task "Copy BeanSpy and Universal discovery files" in the Tasks pane. This will copy the BeanSpy files to the %WINDIR%\temp folder.

2) Search the Operations Manager installation folder for BeanSpy*. For example, if Operations Manager is installed under "C:\Program Files\System Center 2012\Operations Manager", BeanSpy files are located in one of the folders under C:\Program Files\System Center 2012\Operations Manager\Server\Health Service State\Resources\ as of this writing.

There should be three PowerShell script files:

  • JEEAppServerLibrary.ps1
  • NewJEEAppServer.ps1
  • RemoveJEEAppServer.ps1 

Step #4: Run PowerShell scripts to add or remove application servers.

1) You can add or remove application servers one by one. However, if you have multiple application servers, you can create a configuration file. Each line of this file should contain a URL where your JEE application server is listening on for http or https requests. For example:

 

https://linux.contoso.com:8080https://myredhat:8180https://10.0.0.1  

 

2) To add JEE application servers for monitoring, run NewJEEAppServer.ps1.  Run this script with -help for details of command line options. You can pipe the configuration file you created to this script, or specify a single URL on the command line.

NewJEEAppServer.ps1

Discovers JEE App Servers into Operations Manager. BeanSpy should be deployed to each application server to be discovered.

Input:

  The script accepts a number of JEE App Servers on the input pipe.  Each JEE App Server is represented as a fully qualified URL, for example, https://www.contoso.com:8080.

Output:

  The script displays an error message for each app server it fails to discover.

  Parameters:   ManagementServer - Name of OpsMgr server to use. Use current computer if not specified   JEEAppServerType - Supported types are JBoss, Tomcat, WebSphere, and WebLogic.                              Will query each application server if not specified.   JEEAppServerVersion - Supported versions are JBoss 4, 5, 6, Tomcat 5, 6, 7, WebSphere 6, 7,                               and WebLogic 10, 11. Will query each application server if not specified.   UserName - User name to access the App Server URL. If provided, the script will prompt for password   Target - Additional JEE App Server to discover                             (done before any JEE App Server piped into the script)

   help - Prints this help

Examples:

.\NewJEEAppServer.ps1 -Target https://www.contoso.com:8080

type c:\MyAppServers.txt | .\NewJEEAppServer.ps1 -JEEAppServerType WebLogic -JEEAppServerVersion 11

type c:\MyAppServers.txt | .\NewJEEAppServer.ps1 -UserName mymonitor

 

3) To remove JEE application servers currently being monitored, run RemoveJEEAppServer.ps1.  Run this script with -help for details of command line options. You can pipe the configuration file you created to this script, or specify a single URL on the command line.

Update August 30th, 2013: Only instances added by the NewJEEAppServer.ps1 can be removed. You cannot remove instances that have been discovered by the application server-specific MP. The quickest way to tell which discovery was used is if the instance has a DiskPath. Instances discovered via the Universal Discovery method do not have a disk path. So if the Path is blank, then it is a candidate to be removed.

 

RemoveJEEAppServer.ps1

Removes JEE App Servers from Operations Manager.

Input:

The script accepts a number of JEE App Servers on the input pipe.

Each JEE App Server is represented as a fully qualified URL, for example, https://www.contoso.com:8080.

 

Output:

The script displays an error message for each app server it fails to remove.

Parameters:

  ManagementServer - Name of OpsMgr server to use. Use current computer if not specified  Target - Additional JEE App Server to discover                             (done before any JEE App Server piped into the script)

  help - Prints this help

Examples:

  .\RemoveJEEAppServer.ps1 -Target https://www.contoso.com:8080  type c:\MyAppServers.txt | .\RemoveJEEAppServer.ps1

The discovered application servers will first appear under "Universal application servers" folder in the "Configured application servers" view. Verify that the application server type and version are populated correctly.  After multi-stage discovery (ranging from a few minutes to four hours by default), the discovered application server should appear under the application server folder specific to its type, in the deep monitored application server view, with detailed application server information populated.