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

{ “name”: “<Producer Name>”, “description”: “<Description for the Producer>”, “kpiType”: “<Type of the KPI>”, “isGroupKpi”: <Flag to mark if KPI belongs to a Group>, “producerType”: “<Type of the Producer>”, “producerAttributes”: { “script_name”: “<Name of the Script including the file extension>”, “signature”: “<Signature Generated>” }, “kpiMapping”: [ { “kpiIdentifier”: “<KPI Identifier>”, “componentVersionId”: “<Actual version of the Component>”, “componentName”: “<Component Name>”, “componentTypeName”: “<Type of the Component>” } ], “parameters”: [ { “parameterType”: “<Type of the Parameter>”, “parameterName”: “<Name or Key for the Parameter>”, “parameterValue”: “<Default Value for the Parameter>” } ] }

Input Required

NameDescriptionDefault ValuePredefined ValuesMandatoryMore Info
nameProducer NameYes
descriptionDescription for the ProducerYes
kpiTypeType of the KPICore, Availability, FileWatch, ConfigWatchYesUse only Predefiened values.
isGroupKpiFlag to mark if KPI belongs to a Group0, 1Yes0 – false, 1 – true
producerTypeType of the ProducerSCRIPT, WMI, HTTP, JMX, WAS, JDBC, HTTP_JSON, JPPFYes
Object – producerAttributes
script_nameName of the Script including the file extensionYes
signatureSignature GeneratedYesGet the signature generated from Heal
kpiMapping
kpiIdentifierKPI IdentifierYes
componentVersionIdThe actual version of the ComponentYes
componentNameComponent NameYes
componentTypeNameType of the ComponentApplication Server, Database Server, Services, WorkloadYesUse only Predefiened values.
Object – parameters
parameterTypeType of the ParameterKEY_VALUE
COMMANDLINE
STANDARDINPUT
ENV_PARAM
YesJDBC_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’
parameterNameName or Key for the ParameterYes
parameterValueDefault Value for the ParameterNo

 

Sample JSON

 { “name”: “CodeProducer”, “description”: “This is the custom producer for the Booking Code”, “kpiType”: “Core”, “isGroupKpi”: 1, “producerType”: “SCRIPT”, “producerAttributes”: { “script_name”: “coder.sh”, “signature”: “MIGUAkgCA0KpvHaLsJQRenYSeUuqcTuT7IszAwQiZHS1IvK57K1DzQV+9O9cpQeYMIGB4w2tlxG8L+2G+SzrgtEP7WRGXgKkGBKqFzsCSAMpbAmOdzo10Xl/rsvzmEdcvz74wwzTNTSUAd4k2/yyQi0XtDO7Xva0kpWZ5YCxcDs84gftHC7f2HaVY0z5Z+F4e8bT6BahOQ==” }, “kpiMapping”: [ { “kpiIdentifier”: “Coupon_Code-1581066393640”, “componentVersionId”: “1.1”, “componentName”: “BookingComponent”, “componentTypeName”: “Application Server” } ], “parameters”: [ { “parameterType”: “COMMANDLINE”, “parameterName”: “host”, “parameterValue”: “localhost” } ] }

Success Rest Response

{ “message”: “SUCCESS”, “responseStatus”: “SUCCESS”, “data”: 171 }

Failure Rest Response

{ “message”: “Invalid producer details”, “responseStatus”: “FAILURE”, }

Sample Request and Response for a Script producer

Use CaseRequestResponse
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 providedSame 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 CaseRequestResponse
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 providedSame 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 CaseRequestResponse
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.

  1. Copy the Producer Script to the required location.
  2. Get the Authorization Token to be used.
  3. Execute the following command to get the sginature generated for the script

 curl -k -X POST -H “Authorization:”<Authorization_Token>”” -H “Content-Type:multipart/form-data;boundary=XXX” -F file=@/<path for the script>/<scriptname_withextension> https://<keycloak_host>:<keycloak_port>/appsone-controlcenter/v2.0/api/accounts/<account_identifier>/generate-signature

Table of Contents