IT Operations Management (ITOM)
cancel

Extending SiteScope’s monitoring capabilities with SiteScope 11.20

Extending SiteScope’s monitoring capabilities with SiteScope 11.20

BethParker

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

importPackage(java.lang);

                importPackage(java.text);     

                importPackage(java.util);

 

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

                var logger = myContext.getMonitorLog();

                logger.info("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){

                       ordersInError++;

                   }

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

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

                       ordersInWarning++;

                   }

                   index++;                

                } 

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 - https://hpln.hp.com/group/sitescope

 

  • infrastructure management
0 Kudos
About the Author

BethParker

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.

Comments
N/A

it seems it's a great feature that will extend SiteScope monitoring capabilities to infinity

N/A

Until SiteScope 9.54 we are able to see all SiteScope machines monitor status in on single page "Multi-View" panel; which was very very useful to manage all SiteScope servers from one single page.  Missing the capability forcing us not to upgrade to leater versions to take advange of new functionalities!!   We tried BSM but it no way give same functionality as Multi-View panel until SiteScope version 9.54.  Can you suggest what feature in SiteScope or BSM will give same exact functionality as Multi-View in SiteScope 9.54 for managing over 15 SiteScope machines?

Occasional Advisor

Hi,

 

I am currently working on Sitescope 11.20 and HP Business Service Management 9.13.111.

 

We are looking for documentation for the following questions:

 

1. Best practice for monitoring a M9000 mpstat / sar? (best practice)

 

2. We are currently monitoring Global Zones and Local Zones. I would like to know if we are duplicating the monitoring by monitoring both? Is it necessary to monitor Local Zones or will Global Zones cover the performance issues?

N/A

can i have sitescope upgrade from 11.12 to 11.20 steps?

//Add this to "OnDomLoad" event