# Moogsoft Docs

## Introduction

Dynatrace AppMon provides comprehensive application monitoring and performance lifecycle management. Moogsoft Dynatrace APM Integration (LAM) connects with Dynatrace AppMon, fetches incidents from it and forwards them to Moogsoft AIOps.

See Dynatrace APM for UI configuration instructions.

1. LAM reads the configuration from the dynatrace_apm_lam.conf file.
2. LAM will connect with Dynatrace APM REST API with the given host name.
3. The response is received with event data in the JSON format.
4. Dynatrace APM LAM has an option to filter event data based on the set filters. If filters are set, then the events are fetched based on the defined filters in the config file.
5. The incidents are parsed and converted into normalized Moogsoft AIOps events.
6. The normalized events are then published to MooMS bus.

# Configuration

The incidents received from Dynatrace AppMon are processed according to the configuration in the dynatrace_apm_lam.conf file. The processed incidents are published to Moogsoft AIOps.

The configuration file contains a JSON object. At the first layer of the object, the LAM has a parameter called config, and the object that follows config has all the necessary information to control the LAM.

The Dynatrace APM LAM configuration file has the following sections:

## Monitor

The Dynatrace APM LAM takes the incidents from the Dynatrace AppMon. You can configure parameters here to establish a connection with Dynatrace AppMon:

### General

Field Type Description Example
name and class String Reserved fields: do not change. Default values are DynatraceApm Lam Monitor and CDynatraceApmMonitor.
host_url String

Enter the Dynatrace APM Server Base URL or Host Name along with its port.

You can use one of the below mentioned configuration for host_url:

1. If base_url is localhost:8020 and ssl is set to false, then the lam will form the host_url as http://localhost:8020/ .
2. If base_url is localhost:8021 and ssl is set to true, then the lam will form the host_url as https://localhost:8021.
3. You can directly enter the host_url as http://localhost:8020 . In this case, ssl should be false.
4. You can directly enter the host_url as https://localhost:8021 . In this case, ssl can be true or false.

encrypted_password String If the password is encrypted, then enter the encrypted password in this field and comment out the password field. At a time, either password or the encrypted_password field is used. If both the fields are not commented, then the field encrypted_password will be used by the Dynatrace APM LAM.
polling_interval Integer

The polling time interval, in seconds, between the requests after which the event data is fetched from Dynatrace.

Default = 10 seconds. If 0 is entered, the time interval is set to 10 seconds.

max_retries Integer

The maximum number of retry attempts to reconnect with Dynatrace in case of a connection failure.

Default = -1, if no value is specified, then there will be infinite retry attempts.

If the specified value is greater than 0, then the LAM will try that many times to reconnect; in case of any other value less than 0, max retries will set to default.

retry_interval Integer The time interval between two successive retry attempts.
Default = 60 seconds, if 0 is entered, the time interval will set to default.

timeout Integer The value in seconds to wait for a request to complete before timing out. If a timeout occurs, the LAM will wait for the next poll before trying again. Default value is 120 seconds.

### Filter

Field Type Description
filter Object
Parameters to filter incidents:
• profileName : Enter the Dynatrace profile name.
• incidentRule: Enter the incident rule.

Setting both these parameters will fetch the incidents from the single incident rule of the profile. A profile name takes only one incident rule.
If only the profileName filter is set, then the incidents will be fetched from all the incident rules of the profile.

• state: The incidents with the mentioned state will be fetched from the Dynatrace AppMon server. At a time, you can give only one state. The states that can be given here are Created , InProgress and Confirmed.
• time_from : The incidents will be fetched from the time given here. The time should be given in the yyyy-mm-ddThh:mm:ss.SSSz format.
• time_till : The incidents will be fetched till the time given here. The time should be given in the yyyy-mm-ddThh:mm:ss.SSSz format.

The Dynatrace API is limited to 3 days, and therefore, the Dynatrace LAM will not fetch incidents which are older than 3 days. However, o pen incidents have no limits.

### Secure Sockets Layer

Field Type Description
ssl Boolean Enter true here, to enable SSL Communication:
• ssl_keystore_file_path : Enter the path of the keystore file. This is the path where the generated keystore file is copied e.g. "/usr/local/dynatrace_ssl/KeyStore.jks".

• ssl_keystore_password : Enter the password of keystore. It is the same password that was entered when the keystore was generated.

### Example

Config File
config :
{

monitor:
{
name                    		  : "DynatraceApm Lam Monitor",

class               		      : "CDynatraceApmMonitor",

host_url                		  : "localhost:8021",

ssl                      		  : false,

ssl_keystore_file_path   		  : "",

polling_interval         		  : 10,

max_retries              		  : -1,

retry_interval           		  : 60,

timeout 				  		  : 120,
filter                            : {
profileName  : "",

incidentRule : "",

state        : "",

# time_from  : "",

# time_till  : ""
}

},

## Agent

Agent allows you to define two parameters:

Field
name This is the agent name, the events sent to MooMS by the Dynatrace APM LAM are identified by the agent name in the log. Here in this LAM, the agent name is Dynatrace APM.
log Dynatrace APM LAM will write its ingress contents in the file dynatrace_apm_lam.log located at /var/log/moogsoft/.

## Mapping

For incidents received in JSON format, you can directly map the (Incident) alarm/event fields of Dynatrace AppMon with Moogsoft fields. In the case of an event received in text format, the event is first tokenised in the Variable section, and then the tokenised event is mapped in the mapping section. The parameters of the received alarm/event are displayed in the Moogsoft AIOps according to the mapping done here:

mapping :
{
catchAll: "overflow",
rules:
[
{ name: "signature", rule:      "$systemprofile ::$rule" },
{ name: "source_id", rule:      "Dynatrace APM" },
{ name: "external_id", rule:    "$id" }, { name: "manager", rule: "Dynatrace APM" }, { name: "source", rule: "$source" },
{ name: "class", rule:          "$rule" }, { name: "agent", rule: "$LamInstanceName" },
{ name: "agent_location", rule: "$LamInstanceName" }, { name: "type", rule: "$state" },
{ name: "severity", rule:       "$severity", conversion:"sevConverter" }, { name: "description", rule: "$message" },
{ name: "agent_time", rule:     "\$start", conversion:"timeConverter"}
]
},
filter:
{
presend:"DynatraceApmLam.js"
}

The above example specifies the mapping of the Dynatrace AppMon incident fields with the Moogsoft AIOps fields. Data not mapped to Moogsoft AIOps Fields goes into "Custom Info".

The stringToInt is used to convert the data received in the string format into an integer format.

### Note

The signature field is used by the LAM to identify correlated incidents.

## Constants and Conversions

Field Description Example
Severity and sevConverter has a conversion defined as sevConverter in the Conversions section, this looks up the value of severity defined in the severity section of constants and returns back the mapped integer corresponding to the severity
severity:
{
"informational" : 1,
"warning"       : 2,
"severe"        : 5
}, 
sevConverter:
{
lookup : "severity",
input  : "STRING",
output : "INTEGER"
},
stringToInt used in a conversion, which forces the system to turn a string token into an integer value
stringToInt:
{
input  : "STRING",
output : "INTEGER"
},
timeConverter used in conversion which forces the system to convert time. If epoch time is to be used, then timeFormat mentioned in timeConverter should be commented. Otherwise, the user should provide the timeFormat
timeConverter:
{
timeFormat : "yyyy-MM-dd'T'HH:mm:ss.SSS",
input      : "STRING",
output     : "INTEGER"
}

### Example

Example Constants and Conversions
constants:
{
severity:
{
"informational" : 1,
"warning"       : 2,
"severe"        : 5
},
},

conversions:
{
sevConverter:
{
lookup: "severity",
input:  "STRING",
output: "INTEGER"
},

stringToInt:
{
input:      "STRING",
output:     "INTEGER"
},

timeConverter:
{
timeFormat: "yyyy-MM-dd'T'HH:mm:ss.SSS",
input:      "STRING",
output:     "INTEGER"
}
},

# Service Operation Reference

Process Name Service Name
dynatrace_apm_lam dynatraceapmlamd

Start the LAM Service:

service dynatraceapmlamd start

Stop the LAM Service:

service dynatraceapmlamd stop

Check the LAM Service status:

service dynatraceapmlamd status

## Command Line Reference

To see the available optional attributes of the dynatrace_apm_lam, run the following command:

dynatrace_apm_lam --help

The dynatrace_apm_lam is a command line executable, and has the following optional attributes:

Option Description

--config

Points to a pathname to find the configuration file for the LAM. This is where the entire configuration for the LAM is specified.
--help Displays all the command line options.
--version

Displays the component’s version number.

--loglevel

Specifies the level of debugging. By default, user gets everything. In common with all executables in MOOG, having it set at that level can result in a lot of output (many messages per event message processed).

In all production implementations, it is recommended that log level is set to WARN. This ensures only warning, error and fatal messages are recorded.

# Performance Information

Minimum requirement
Component Value
CPU 2 core
RAM 4 GB
Operating System CentOS Linux release 6.7

# Version

Integration Version Tool Version
1.0 - 1.8 Dynatrace Server 6.5 & Dynatrace Server 7.0