Giter VIP home page Giter VIP logo

dynatrace-appmon-chef's Introduction

dynatrace Cookbook

This Chef cookbook installs and configures the Dynatrace Application Monitoring 7.2 solution.

Build Status

Requirements

Requires Chef 12 or higher.

Recipes

default

Installs the Dynatrace Server. Please refer to the server Chef Recipe below.

agents_package

Installs the Dynatrace Agents package.

This recipe downloads and installs the most recent version of the Dynatrace Agents package from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['agents_package'][$platform]['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-agent.jar (Linux) or as dynatrace-agent.msi (Windows) in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/agents_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::agents_package] in a runlist and override attributes as required.

Note: this recipe merely makes the Dynatrace Agents available, but it does not configure your application to actually load any. See the java_agent recipe for an example that does.

agents_package_uninstall

This recipe uninstalls the Dynatrace Agents package installed by the agents_package recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by the agents_package recipe. Note: as part of the uninstallation process the opt/dynatrace directory is deleted which is by default shared by other Dynatrace components (e.g. wsagent_package).

apache_wsagent

Installs the Dynatrace WebServer Agent for the Apache HTTP Server.

This recipe downloads and installs the most recent version of the Dynatrace WebServer Agent package from http://downloads.dynatracesaas.com and integrates the agent with the Apache HTTP Server. The default download link can be overridden via the node['dynatrace']['wsagent_package']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-wsagent.tar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/apache_wsagent.rb and attributes/wsagent_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::apache_wsagent] in a runlist and override attributes as required.

Note: you will have to restart the web server after placing the agent.

apache_wsagent_uninstall

This recipe remove the agent from the Apache HTTP Server configuration file and uninstalls the Dynatrace WebServer Agent package installed by the apache_wsagent recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by the apache_wsagent recipe. Note: as part of the uninstallation process the opt/dynatrace directory is deleted which is by default shared by other Dynatrace components (e.g. agents_package).

collector

Installs the Dynatrace Collector.

This recipe downloads and installs the most recent version of the Dynatrace Collector from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['collector']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-collector.jar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/collector.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::collector] in a runlist and override attributes as required.

Note: make sure that attributes related to the Collector's memory configuration are set in accordance to the Memory Configuration section of the Collector Configuration documentation.

collector_uninstall

This recipe uninstalls the Dynatrace Collector package installed by the collector recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by collector recipe.

dotnet_agent

Installs the Dynatrace .NET Agent.

This recipe downloads and installs the most recent version of the Dynatrace Agents package from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['agents_package']['windows']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-agent.msi in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/dotnet_agent.rb and attributes/agents_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::dotnet_agent] in a runlist and override attributes as required.

host_agent

Installs the Host Agent package.

This recipe downloads and installs the most recent version of the Host Agent package from http://downloads.dynatracesaas.com. The default download link can #be overridden via the ['dynatrace']['host_agent']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-hostagent.tar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/host_agent.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::host_agent] in a runlist and override attributes as required.

host_agent_uninstall

This recipe uninstalls the Dynatrace Host Agent package installed by the host_package recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by the host_package recipe. Note: as part of the uninstallation process the opt/dynatrace directory is deleted which is by default shared by other Dynatrace components (e.g. agents_package).

iis_wsagent

Installs the Dynatrace WebServer Agent for the Microsoft IIS Server.

This recipe downloads and installs the most recent version of the Dynatrace WebServer Agent package from http://downloads.dynatracesaas.com and integrates the agent with the Microsoft IIS Server. The default download link can be overridden via the node['dynatrace']['wsagent_package']['windows']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-agent.msi in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/iis_wsagent.rb and attributes/wsagent_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::iis_wsagent] in a runlist and override attributes as required.

java_agent

Installs the Dynatrace Agent Java Agent.

This recipe downloads and installs the most recent version of the Dynatrace Agents package from http://downloads.dynatracesaas.com and integrates the agent with a Java process. The default download link can be overridden via the node['dynatrace']['agents_package']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-agents.jar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/java_agent.rb and attributes/agents_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::java_agent] in a runlist and override attributes as required.

Note: this recipe makes the Java Agent available to a Java Virtual Machine by injecting an appropriate -agentpath option into an environment variable, e.g. JAVA_OPTS, inside a file (typically an executable script). It is assumed that this script either executes the Java process directly or is sourced by another script before the Java process gets executed. You will have to restart the application after placing the agent.

Note: it is only possible to inject one agent on one machine using this recipe. To inject more agents it is possible to use the resources/java_agent.rb resource which sets the node['dynatrace']['java_agent']['javaopts'][$agent_name] with options to be passed to the JVM (e.g. -agentpath:/opt/dynatrace/agent/lib64/libdtagent.so=name=BusinessBackend_easyTravel,server=dynasprint-collector.dynatracesaas.com:9998).

memory_analysis_server

This recipe downloads and installs the most recent version of the Dynatrace Memory Analysis Server from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['memory_analysis_server']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-analysisserver.jar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/memory_analysis_server.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::memory_analysis_server] in a runlist and override attributes as required.

Note: make sure that attributes related to the Analysis Server's memory configuration are set in accordance to the Memory Configuration section of the Memory Analysis Server Configuration documentation.

server

Installs the Dynatrace Server.

This recipe downloads and installs the most recent version of the Dynatrace Server from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['server']['linux']['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-server.jar in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/server.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::server] in a runlist and override attributes as required.

server_uninstall

This recipe uninstalls the Dynatrace Server package installed by the server recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by server recipe.

server_license

Installs the Dynatrace Server License.

Place the Dynatrace Server License as dynatrace-license.lic in the cookbook's files directory. Alternatively, you can make the license available as an HTTP or FTP resource and point the Chef Recipe to the right location via the node['dynatrace']['server']['license']['file_url'] attribute. Please refer to attributes/server.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::server_license] in a runlist.

server_pwh_connection

Sets connection to the Performance Warehouse.

This recipe sets the connection to the Performance Warehouse on the Dynatrace Server. This recipe assumes the Dynatrace Server is up and running. Please refer to the .kitchen.yml file for example of usage.

Note: This recipe will work after installing the Server License (see server_license recipe).

server_ldap_config

Configures LDAP connection.

This recipe configures connection to LDAP through RESTful API. This recipe assumes the Dynatrace Server is up and running. Please refer to the .kitchen.yml file for example of usage.

server_users

Configures server user accounts.

This recipe creates/updates Dynatrace Server user accounts through RESTful API. This recipe assumes the Dynatrace Server is up and running. The user account configuration is passed as node attributes. Please refer to the .kitchen.yml file for example of usage.

server_user_groups

Configures server groups.

This recipe creates/updates Dynatrace Server groupsthrough RESTful API. This recipe assumes the Dynatrace Server is up and running. The group configuration is passed as node attributes. Please refer to the .kitchen.yml file for example of usage.

wsagent_package

Installs the Dynatrace WebServer Agent package.

This recipe downloads and installs the most recent version of the Dynatrace WebServer Agent package from http://downloads.dynatracesaas.com. The default download link can be overridden via the node['dynatrace']['wsagent_package'][$platform]['installer']['file_url'] attribute. Alternatively, you can place the installer artifact as dynatrace-wsagent.tar (Linux) or dynatrace-agent.msi (Windows) in the cookbook's files directory from where it will be picked up during the installation. Please refer to attributes/wsagent_package.rb for a list of supported attributes. In order to have the Chef Recipe executed, include recipe[dynatrace::wsagent_package] in a runlist and override attributes as required.

Note: this recipe merely makes the Dynatrace WebServer Agent available, but it does not configure your web server to actually load it. See the apache_wsagent and iis_agentrecipes for examples.

wsagent_package_uninstall

This recipe uninstalls the Dynatrace WebServer Agent package installed by the wsagent_package recipe.

Note: this recipe does not delete the user created by the dynatrace_user recipe which is included by the wsagent_package recipe. Note: as part of the uninstallation process the opt/dynatrace directory is deleted which is by default shared by other Dynatrace components (e.g. agents_package).

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, requires Ruby 2.2+). Alternatively, you may as well run these tests in virtual machines based on VirtualBox and Vagrant (see .kitchen.vagrant.yml).

Platforms

Linux

  • CentOS
  • Debian
  • Red Hat Enterprise Linux
  • Ubuntu

Windows

  • Windows 2012

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

dynatrace-appmon-chef's People

Contributors

autplayed avatar dynapozieblo avatar jkulesz avatar knorp avatar marcinzejer avatar metmajer avatar nicka avatar piotrmejer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

dynatrace-appmon-chef's Issues

web server agent won't work in 32 bit architecture

Hi all

We are testing the new version of Dynatrace using this recipe and make it work perfectly in 64 bit architecture, but when attempt to install the agent in a server with 32 bit architecture, apparently it is trying to run the 64 binary file anyways and the daemon won't start.

We already have set the x86 arch attribute and the collector is connected correctly as well.

Can you please let me know if there is an issue with the recipe or we are doing something wrong.
Greetings.

wsagent_package

Hello,

Recently were corrected recipes for collector and server. Could you please correct recipe for wsagent_package to use it with cron? For now it restarts agent and apache server every run.

separating licence install from server recipe

Currently, the license install is part of the server recipe, please refer here

Is it possible to separate this latter part into another recipe? This allows for testing server installation separately before license installation.

allow a toggle on the java recipe include

It would be nice to allow for a boolean flag to turn on / off the include_recipe on the java cookbook. We've got a lightweight jdk resource that we prefer to some of the extra content in the java cookbook.

Chef with cron

Hello,

Usually I run chef-client every 5 minutes on all my nodes. But new cookbook version doesn't allow it. It restarts server and collectors every run.
Could you please correct it? For example add to your resources "updated_by_last_action?"

Compile Error on s3_file.rb

When running the host_agent recipe i'm getting the following error from the s3_file.rb resource:

NameError

undefined local variable or method `use_inline_resources' for #Class:0x000000043b7e88

Cookbook Trace:

/var/chef/cache/cookbooks/dynatrace-appmon/resources/s3_file.rb:22:in `class_from_file'

Relevant File Content:

/var/chef/cache/cookbooks/dynatrace-appmon/resources/s3_file.rb:

15: property :region, String
16: property :access_key_id, String
17: property :secret_access_key, String
18: property :owner, String
19: property :group, String
20: property :mode, String
21:
22>> use_inline_resources
23:
24: action :create do
25: require 'aws-sdk'
26:
27: # Detecting if we want to upload or download from S3
28: upload_to_s3 = false
29: if source.start_with?('s3://')
30: s3_url = source.dup
31: elsif target.start_with?('s3://')

My system run info is provided below:

System Info:

chef_version=12.21.3
platform=redhat
platform_version=7.3
ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
program_name=chef-client worker: ppid=28803;start=11:06:34;
executable=/opt/chef/bin/chef-client

This is on an aws instance.

Recipe Compile Error - undefined local variable or method `use_inline_resources' (/resources/s3_file.rb:22)

I tried to run this cookbook's server profile via kitchen on openstack, and was met with the following response:

       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/dynatrace-appmon/resources/s3_file.rb
       ================================================================================

       NameError
       ---------
       undefined local variable or method `use_inline_resources' for #<Class:0x0000000004d011b0>

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/dynatrace-appmon/resources/s3_file.rb:22:in `class_from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/dynatrace-appmon/resources/s3_file.rb:

        15:  property :region, String
        16:  property :access_key_id, String
        17:  property :secret_access_key, String
        18:  property :owner, String
        19:  property :group, String
        20:  property :mode, String
        21:
        22>> use_inline_resources
        23:
        24:  action :create do
        25:    require 'aws-sdk'
        26:
        27:    # Detecting if we want to upload or download from S3
        28:    upload_to_s3 = false
        29:    if source.start_with?('s3://')
        30:      s3_url = source.dup
        31:    elsif target.start_with?('s3://')

       System Info:
       ------------
       chef_version=12.22.5
       platform=redhat
       platform_version=7.5
       ruby=ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux]
       program_name=chef-client worker: ppid=2141;start=22:02:05;
       executable=/opt/chef/bin/chef-client

I tried with Chef client 12, 13, and 14. 13 and 14 gave other errors that I was able to work around. the resource names cannot be set to type string with a default of nil. A type mismatch error is returned, as the default type must match the defined type for the property.

Also, the kitchen files that you provide reference recipe[dynatrace::server] but the cookbook name (in the metadata.rb) is dynatrace-appmon, so the runlist in the .kitchen.yml does not seem to be valid.

error when starting dtwsagent

Error when starting dtwsagent

$ sudo service dynaTraceWebServerAgent start

OUTPUT:
File not found or not executable: /opt/dynatrace-6.2-agent/dynatrace/agent/lib/dtwsagent

piping bitness/Y/Y via echo is not really necessary anymore

Just as a hint - the installers since dynaTrace 6.1 are able to get parameterized with the arguments -b/-bitness and -y/-yes and are therefore truly non interactive.
Therefore the trick with piping in additional input via echo -e is actually not required anymore.

Agent package and WsAgent are competing when installed to the same directory

agents_package and wsagent_package both share the agent directory when installed to the same directory. Whoever is installed last will effectively overwrite the installation of the former.

Proposed solution as of now: when both agents are required on the same host, install them into different directories, using the respective ...['installer']['prefix_dir'] attributes.

Chef supermarket.

Hello,

Could you please update files at Chef Supermarket. There is old commit.

Thank You.

Dynatrace java attributes

Hello,

There is attribute:
override['java']['jdk_version'] = '7'

I thinks it's bad idea to set this as "override". I have another services on the same node that installs java 8. But once I added java_agent recipe I get java 1.7 on machine.

Could you please correct it or explain why you do it?

Thank You.

Setting group as dynatrace_owner?

Hello,
I'm not sure if this was coded intentionally or it is a mistake. Line 89 in recipes/wsagent_package.rb is setting group of dtwsagent.ini as dynatrace_owner.
When I apply the recipe it fails since the owner attribute I override is not recognised as a group on the OS.

Sorry if this has already been discussed and thanks for reply.
Francesco

Test-kitchen and docker

Currently, vagrant is used as a driver in test-kitchen. For testing purposes, it would be efficient to use docker as the driver, which would significantly reduce provisioning times.

Recipe Compile Error in /tmp/kitchen/cache/cookbooks/dynatrace/resources/configure_ini_files.rb

I am getting an FATAL error:
FATAL: Chef::Exceptions::ValidationFailed: Property name must be one of: String! You passed nil. On line 11 11>> attribute :name, :kind_of => String, :default => nil of configure_ini_files.rb. Just by trying to run this cookbook.

       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/dynatrace/resources/configure_ini_files.rb
       ================================================================================

       Chef::Exceptions::ValidationFailed
       ----------------------------------
       Property name must be one of: String!  You passed nil.

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/dynatrace/resources/configure_ini_files.rb:11:in `class_from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/dynatrace/resources/configure_ini_files.rb:

         4:  #
         5:  # Copyright 2015, Dynatrace
         6:  #
         7:
         8:  actions :run
         9:  default_action :run
        10:
        11>> attribute :name,                 :kind_of => String, :default => nil
        12:  attribute :installer_prefix_dir, :kind_of => String, :default => nil
        13:  attribute :ini_files,            :kind_of => Array,  :default => []
        14:  attribute :variables,            :kind_of => Hash,   :default => {}
        15:  attribute :dynatrace_owner,      :kind_of => String, :default => 'dynatrace'
        16:  attribute :dynatrace_group,      :kind_of => String, :default => 'dynatrace'
        17:

       System Info:
       ------------
       chef_version=14.11.21
       platform=centos
       platform_version=7.6.1810
       ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
       program_name=/opt/chef/bin/chef-client
       executable=/opt/chef/bin/chef-client


       Running handlers:
       [2019-04-01T09:32:26+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2019-04-01T09:32:26+00:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 05 seconds
       [2019-04-01T09:32:26+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2019-04-01T09:32:26+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2019-04-01T09:32:26+00:00] FATAL: Chef::Exceptions::ValidationFailed: Property name must be one of: String!  You passed nil.```

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.