How Can We Help?
This section will describe the Topology API for adding new producers for a standard, customized KPIs.
Producer
A producer is used to collect the Performance Metric KPI. ‘producers’ API allows you to add customized KPI for the customized KPIs added or existing standard KPIs.
API Name – producers
Format – POST /api/accounts/<account_identifier>/producers
JSON Format
Input Required
Name | Description | Default Value | Predefined Values | Mandatory | More Info |
name | Producer Name | – | – | Yes | |
description | Description for the Producer | – | Yes | ||
kpiType | Type of the KPI | – | Core, Availability, FileWatch, ConfigWatch | Yes | Use only Predefiened values. |
isGroupKpi | Flag to mark if KPI belongs to a Group | – | 0, 1 | Yes | 0 – false, 1 – true |
producerType | Type of the Producer | – | SCRIPT, WMI, HTTP, JMX, WAS, JDBC, HTTP_JSON, JPPF | Yes | |
Object – producerAttributes | |||||
script_name | Name of the Script including the file extension | – | – | Yes | |
signature | Signature Generated | – | – | Yes | Get the signature generated from Heal |
kpiMapping | |||||
kpiIdentifier | KPI Identifier | – | – | Yes | |
componentVersionId | The actual version of the Component | – | – | Yes | |
componentName | Component Name | – | – | Yes | |
componentTypeName | Type of the Component | – | Application Server, Database Server, Services, Workload | Yes | Use only Predefiened values. |
Object – parameters | |||||
parameterType | Type of the Parameter | – | KEY_VALUE COMMANDLINE STANDARDINPUT ENV_PARAM | Yes | JDBC_Parameter_Type’, ’20’, ‘KEY_VALUE’, ’66’ ‘SCRIPT_Parameter_Type’, ’21’, ‘COMMANDLINE’, ’67’ ‘SCRIPT_Parameter_Type’, ’21’, ‘STANDARDINPUT’, ’68’ ‘WMI_Parameter_Type’, ’22’, ‘COMMANDLINE’, ’69’ ‘WMI_Parameter_Type’, ’22’, ‘ENV_PARAM’, ‘187’ ‘JMX_Parameter_Type’, ’23’, ‘KEY_VALUE’, ’70’ |
parameterName | Name or Key for the Parameter | – | – | Yes | |
parameterValue | Default Value for the Parameter | – | – | No |
Sample JSON
Success Rest Response
Failure Rest Response
Sample Request and Response for a Script producer
Use Case | Request | Response |
Valid Request JSON with all values provided | { “name”: ” TestProducer”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “SCRIPT”, “producerAttributes”: { “script_name”: “test.sh”, “signature”: “testSignature” }, “kpiMapping”: [ { “kpiIdentifier”: “CPU_UTIL”, “componentVersionId”: “6.1”, “componentName”: “AIX”, “componentTypeName”: “Host” }], “parameters”: [ { “parameterType”: “COMMANDLINE”, “parameterName”: “host”, “parameterValue”: “localhost” }, { “parameterType”: “COMMANDLINE”, “parameterName”: “user”, “parameterValue”: “appsone” }, { “parameterType”: “COMMANDLINE”, “parameterName”: “domain”, “parameterValue”: ” appnomi.com” }] } | { “message”: “Producer successfully created.”, “responseStatus”: “SUCCESS”, “data”: “12” } |
Valid Request JSON with only mandatory values provided | Same as above | { “message”: “Producer successfully created.”, “responseStatus”: “SUCCESS”, “data”: “12” } |
Invalid Request JSON | { } | { “message”: ” Request body cannot be empty”, “responseStatus”: “FAILURE”, “data”: null } |
Sample Request and Response for an EXTERNAL producer
Use Case | Request | Response |
Valid Request JSON with all values provided | { “name”: “TP-EXTERNAL”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “EXTERNAL”, “producerAttributes”: {}, “kpiMapping”: [ { “kpiIdentifier”: “CPU_UTIL”, “componentVersionId”: “6.x”, “componentName”: “RHEL”, “componentTypeName”: “Host”, “isDefault”: 1 }, { “kpiIdentifier”: “Open_tables”, “componentVersionId”: “5.5”, “componentName”: “MySQL”, “componentTypeName”: “Database Server”, “isDefault”: 1 } ], “parameters”: [] } | { “message”: “Producer successfully created.”, “responseStatus”: “SUCCESS”, “data”: “12” } |
Valid Request JSON with only mandatory values provided | Same as above | { “message”: “Producer successfully created.”, “responseStatus”: “SUCCESS”, “data”: “12” } |
Invalid Request JSON | { } | { “message”: ” Request body cannot be empty”, “responseStatus”: “FAILURE”, “data”: null } |
Sample Request and Response for a JDBC producer
Use Case | Request | Response |
Valid Request For MySQL (single parameter in where clause) | { “name”: “TP-JDBC-Mysql”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “JDBC”, “producerAttributes”: { “url”: “jdbc:mysql://{HostAddress}:{MonitorPort}”, “driver”: “com.mysql.jdbc.Driver”, “query”: “select Questions, Connections from appsone.customproducer where Threads=?”, “query_result”: “RESULTSET”, “is_query_encrypted”: “0” }, “kpiMapping”: [{ “kpiIdentifier”: “Questions”, “componentVersionId”: “5.7”, “componentName”: “MySQL”, “componentTypeName”: “Database Server”, “isDefault”: 1 }, { “kpiIdentifier”: “Connections”, “componentVersionId”: “5.7”, “componentName”: “MySQL”, “componentTypeName”: “Database Server”, “isDefault”: 1 }], “parameters”: [{ “parameterType”: “KEY_VALUE”, “parameterName”: “testName”, “parameterValue”: “3” }] } | { “message”:”SUCCESS”, “responseStatus”:”SUCCESS”, “data”:{ “179”:”TP-JDBC-Mysql” } } |
Valid Request For Oracle (single parameter in where clause) | { “name”: “TP-JDBC-Oracle”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “JDBC”, “producerAttributes”: { “url”: “jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={HostAddress})(PORT={MonitorPort}))(CONNECT_DATA=(SERVER=DEDICATED)({ConnectWith}={ConnectWithValue})))”, “driver”: “oracle.jdbc.OracleDriver”, “query”: “select LOCKWAITS, LRCOUNT from customproducer where THREADS=?”, “query_result”: “RESULTSET”, “is_query_encrypted”: “0” }, “kpiMapping”: [{ “kpiIdentifier”: “LOCKWAITS”, “componentVersionId”: “12.1.x”, “componentName”: “Oracle”, “componentTypeName”: “Database Server”, “isDefault”: 1 }, { “kpiIdentifier”: “LRCOUNT”, “componentVersionId”: “12.1.x”, “componentName”: “Oracle”, “componentTypeName”: “Database Server”, “isDefault”: 1 }], “parameters”: [{ “parameterType”: “KEY_VALUE”, “parameterName”: “testName”, “parameterValue”: “3” }] } | { “message”:”SUCCESS”, “responseStatus”:”SUCCESS”, “data”:{ “180”:”TP-JDBC-Oracle” } } |
Valid Request For MySQL (multiple parameters in where clause) | { “name”: “TP-JDBC-Mysql”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “JDBC”, “producerAttributes”: { “url”: “jdbc:mysql://{HostAddress}:{MonitorPort}”, “driver”: “com.mysql.jdbc.Driver”, “query”: “select Questions, Connections from appsone.customproducer where Threads=? and Connections>?”, “query_result”: “RESULTSET”, “is_query_encrypted”: “0” }, “kpiMapping”: [{ “kpiIdentifier”: “Questions”, “componentVersionId”: “5.7”, “componentName”: “MySQL”, “componentTypeName”: “Database Server”, “isDefault”: 1 }, { “kpiIdentifier”: “Connections”, “componentVersionId”: “5.7”, “componentName”: “MySQL”, “componentTypeName”: “Database Server”, “isDefault”: 1 }], “parameters”: [{ “parameterType”: “KEY_VALUE”, “parameterName”: “param1”, “parameterValue”: “3” },{ “parameterType”: “KEY_VALUE”, “parameterName”: “param2”, “parameterValue”: “6” }] } | { “message”:”SUCCESS”, “responseStatus”:”SUCCESS”, “data”:{ “179”:”TP-JDBC-Mysql” } } |
Valid Request For Oracle (multiple parameters in where clause) | { “name”: “TP-JDBC-Oracle”, “description”: “This is a producer”, “kpiType”: “Core”, “isGroupKpi”: 0, “producerType”: “JDBC”, “producerAttributes”: { “url”: “jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={HostAddress})(PORT={MonitorPort}))(CONNECT_DATA=(SERVER=DEDICATED)({ConnectWith}={ConnectWithValue})))”, “driver”: “oracle.jdbc.OracleDriver”, “query”: “select LOCKWAITS, LRCOUNT from customproducer where THREADS=? and LRCOUNT>?”, “query_result”: “RESULTSET”, “is_query_encrypted”: “0” }, “kpiMapping”: [{ “kpiIdentifier”: “LOCKWAITS”, “componentVersionId”: “12.1.x”, “componentName”: “Oracle”, “componentTypeName”: “Database Server”, “isDefault”: 1 }, { “kpiIdentifier”: “LRCOUNT”, “componentVersionId”: “12.1.x”, “componentName”: “Oracle”, “componentTypeName”: “Database Server”, “isDefault”: 1 }], “parameters”: [{ “parameterType”: “KEY_VALUE”, “parameterName”: “param1”, “parameterValue”: “3” },{ “parameterType”: “KEY_VALUE”, “parameterName”: “param2”, “parameterValue”: “2” }] } | { “message”:”SUCCESS”, “responseStatus”:”SUCCESS”, “data”:{ “180”:”TP-JDBC-Oracle” } } |
As indicated in the above sample, you can specify a query for collecting KPIs in “query” attribute. Specify the KPIs to be collected i.e. KPIs mapping in “kpiMapping” section. Specify value for “where” clause field in the query in “parameters” section. If there is more than one parameter in “where” clause field, ordering of these parameters in “parameters” section needs to be correct. You need to keep the ordering same as in “where” clause field for those parameters.
JDBC producers support only non-group KPIs.
If support for group KPIs is required, use script producers.
Generate Signature
To generate a signature for the Producer Script, generate-signature API has to be used.
- Copy the Producer Script to the required location.
- Get the Authorization Token to be used.
- Execute the following command to get the sginature generated for the script