You can create, deploy, and register a custom summarizer, which can create process
summary records in IBM® Control Center
Monitor for
any server type.
- Extract the process-summarizer-sdk-1.0.0.zip file from <CCRootDir>/sdk
directory.
- Identify a process in an instance of IBM Control Center
Monitor that you can use to test your
custom summarizer and record its Process ID.
- Obtain the JDBC URL, user name, and password of the IBM Control Center
Monitor database against which you
can test your custom summarizer.
In this scenario, a dynamically discovered Cron server runs a cron job. In the IBM Control Center
Monitor web console, you find
processes that you know run correctly, but the statuses are being reported as Complete with errors
instead of Successful. The incorrect statuses are due to IBM Control Center
Monitor assuming that non-zero Return
codes mean failure. Some events send non-zero return codes, such as 8, but you want IBM Control Center
Monitor to consider that as
successful. To create, deploy, and register a custom summarizer so that IBM Control Center
Monitor indicates any cron job with a
non-zero Return code as successful:
-
Use the Process Summarizer SDK to create a custom summarizer. In the Process Summarizer SDK,
open Process Summarizer SDK installation path/README.txt and
Process Summarizer SDK installation path/doc/index.html.
Then, read the instructions to develop a Java class that implements the
ProcessSummarizer API.
-
In an integrated development environment (IDE) such as Eclipse, develop a new
CronSummarizer.java class.
-
Create a Java Project and a lib directory.
-
Copy all JARs from the Process Summarizer SDK to the lib directory.
-
Copy the process-summarizer-sdk-*.jar to the lib
directory.
-
Set the classpath of the project to include all JAR files from the lib
directory.
-
Create and name a package com.ibm.demo.
-
In the com.ibm.demo package, create and name a class
CronSumarizer that inherits from
com.sterlingcommerce.scc.agent.event.DefaultSummarizer
and override the
summarize method.
-
Call
super.summarize(process, events)
before or after your logic. Be sure to
return a Collection<FileTransfer>
when you are done.
For example, your
CronSummarizer.java might include the following
logic:
package com.ibm.demo.CronSummarizer;
import com.sterlingcommerce.scc.agent.event.DefaultSummarizer;
public class CronSummarizer extends DefaultSummarizer
{
public CronSummarizer()
{
super();
}
@Override
public Collection<FileTransfer> summarize(Process process,
List<Event> events){
Collection<FileTransfer> transfer = super.summarize(proces, events);
boolean allSuccess = true;
for (Event event : events)
{
if (event.getRetCode() == null || event.getRetCode().equals("0") || event.getRetCode().equals("8"))
{
// good
}
else
{
// not good
allSuccess = false;
break;
}
}
if (allSuccess)
{
process.setStatus(Status.SUCCESS);
}
return transfers;
}
-
Test your custom summarizer against the process that you identified in the Before you
begin section.
-
Copy Process Summarizer SDK installation
path/summarizer.properties to the src directory of your IBM Control Center
Monitor.
-
Edit summarizer.properties and specify the Process ID against which you
are testing your custom summarizer. Also, specify the JDBC database connection parameters that are
needed to connect to the IBM Control Center
Monitor
database, which you obtained in the Before you begin section.
Important: You must have network connectivity from your Eclipse project to where your
IBM Control Center
Monitor database is
running.
-
Configure the fully-qualified class name of your summarizer in
summarizer.properties.
-
Test your summarizer by running
com.sterlingcommerce.scc.agent.event.ProcessSummarizerTestHarness
as a stand-alone
Java application. When you run the test harness, it does the following actions:
- Connects to the database according to the JDBC parameters configured in
summarizer.properties.
- Instantiates the summarizer that was specified in
summarizer.properties.
- Fetches the process identified in summarizer.properties from the
database.
- Calls the summarize method in your custom summarizer.
- Displays the state of the process after summarization.
- More logging, for example
System.out.println
can be added to verify that your
custom summarizer is summarizing as expected.
Attention: No changes are persisted to the database. The test harness is used to test
only whether or not your summarizer is working as expected.
-
Deploy the summarizer to all event processor installations by copying the summarizer to the
appropriate directory that corresponds with its class name.
-
Copy the custom summarizer to installation
path/conf/classes/com/ibm/cc/demo.
-
In the IBM Control Center
Monitor web client,
register the custom summarizer for a specific server type.
-
Go to and click the Cron server type in the navigation pane. In the
Process summarizer field, type the fully-qualified class name of the custom summarizer as
com.ibm.cc.demo.CronSummarizer, then click Save.
Important: If a summarizer was previously deployed, then subsequent updates require you
to restart all event processors so that the event processors can pick up the new version of your
summarizer.
After you register the custom summarizer for the Cron server type, run a new cron job. In the IBM Control Center
Monitor web console, go to , click the Cron server, then in the server details dialog click the
Processes tab. You can now see that the Process Status is Successful for
Events with a Return code of 8 or 0.
Attention: If you register a custom summarizer, it affects only Completed process and
Completed file transfer records going forward. Your custom summarizer is not retroactively applied
to previous processes and file transfers.