dynatrace.Dynatrace-Tomcat-Agent

Dynatrace-Tomcat-Agent-Ansible

This Ansible role installs and configures the Dynatrace AppMon Agent of the Dynatrace AppMon solution for the Apache Tomcat application server.

Note: this role makes the Dynatrace AppMon Agent available to Apache Tomcat by injecting an appropriate -agentpath option into an environment variable, e.g. CATALINA_OPTS, inside a file (typically an executable script). It is assumed that this script either executes Apache Tomcat directly or is sourced by another script before Apache Tomcat gets executed. You will have to restart your application after placing the agent.

Download

The role is available via:

Dependencies

This roles depends on the following roles:

Role Variables

As defined in defaults/main.yml:

Name Default Description
dynatrace_tomcat_agent_env_var_name CATALINA_OPTS The name of the environment variable to be used for Agent injection.
dynatrace_tomcat_agent_env_var_file_name required The name of the file to be modified.
dynatrace_tomcat_agent_env_var_file_insert_after BOF A regex, BOF or EOF for begin-of-file and end-of-file, respectively. If a given regex is not matched, the -agentpath option will be appended to the file.
dynatrace_tomcat_agent_name apache-tomcat-agent The name of the Java Agent as it appears in Dynatrace AppMon.
dynatrace_tomcat_agent_collector_hostname localhost The location of the collector the Agent shall connect to.
dynatrace_tomcat_agent_collector_port 9998 The port on the collector the Agent shall connect to.
dynatrace_tomcat_agent_linux_agent_path /opt/dynatrace/agent/lib64/libdtagent.so The path to the Agent libary.
dynatrace_tomcat_agent_state present Whether the Agent shall be present or absent.

Example Playbook

- hosts: all
  roles:
    - role: Dynatrace.Dynatrace-Tomcat-Agent
      dynatrace_tomcat_agent_env_var_file_name: /opt/tomcat/bin/catalina.sh
      dynatrace_tomcat_agent_env_var_file_insert_after: '#!/bin/sh'

Testing

We use Test Kitchen to automatically test our automated deployments with Serverspec and RSpec:

  1. Install Test Kitchen and its dependencies from within the project's directory:
gem install bundler
bundle install
  1. Run all tests
kitchen test

By default, we run our tests inside Docker containers as this considerably speeds up testing time (see .kitchen.yml).

Additional Resources

Blogs

Presentations

Problems? Questions? Suggestions?

This offering is Dynatrace Community Supported. Feel free to share any problems, questions and suggestions with your peers on the Dynatrace Community's Application Monitoring & UEM Forum.

License

Licensed under the MIT License. See the LICENSE file for details. analytics

About

An Ansible role for automated deployments of the Dynatrace Java Agent for Apache Tomcat.

Install
ansible-galaxy install dynatrace.Dynatrace-Tomcat-Agent
GitHub repository
License
mit
Downloads
108
Owner
Dynatrace