Giter Club home page Giter Club logo

datapower-monitoring-extension's Introduction

Datapower Monitoring Extension

Use Case

The IBM® WebSphere® DataPower® SOA Appliance (hereafter called DataPower) is a purpose-built hardware platform designed to simplify, secure, and accelerate XML, Web services, and Enterprise Service Bus deployments.

Please refer to the screenshot link in the Metrics section for the list of reported metrics

This extension works only with the standalone machine agent.

Prerequisites

  1. Before the extension is installed, the prerequisites mentioned here need to be met. Please do not proceed with the extension installation if the specified prerequisites are not met.
  2. Download and install Apache Maven which is configured with Java 8 to build the extension artifact from source. You can check the java version used in maven using command mvn -v or mvn --version. If your maven is using some other java version then please download java 8 for your platform and set JAVA_HOME parameter before starting maven.
  3. The DataPower XML Management Interface must be enabled. The DataPower Monitor uses the "/service/mgmt/current" SOAP Endpoint to collect the metrics. Please refer to the IBM Redbook WebSphere DataPower SOA Appliance: The XML Management Interface Section 1.3, 1.4 and 1.5 to enable it.
  4. Make sure that the user has permissions to invoke the API. Refer troubleshooting section 5-6 for more details
  5. Start the Machine Agent before installing the extension and make sure that it is reporting the data fine.

Installation

  1. Clone the "datapower-monitoring-extension" repo using git clone <repoUrl> command.
  2. Run mvn clean install from "datapower-monitoring-extension"
  3. Unzip the DataPowerMonitor-VERSION.zip (from targets folder of Datapower Repo) to the "<MachineAgent_Dir>/monitors" directory.
  4. Edit the file config.yml located at <MachineAgent_Dir>/monitors/DataPowerMonitor The metricPrefix of the extension has to be configured as specified here. Please make sure that the right metricPrefix is chosen based on your machine agent deployment, otherwise this could lead to metrics not being visible in the controller.
  5. All metrics to be reported are configured in metrics.xml. Users can remove entries from metrics.xml to stop the metric from reporting, or add new entries as well.
  6. Restart the Machine Agent.

Please place the extension in the "monitors" directory of your Machine Agent installation directory. Do not place the extension in the "extensions" directory of your Machine Agent installation directory.

Configuration

Config.yml

Configure the extension by editing the config.yml file in <MACHINE_AGENT_HOME>/monitors/DataPowerMonitor/.

  1. Configure the "COMPONENT_ID" under which the metrics need to be reported. This can be done by changing the value of <COMPONENT_ID> in metricPrefix: Server|Component:<COMPONENT_ID>|Custom Metrics|DataPower|. For example,
    metricPrefix: "Server|Component:100|Custom Metrics|DataPower|"
    

More details around metric prefix can be found here.

  1. Server Details
            servers:
              - uri: http://localhost:5550/service/mgmt/current
                displayName: server1
                username: user
                password: welcome
                domains:
                  - default
                  - domain1
                useBulkApi: true
    
              - uri: https://someotherhost:5550/service/mgmt/current
                displayName: server2
                username: user
                encryptedPassword: C043Fag+LKEZM0AQTWPy2g==
                domainsRegex:
                  - fin_domain.*
                  - .*security.*
                useBulkApi: true
    

If encryptedPassword is used, make sure to update the encryptionKey in config.yml. Please refer here for more details on password encryption.

  1. Domains You have to set the domains from which you need the data from. You can choose between the properties domains or domainsRegex. If you dont know the domain name use default as shown.

            domains:
              - default
    

    domainsRegex property can be used to set a regex to match the domains.

            domainsRegex:
                  - fin_domain.*
                  - .*security.*
    
4.  **Bulk Data Fetching** `useBulkApi: true` There is a legacy API to get the data in bulk. This minimizes the number of round trips to DP server.
5.  **Proxy Support**
    ```
            proxy:
              uri: http://localhost:9090
              username: proxyyuser
              password: proxypassword
    ```

Metrics.xml

You can add/remove metrics of your choice by modifying the provided metrics.xml file. This file consists of all the metrics that will be monitored and sent to the controller. Please look how the metrics have been defined and follow the same convention, when adding new metrics. You do have the ability to chosoe your Rollup types as well as set an alias that you would like to be displayed on the metric browser.

  1. Metric Configuration Add the metric to be monitored with the metric tag as shown below.
             <metric value-xpath="FreeEncrypted" label="Free Encrypted (MB)" aggregationType = "OBSERVATION" timeRollUpType = "AVERAGE" clusterRollUpType = "COLLECTIVE"/>
    

For configuring the metrics, the following properties can be used:

Property Default value Possible values Description
alias metric name Any string The substitute name to be used in the metric browser instead of metric name.
aggregationType "AVERAGE" "AVERAGE", "SUM", "OBSERVATION" Aggregation qualifier
timeRollUpType "AVERAGE" "AVERAGE", "SUM", "CURRENT" Time roll-up qualifier
clusterRollUpType "INDIVIDUAL" "INDIVIDUAL", "COLLECTIVE" Cluster roll-up qualifier
multiplier 1 Any number Value with which the metric needs to be multiplied.
convert null Any key value map Set of key value pairs that indicates the value to which the metrics need to be transformed. eg: UP:1, OPEN:1
delta false true, false If enabled, gives the delta values of metrics instead of actual values.

All these metric properties are optional, and the default value shown in the table is applied to the metric (if a property has not been specified) by default.

Metrics

All the metrics reported by the extension are listed in metrics.xml file located at <MAHome>/monitors/<DatapowerMonitor>/metrics.xml. Please take a look at it to see what all metrics this extension can report.

Credentials Encryption

Please visit this page to get detailed instructions on password encryption. The steps in this document will guide you through the whole process.

Extensions Workbench

Workbench is an inbuilt feature provided with each extension in order to assist you to fine tune the extension setup before you actually deploy it on the controller. Please review the following document on How to use the Extensions WorkBench.

Troubleshooting

  1. Please follow the steps listed in this troubleshooting document in order to troubleshoot your issue. These are a set of common issues that customers might have faced during the installation of the extension.

  2. Verify Machine Agent Data: Please start the Machine Agent without the extension and make sure that it reports data. Verify that the machine agent status is UP and it is reporting Hardware Metrics

  3. config.yml: Validate the file here

  4. Special chars in config If you have special chars(like in passwords) in config.yml, make sure to wrap it in double quotes ""

  5. DataPower SOAP API: Please update the user:password and datapower:5550 with correct values. Invoke the URL from curl (or wget) and make sure that it is returning data. If it is not, then contact your DataPower Admin with these details

        curl -u user:password -d '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body xmlns:dp="http://www.datapower.com/schemas/management"><dp:request domain="default"><dp:get-status class="HTTPMeanTransactionTime"/></dp:request></SOAP-ENV:Body></SOAP-ENV:Envelope>' https://datapower:5550/service/mgmt/current
    
  6. Enable Statistics Enable Statistics should be set to enabled in the DataPower Admin screen.

  7. CPU Issue The issue is the default xml implementation which is bundled with the jdk is trying to read the factory class name from the jar file on every usage. This results in reading all the jar files in the classpath, which shoots up the CPU. Please use the following system properties resolve those. This should be added to machine agent startup before the -jar argument

        -Dcom.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager=com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
        -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
        -Dcom.sun.org.apache.xml.internal.dtm.DTMManager=com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault
    
  8. Metric Limit: Please start the machine agent with the argument -Dappdynamics.agent.maxMetrics=5000 if there is a metric limit reached error in the logs. If you dont see the expected metrics, this could be the cause.

  9. Check Logs: There could be some obvious errors in the machine agent logs. Please take a look.

Contributing

Always feel free to fork and contribute any changes directly here on GitHub.

Version

Name Version
Extension Version 2.0.0
Last Update 11/08/2021
Changes list ChangeLog

Note: While extensions are maintained and supported by customers under the open-source licensing model, they interact with agents and Controllers that are subject to AppDynamics’ maintenance and support policy. Some extensions have been tested with AppDynamics 4.5.13+ artifacts, but you are strongly recommended against using versions that are no longer supported.

datapower-monitoring-extension's People

Contributors

abeytom07 avatar balakrishnav avatar kunalgupapdx avatar oborys avatar prashmeh avatar saxenaabhi142 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datapower-monitoring-extension's Issues

DataPower Failed to respond

Hi,

i have the problem here that i don't get any metrics. In the logs comes continuously the following error message:

Win10 ==> [Monitor-Task-Thread2] 12 Jan 2022 18:57:44,559 ERROR BulkApiMetricFetcher-DataPowerMonitor - Error while fetching the data from absolute url=[https://datapower.com:8888/service/mgmt/current] and payload=[<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body xmlns:dp="http://www.datapower.com/schemas/management"><dp:request domain="default"><dp:get-status class="MemoryStatus"/></dp:request><dp:request domain="default"><dp:get-status class="FilesystemStatus"/></dp:request><dp:request domain="default"><dp:get-status class="CPUUsage"/></dp:request><dp:request domain="default"><dp:get-status class="SystemUsage"/></dp:request><dp:request domain="default"><dp:get-status class="SystemUsage2Table"/></dp:request></SOAP-ENV:Body></SOAP-ENV:Envelope>]
org.apache.http.NoHttpResponseException: datapower.com:8888 failed to respond
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) ~[httpcore-4.4.13.jar:4.4.13]
	at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) ~[httpcore-4.4.13.jar:4.4.13]
	at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) ~[httpcore-4.4.13.jar:4.4.13]
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[httpcore-4.4.13.jar:4.4.13]
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.13.jar:4.5.13]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) ~[httpclient-4.5.13.jar:4.5.13]
	at com.appdynamics.extensions.datapower.BulkApiMetricFetcher.getResponse(BulkApiMetricFetcher.java:114) [?:?]
	at com.appdynamics.extensions.datapower.BulkApiMetricFetcher.getResponse(BulkApiMetricFetcher.java:87) [?:?]
	at com.appdynamics.extensions.datapower.BulkApiMetricFetcher.getResponseForSystemWide(BulkApiMetricFetcher.java:82) [?:?]
	at com.appdynamics.extensions.datapower.BulkApiMetricFetcher.fetchMetrics(BulkApiMetricFetcher.java:60) [?:?]
	at com.appdynamics.extensions.datapower.MetricFetcher.run(MetricFetcher.java:68) [?:?]
	at com.appdynamics.extensions.executorservice.MonitorThreadPoolExecutor$TaskRunnable.run(MonitorThreadPoolExecutor.java:113) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

URI was replaced

If I send a curl from the same machine with the same credentials, I get a response:

curl -u user:password -d '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body xmlns:dp="http://www.datapower.com/schemas/management"><dp:request domain="default"><dp:get-status class="FirmwareVersion3"/></dp:request></SOAP-ENV:Body></SOAP-ENV:Envelope>' https://datapower.com:8888/service/mgmt/current
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1070    0   785  100   285   9437   3426 --:--:-- --:--:-- --:--:-- 13048<?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>2022-01-12T18:37:07+01:00</dp:timestamp><dp:status><FirmwareVersion3 xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<Serial>7803169</Serial>
<Version>IDG.10.X.X.X</Version>
<Build>XXXXX</Build>
<BuildDate>XXXXX</BuildDate>
<DeliveryType>XXX</DeliveryType>
<WatchdogBuild>XXXX</WatchdogBuild>
<InstalledDPOS>XXXXX</InstalledDPOS>
<RunningDPOS>XXXXXX</RunningDPOS>
<XMLAccelerator>embedded</XMLAccelerator>
<MachineType>XXXXXX</MachineType>
<ModelType>XXXXXXXX</ModelType>
<Tenant/></FirmwareVersion3></dp:status></dp:response></env:Body></env:Envelope>

Unfortunately, I can't find a solution to this anywhere - The SOAP interface should be configured correctly in the DP, as we use CA Wily Introscope in parallel. Can anyone help us further?

Could not load/instantiate the Java Task Main class for Java task [DataPowerMonitor Monitor Run Task]

Anyone have an idea what could be causing this error? The extension is not working when I check the logs.

[system-thread-0] 08 Mar 2022 17:51:31,047 ERROR JavaTaskCreator - Could not load/instantiate the Java Task Main class for Java task [DataPowerMonitor Monitor Run Task]
java.lang.RuntimeException: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
at com.appdynamics.extensions.datapower.util.SoapMessageUtil.(SoapMessageUtil.java:44) ~[?:?]
at com.appdynamics.extensions.datapower.DataPowerMonitor.(DataPowerMonitor.java:42) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
at java.lang.Class.newInstance(Unknown Source) ~[?:?]
at com.singularity.ee.agent.systemagent.task.JavaTaskCreator.createJavaTask(JavaTaskCreator.java:69) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.managed.MonitorTaskRunner.createTask(MonitorTaskRunner.java:75) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.managed.PeriodicTaskRunner.(PeriodicTaskRunner.java:41) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.managed.ManagedMonitorDelegate.setupEnvTask(ManagedMonitorDelegate.java:255) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.managed.ManagedMonitorDelegate.initializeMonitor(ManagedMonitorDelegate.java:212) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.NodeMonitorManager.readConfig(NodeMonitorManager.java:178) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.NodeMonitorManager.startAllMonitors(NodeMonitorManager.java:265) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.NodeMonitorManager.(NodeMonitorManager.java:79) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.components.monitormanager.AgentMonitorManager.(AgentMonitorManager.java:63) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.Agent.setupMonitorManager(Agent.java:486) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.Agent.startServices(Agent.java:393) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.SystemAgent.startServices(SystemAgent.java:79) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.singularity.ee.agent.systemagent.Agent.start(Agent.java:378) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at com.appdynamics.agent.sim.legacy.DefaultLegacyAgentRegistrationStateManager$1.run(DefaultLegacyAgentRegistrationStateManager.java:80) [machineagent.jar:Machine Agent v21.12.2-3210 GA compatible with 4.4.1.0 Build Date 2021-12-16 03:15:25]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:90) ~[jakarta.xml.soap-api-1.4.2.jar:1.4.2]
at com.appdynamics.extensions.datapower.util.SoapMessageUtil.(SoapMessageUtil.java:42) ~[?:?]
... 26 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.