Wednesday, 17 July 2013

HP SiteScope 11.22 Web Service API wsdl

SiteScope API (Web Service)
Turning HP SiteScope into SiteScope Classic with Perl and Web services
SiteScope API Example
SiteScope API - how to perform various SiteScope tasks from the command line






Knowledge document information

Title:

SiteScope API - how to perform various SiteScope tasks from the command line

Document ID:

KM425074

Product:

SiteScope

Version:

Updated:

2012-Aug-22

Summary:

SiteScope API - how to perform various SiteScope functions from the command line
SiteScope: Is there an API which will allow a user to write a program which could refresh a SiteScope monitor? 
Situation
using a solution with an event monitor which is receiving alert traps from SiteScope when a monitor goes red. Now an operator should be able to trigger a refresh of the monitor without having to access SiteScope directly.

 
Other popular tasks might be
- disable a monitor
- disable an alert

Solution

The only way to manage SiteScope - if not using the GUI - is via the SOAP API, which is a web-based API (requests are sent via HTTP).
 
The .zip file "SiS_API_Client_10.11.zip" (click here for download) contains a Java based client to invoke those SOAP-API calls, to show how customers can develop their own applications to interface with the External API.

An example of each SiteScope API call that can be run from a command line on a Windows or UNIX platform is provided:
- run a monitor (run_monitor.bat)

- disable a monitor (disable_monitor.bat)
- enable a monitor (enable_monitor.bat)
- disable an alert (disable_alert.bat)
- enable an alert (enable_alert.bat)
- disable a group (disable_group.bat)
- enable a group (enable_group.bat)

- delete a SiteScope monitor (delete_monitor.bat)
- delete a SiteScope group (delete_group.bat)

- deploy a template (deploy_template.bat)
- update via template (update_via_template.bat)

- get part of the configuration (get_configuration.bat)
- get the configuration via a template (get_configuration_via_template.bat)
- get the full configuration (get_full_configuration.bat)
Requirements1. Install JRE 1.6 on the client machine

2. Create a folder named "SiteScopeAPIExamples"

3. Extract the contents of the file attached to "SiteScopeAPIExamples"
     Contents of the \SiteScopeAPIExamples folder:
      bin - example scripts
      doc - API JavaDoc  

      lib - jars
      src - API example source code

4. Copy the JRE folder to "SiteScopeAPIExamples".

5. In the "SiteScopeAPIExamples" folder, rename the JRE folder to "java".
How to run
 1. Go to the \bin folder.
 2. Run the .sh (UNIX) or .bat (Windows) file.
Customers can write their client in any language, not necessarily in Java.

HP Support is not responsible for helping customers write their applications. 
We will only address product related issues.

If a customer wants assistance with developing a custom tool to interface with the API, they need to contact HP Professional Services.

Note:
- the file attached contains the SiteScope API client for SiteScope 10.11
- starting with SiteScope 11.0 this API will be fully supported

Examples:
cd \SiteScopeAPIExample\bin

get_full_configuration -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin

Note:
-host     = host SiteScope runs on
-port     = port SiteScope interface runs on (default 8080)
-login    = SiteScope username
-password = SiteScope password for this user

The messages
 log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
 log4j:WARN Please initialize the log4j system properly.
can be ignored
get full configuration and list it on the screenget_full_configuration -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin
-----------------------------------------------------
Monitor name : SiteScopeRoot/vm17015_SiteScope_Group1/CPU vm17001
-----------------------------------------------------
Monitor properties:
_internalId = 200475886
_name = CPU vm17001
_remoteID = RemoteNTInstancePreferences_11
_updateMonitorAndRun = true
_categoryByAvailability = none
_id = 9
_baseliningTolerance = BASELINE_TOLERANCE_MEDIUM
_enabled = true
_statusOnInternalError = thresholds
_thresholdNew = true
_rawDataOn = false
_baseliningActivation = true
_dependsCondition = good
_frequency = 120
_machine = \\vm17001.deu.hp.com
_class = CPUMonitor
_reportTopology = true
_baselineUser = admin
_rawDataAvailable = false
_rawDataLimit = 1048576
_baseliningStatus = CALCULATED_NOT_ACTIVATED
_previousName = CPU vm17015(1)
objcategory =
_classifier = [utilizationPercentage == 'n/a' error, utilizationPercentage == 100 error, utilizationPercentage >= 7.04 error, utilizationPercentage >= 6.08 warning]
_encoding = Cp1252
_defaultStatus = good
..
..
-----------------------------------------------------
Monitor name : SiteScopeRoot/Health/BAC Integration Configuration
-----------------------------------------------------
Monitor properties:
_counters = Total Groups,Total Monitors,Duplicate BAC ID,BAC ID == (-1),Group with invalid path,Group with duplicate internal name,Monitor with invalid path,Monitor without internal ID,Monitor without internal name,Measurements with wrong catagory ID,Target with BAC ID == (-1)
_class = BACIntegrationConfigurationMonitor
_id = 5
_dependsCondition = good
_logOnlyMonitorData = true
_classifier = [value3 > 0 error, value2 > 0 error, value10 > 0 error, value5 > 0 error, value4 > 0 error, value9 > 0 error, value6 > 0 error, value7 > 0 error, value8 > 0 error, value0 >= 0 good, value1 >= 0 good]
_frequency = 86400
_enabled = true
_internalId = 20030425
_name = BAC Integration Configuration
_encoding = Cp1252

You can also redirect the output into a text file:
get_full_configuration -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin > c:\output.txt

run a specific monitor
run_monitor -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin -monitorpath "vm17015_SiteScope_Group1/CPU vm17001"

runing monitor...  vm17015_SiteScope_Group1/CPU vm17001
Monitor vm17015_SiteScope_Group1/CPU vm17001 was successfully schedualed to run

disable a specific monitordisable_monitor -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin -monitorpath "vm17015_SiteScope_Group
1/CPU vm17001"

disabling monitor...  vm17015_SiteScope_Group1/CPU vm17001
Monitor  vm17015_SiteScope_Group1/CPU vm17001 was successfully disabled

now get_full_configuration shows
-----------------------------------------------------
Monitor name : SiteScopeRoot/vm17015_SiteScope_Group1/CPU vm17001
-----------------------------------------------------
..
_enabled = false
..


disable a specific alert associated with a specific monitor
disable_alert -host vm17015.deu.hp.com -port 18080 -useSSL false -login admin -password admin -alertPath "vm17015_SiteScope_Group1/CP
U vm17001/email"

disabling alert...  vm17015_SiteScope_Group1/CPU vm17001/email
Alert  vm17015_SiteScope_Group1/CPU vm17001/email was successfully disabled

No comments:

Post a Comment