Business Service Management
Showing results for 
Search instead for 
Do you mean 

Extending SiteScope’s monitoring capabilities with SiteScope 11.20

BethParker ‎06-06-2012 06:22 AM - edited ‎02-08-2015 08:38 AM

Hello from HP Discover, HP’s user conference which is taking place as we speak in Las Vegas! We are very excited to announce the release of SiteScope 11.20. This release has a lot of great new features, new monitoring content and tons of enhancements. You can take a look at the release notes for more details.


This post, compliments of Erez Holzman, SiteScope R&D Manager, focuses on custom monitors - one of the new exciting features in this release which allows our customers and partners to easily extend the monitoring capabilities of SiteScope based on their specific needs.


To start creating a new custom monitor you will need to select one of the following Custom Monitors types:


  1. Custom Monitor – retrieve data from any available source using custom Java Code

  2. Log File Custom Monitor – retrieve data from log files

  3. DB Query Custom Monitor – retrieve data using database queries

  4. WMI Query Custom Monitor – retrieve data using Windows Management Instrumentation queries

In the New Monitor dialog select one of the four monitors available in the Customizable category:





We’ll use a simple example, to take you through the life cycle of developing new Custom Monitor for SiteScope. Let’s say you would like to monitor your shipments table and get alerts if there are late shipments or there are more than 10 shipments in the next 3 days.


We’ll start by creating a new Custom Database monitor and enter all the database parameters:





The next step is to create the queries. You can create one or more queries which would later be available via the data processing script.





Now, we need to tell SiteScope what to do with the results of the queries. This is done using JavaScript, a common and well known scripting language and SiteScope documented interfaces. You can also import and leverage any regular Java class. You can start with the default sample code and tweak it to fit your needs.





Here is the complete code I used:


Code snippet /*************************** Custom Database Monitor Script Example ***************************/

Import are used to access any regular Java classes

// Java imports





                // Logger for debug messages. The logger writes messages to <SiteScope>\logs\custom_monitors\custom_monitor.log

                var logger = myContext.getMonitorLog();

      "Processing Orders data");

myContext is a special Java object that we used in the monitor it gives the access to the collected data and also for assigning new counters and other data.

getInputData used to access the returned data, number or rows in the query and column values

                var query0Size = myContext.getInputData().getQueryResultSize(0);

                var ordersInWarning = 0;

                var ordersInError = 0;

                var queryResults = myContext.getInputData();


                SimpleDateFormat is a regular Java class used to parse date values

                var sdf = new SimpleDateFormat("yyyy-MM-dd");

                var now = new Date(System.currentTimeMillis());



// iterate through the returned values

                var index = 0;        

                while(index < query0Size) {                                        

                   var col1Value = queryResults.getValueAt(0 , index , "ORDER_SHIP_DATE");

                   var shipDate = sdf.parse(col1Value);

                   var dif = (shipDate.getTime() - now.getTime())/(1000*60*60*24);

   // if ship date is earlier than now, this order is late!

                   if(dif < 0){



   // if ship date is within the next 3 days, increments the warning counter

                   if(dif <= 3 && dif > 0){





We use getScriptResult to add counters. In this example “Late Ship Orders” and “3 Days Ship Orders” will be the monitor counters        

                myContext.getScriptResult().setValue("Late Ship Orders" , ordersInError); 

                myContext.getScriptResult().setValue("3 Days Ship Orders" , ordersInWarning); 




After you complete editing your processing script, save the monitor and the new counters will be added to the threshold panel and to the dashboard. Now you can set thresholds values and see the status of your orders in the dashboard.






This is just a simple example, but you can see the power of this feature. Stay tuned for the next blog post  which will show you how to share content developed for SiteScope using the new HP Live Network community -


0 Kudos
About the Author


Beth Parker is a Product Marketing Manager for HP Software. Beth is responsible for outbound marketing and sales enablement for the HP Systems Management portfolio including HP Operations Manager, Operations Agents, Smart Plug-ins and SiteScope. She is based in Naples, Florida.

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Jun 7-9
Las Vegas
Discover 2016 Las Vegas
Discover 2016 in Las Vegas, the ultimate showcase technology event for business and IT professionals to learn, connect, and grow.
Read more
Sep 13-16
National Harbor, MD
HPE Protect 2016
Protect 2016 is our annual conference and is the place to meet the world’s top information security talent, discuss new products and share information...
Read more
View all