White Papers
Abstract
By now, you have gone through a few aspects of monitoring DataPower appliance as well as configuring IBM Tivoli suite of products to monitor DataPower. Part 3 of this 3-part article series describes how to monitor DataPower appliances through the SOAP Configuration Management (SOMA) interface using cURL and Java as sample platforms.
Content
As discussed in Part 1, SOAP Configuration Management (SOMA) is a SOAP-based interface provided by the appliance. These interfaces are language independent, and therefore, can be exposed from any client that supports SOAP/HTTP. There are two such methods for demonstration, cURL-based monitoring and Java-based monitoring. Based on your choice, environment, and other factors, you can use this article to implement various client types. We will explore the installation, configuration, and invocation perspectives on both aspects of monitoring. For details about the concept of SOMA, refer to Part 1 of the series. cURL is a client side library that you can install on UNIX or Windows or Options for the cURL command are: You can view or update the port for SOMA (if required) as shown in Figure 1, which you can access by logging in to the default domain on the DataPower appliance (one of the generic approaches). To configure cURL on any machine, you need to install the cURL library. To install cURL, you need a binary package of it that you can download. A normal UNIX installation is done in three or four steps (after unpacking the source archive). The sample installation procedure is shown in Listing 3. For more details about the cURL installation options, refer to the product documentation. In Java-based monitoring, create an HTTPS Java client to call SOMA through the XML interface. The configuration of the interface is explained in the next section. Standard request XMLs are used by the Java client to fetch the status of the requested service. The request and response formats are the same for both approaches. To configure a Java client, set up a Java HTTPS client to make a call to the SOMA service of the device using its IP address and the port of the XML Management Interface. Different objects of DataPower appliance are monitored by changing the class attribute of the <dp:get-status> element. For example, to get the system usage status of the box, refer to the <dp:get-status> element with the class SystemUsage in the request message (Listing 4). Refer to <dp:get-status> in the response message (Listing 5). It indicates that the operation has performed successfully and the corresponding class elements can be obtained. The example underneath demonstrates the elements, such as Interval, Load, and Worklist of SystemUsage. To get the system usage status of the box, the cURL command invokes the SOMA service using the input request "XML GetSystemUsage_Req.xml" and gets the response from the DataPower device in "GetSystemUsage_Resp.xml" as shown in Listing 6. A Java HTTPS client invokes the SOMA service by sending the input SOAP as a request and gets a response back from the DataPower device. Make sure the client is HTTPS and not HTTP. There is a requisite while developing a HTTPS client and that is to manage the certificate. Listing 7 shows an example of HTTPS. This class is used to invoke the XML Management Interface over HTTPS. For a detailed description, see the files that are available in the Download section of the article. The request and response structures are always the same for cURL and Java-based monitoring for any client build up. One of the basic request types is shown in Listing 8 for the default domain. To get the status of different objects, change the attribute class value in the <dp:get-status> element according to the object class value. For example, to get the memory status, the input request element has this class value: To get the domain status, the input request element has this class value: Depending upon the class value used in the request, the response xmls contains the corresponding elements inside the <dp:status> element. These are either a singular or multiple repetitive elements according to your class value. For example, the output for memory usage is singular, whereas the domain status has multiple elements corresponding to the domains that exist in the DataPower appliance. The output needs to be parsed to fetch the appropriate metrics for further usage according to the monitoring requirements. Listing 9 shows an example of the response for the environment sensors. This article series highlighted the different monitoring approaches for WebSphere DataPower appliances. Part 3, the last in this series, demonstrated the practical usage of the concepts and solution introduced in Part 1 by using the SOMA interface. You learned the high level requirements and complexity involved in using the SOMA interface. The authors would like to thank Rakesh R. Nair for his review of the article series. Rakesh is a WebSphere DataPower specialist and has led many DataPower-based engagements for worldwide customers.Introduction
cURL based monitoring
curl –k –u user:password –d @myRequestFile.xml https://ipaddress:Port/EndpointURI
curl –insecure –u user:password –d @myRequestFile.xml https://ipaddress:Port/EndpointURI

cd /usr/local/src wget http://curl.haxx.se/download/curl-7.19.0.tar.gz tar zxf curl-7.19.0.tar.gz cd curl-7.19.0 ./configure --prefix=/usr/local --with-ssl=/usr/include/openssl make make install
<?xml version=\"1.0\" encoding=\"UTF-8\"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request xmlns:dp="http://www.datapower.com/schemas/management"> <dp:get-status class="SystemUsage"/> </dp:request> </env:Body> </env:Envelope>
<?xml version=\"1.0\" encoding=\"UTF-8\"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:response xmlns:dp="http://www.datapower.com/schemas/management"> <dp:timestamp>2012-03-02T13:52:02+05:30</dp:timestamp> <dp:status> <SystemUsage xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <Interval>1000</Interval> <Load>47</Load> <WorkList>2</WorkList> </SystemUsage> </dp:status> </dp:response> </env:Body> </env:Envelope>
curl --insecure --data-binary @GetSystemUsage_Req.xml -u user:password https://10.1.1.1:9550/service/mgmt/current > GetSystemUsage_Resp.xml
String ip = "127.0.0.1"; // ipaddress of DataPower device int port = 9550; // SOMA port number String user = "admin"; String pass = "password"; HTTPSClient httpsCleintObj = new HTTPSClient(ip, port, user, pass); httpsCleintObj.connect(true); String environmentalSensorsReq = "<env:Envelope"+ "xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"><env:Body><dp:request"+ "xmlns:dp=\"http://www.datapower.com/schemas/management\"><dp:get-status"+ "class=\"EnvironmentalSensors\"/></dp:request></env:Body></env:Envelope>"; String environmentalSensorsResp =httpsCleintObj.sendMessage(environmentalSensorsReq); System.out.println("Response from Datapower device:"+environmentalSensorsResp); httpsCleintObj.releaseConnection();
<?xml version=\"1.0\" encoding=\"UTF-8\"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request xmlns:dp="http://www.datapower.com/schemas/management"> <dp:get-status class="EnvironmentalSensors"/> </dp:request> </env:Body> </env:Envelope>
‘MemoryStatus’ <dp:get-status class="MemoryStatus".‘DomainStatus’ <dp:get-status class="DomainStatus".Response structure
<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:response xmlns:dp="http://www.datapower.com/schemas/management"> <dp:timestamp>2012-03-02T15:01:20+05:30</dp:timestamp> <dp:status> <EnvironmentalSensors xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <systemTemp>0</systemTemp> <cpu1Temp>31</cpu1Temp> <cpu2Temp>30</cpu2Temp> <cpu1rpm>0</cpu1rpm> <cpu2rpm>0</cpu2rpm> <chassis1rpm>0</chassis1rpm> <chassis2rpm>0</chassis2rpm> <chassis3rpm>0</chassis3rpm> <caseopen>no</caseopen> <volt33>3.36</volt33> <volt5>5.08</volt5> <volt12>11.5</volt12> <powersupply>ok</powersupply> <batteryinstalldate>Thu Jan 1 05:29:59 1970 </batteryinstalldate> <checkintrusion>yes</checkintrusion> </EnvironmentalSensors> </dp:status> </dp:response> </env:Body> </env:Envelope>
Conclusion
Acknowledgments
Was this topic helpful?
Document Information
Modified date:
08 June 2021
UID
ibm11109637