プレイブック

Splunk AppDynamics Ansible コレクションのプレイブックフォルダには、各エージェントタイプのサンプルプレイブックが含まれています。コレクションのインストールフォルダにあるサンプルプレイブックを使用できます。

playbooks/vars ディレクトリには、enable_ssl、controller_port などの変化しない変数が含まれています。次の Java の例に示されているように、YAML ファイルをプレイブックに含めるか、プレイブックの変数を上書きすることができます。YAML

注: インストールを続行する前に、Ansible の優先順位ルールを確認します。

Splunk AppDynamics コレクションをインストールすると、次のエージェントを使用できます。

Agent Type 説明
sun-java7 または java7 JRE バージョン 1.7 以前で実行されている Java アプリケーションをモニターするエージェント
sun-java または java JRE バージョン 1.8 以降で実行されている Java アプリケーションをモニターするエージェント
dotnet_msi Windows 上の .Net および .Net Framework アプリケーションをモニターするマシン グローバル エージェント
machine Windows および Linux 用の JRE を含む 64 ビットマシンエージェントの ZIP バンドル
python Linux 上の Python アプリケーションをモニターするエージェント。
php Linux または Redhat ベースのシステム上の PHP アプリケーションをモニターするエージェント
node Linux 上の NodeJS アプリケーションをモニターするエージェント

カスタムエージェントのダウンロードパス

注: これは、.Net エージェント MSI には適用されません。

プレイブックが公式のダウンロードポータルからエージェントファイルをダウンロードしないようにする場合は、プレイブックで次の変数を使用して、任意の場所からエージェントをインストールすることができます。

変数 説明 適用可能なエージェント
download_protocol

エージェントをダウンロードするためのメカニズム。値の例は次のとおりです。

  • http:ファイルサーバーからファイルを転送します。
  • local:制御ノードからファイルを転送します。
  • nfs:共有ファイルシステムからファイルを転送します。
すべて
download_uri エージェントファイルの場所。URL またはローカル/NFS ファイルシステムの絶対/相対パスにすることができます。 すべて
linux_install_root これを使用して、すべてのインストールされたエージェントおよびバックアップファイルが置かれるフォルダを設定します。たとえば、Java エージェントの場合、<linux_install_root>/java-agent<linux_install_root>/backup/java-agent が作成されます。Linux のデフォルト値は /opt/appdynamics です。 Apache、Java、マシン、Node.js、PHP、Python
windows_install_root linux_install_root と同様で、Windows ホストで使用します。デフォルト値は C:/appdynamics です。 Apache、Java、マシン
linux_custom_agent_install_path これを使用して、エージェントのインストールパスを指定し、ルートディレクトリであるデフォルトのインストールパスを上書きします(linux_install_root および windows_install_root を参照)。エージェントのバックアップはルートディレクトリに置かれ、この変数では設定されません。エージェントファイルはこのディレクトリにインストールされます。 のファイルを保存するには、このパスを指定しないでください。linux_install_root. Apache、Java、マシン、Node.js、PHP、Python
windows_custom_agent_install_path linux_custom_agent_install_path と同様で、Windows ホストで使用します。 Apache、Java、マシン

共通ロールの変数

説明 適用可能なエージェント
agent_action アップグレード、インストール、ロールバック、またはアンインストールを実行します。 すべて
agent_dir_permission.user Linux 上の Java エージェントのファイル権限をユーザーに割り当てます。create_appdynamics_user が No に設定されている場合は、選択したユーザーとグループがすでにホストに存在している必要があります。 Java
agent_dir_permission.group Linux 上の Java エージェントのファイル権限をグループに割り当てます。create_appdynamics_user が No に設定されている場合は、選択したユーザーとグループがすでにホストに存在している必要があります。 Java
agent_log_level エージェントのログレベル。有効なオプションは、info、trace、debug、warn、error、fatal、all、および off です。この設定は、agent_loggers リストで指定されたすべてのロガーに適用されます。 Java、マシン、PHP
agent_loggers ロガーのリストに対してログレベルを設定します。ロガー名はエージェントによって異なります。デフォルトでは、*com.singularitycom に設定されています。ターゲットエージェントに固有のロガーでこの変数を更新します。/conf/logging ディレクトリ内の log4j ファイルを参照してください。 Java、マシン
agents_to_set_loggers_for

ログレベルの変更を適用するエージェントのリスト。たとえば、展開されたすべてのエージェントのログレベルを に設定するには、この変数を に初期化します。

注: エージェント展開の一部としてロガーロールを使用する場合は、この変数を設定しないでください。agent_type 変数が、インストール中にログレベルをどのように調整する必要があるかを決定するために使用されます。
Java、マシン
agent_type

Splunk AppDynamics エージェントのタイプ。たとえば、java

すべて
agent_version

Splunk AppDynamics エージェントのバージョン。値は latest の場合があります。

Splunk AppDynamics は、カレンダーのバージョン管理を使用します。たとえば、Java エージェントが 2023 年 2 月にリリースされた場合、そのバージョンは 23.2.0 になります。

すべて
appdynamics_user

Splunk AppDynamics の機能ユーザー名。デフォルトは appdynamics です。

Java、マシン
application_name アプリケーション名この変数は、すべての java ロールに必須です。 すべて
controller_account_name

Splunk AppDynamics コントローラのアカウント名。

すべて
controller_account_access_key コントローラアカウントのアクセスキー。これは Vault に配置する必要があります。 すべて
controller_host_name

コントローラのホスト名。http:// や https:// を含めないでください。

すべて
controller_port コントローラポート。 すべて
create_appdynamics_user

Linux で Splunk AppDynamics 機能ユーザーを作成します。

Java、マシン
dir エージェントファイルのベースディレクトリ。デフォルト:/tmp/appd/ すべて
enable_proxy true に設定すると、エージェントのプロキシ設定がエージェント設定に適用されます。proxy_host および proxy_port の変数を割り当てます。 Java、.Net
enable_ssl コントローラで SSL を有効にするかどうかを示します。 すべて
init_and_validate_agent_variables この変数は、(ダウンロード URL とコントローラパラメータを設定する)共通ロールの初期化の実行を制御します。ロガーロールを(エージェントインストールの一部としてではなく)単独で使用する場合、この値は false にする必要があります。 Java、マシン
keep_backup agent_actionuninstall のときに使用します。アンインストール後にエージェントのバックアップファイルを保持するには、true に設定します。デフォルト値は false です。 Apache、Java、マシン、Node.js、PHP、Python
linux_install_root これを使用して、すべてのインストールされたエージェントおよびバックアップファイルが置かれるフォルダを設定します。たとえば、Java エージェントの場合、<linux_install_root>/java-agent<linux_install_root>/backup/java-agent が作成されます。Linux のデフォルト値は /opt/appdynamics です。 Apache、Java、マシン、Node.js、PHP、Python
linux_custom_agent_install_path これを使用して、エージェントのインストールパスを指定し、ルートディレクトリであるデフォルトのインストールパスを上書きします(linux_install_root を参照)。エージェントのバックアップはルートディレクトリに置かれ、この変数では設定されません。エージェントファイルはこのディレクトリにインストールされます。 のファイルを保存するには、このパスを指定しないでください。linux_install_root. Apache、Java、マシン、Node.js、PHP
max_agent_backup_count エージェントごとに許可されるバックアップの最大数。デフォルト値は 1 です。 Java
node_name

Java の Splunk AppDynamics ノード名

Apache、Java、マシン、Node.js、PHP、Python
proxy_host エージェントデータをルーティングするプロキシのホスト名/IP アドレス。 Java、.Net
proxy_port エージェントデータをルーティングするプロキシのホストポート番号。 Java、.Net
tier_name

Splunk AppDynamics 階層名。この変数は、すべての ロールに必須です。

Apache、Java、マシン、Node.js、PHP、Python
windows_install_root linux_install_root と同様で、Windows ホストで使用します。デフォルト値は C:/appdynamics です。 Apache、Java、マシン、Node.js、PHP、Python
windows_custom_agent_install_path linux_custom_agent_install_path と同様で、Windows ホストで使用します。 Apache、Java、マシン、Node.js、PHP、Python

開始するには、エージェントを選択します。

注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

Apache エージェントの Ansible 設定

以下は、Apache エージェントをインストールするための Ansible® ロールの例です。®

CODE
---
- hosts: all
  tasks:
    - name: Include variables for the controller settings
      include_vars: vars/controller.yaml

    - include_role:
        name: appdynamics.agents.apache
      vars:
        agent_version: 22.12.1
        # possible value:
        #          - latest: Latest version
        #          - 22.12.1: Any Specific version number
        agent_type: apache
        agent_action: upgrade
        # possible value:
        #          - upgrade: upgrade currently installed agent to agent_version
        #          - install: install agent_version
        #          - rollback: rollback to previous backup if any
        #          - uninstall: uninstall and clean up everything

        # Apache specific Args
        #apache_conf_path:
        # possible value:
        #          - /etc/httpd/conf/httpd.conf #default path in case of RedHat
        #          - /etc/apache2/apache2.conf  #Default path in case of Debian
        #          - #any custom path where the conf file is located.

Apache Agent Variables

Note: The following variables are applicable to the appdynamics_agent.conf file. For more information, see Configure the Apache Agent.
Variable Description
appdynamics_enabled Set to ON to enable web server monitoring
appdynamics_proxy_host Proxy server hostname or IP address
appdynamics_proxy_port Proxy server port
appdynamics_launch_proxy When set to ON , the agent launches the proxy automatically when on startup. If OFF , you must launch the proxy.
appdynamics_resolve_backends Controls the way Apache module backends appear in the Controller UI.
appdynamics_trace_as_error If ON, trace points are written as errors to the Apache logs, by default error_log.
appdynamics_report_all_instrumented_modules If OFF , the agent reports only modules that occur during the HANDLER stage of Apache request processing.
appdynamics_backend_name_segments The number of URL segments that are displayed in the backend naming.
appdynamics_proxy_comm_dir

Path to the directory containing the domain control socket which the agent uses to start an Splunk AppDynamics node. The default value is <agent_install_directory>/logs/appd-sdk.

appdynamics_request_cache_cleanup_interval Timeout in milliseconds after which the request cache is cleaned up by Java proxy.
appdynamics_mask_cookie Specify if filtering is enabled or not. Set it ON for cookie filtering to be enabled. The default value is OFF.
appdynamics_mask_cookie_pattern Specify the pattern that when matched, filters the value of that cookie.
appdynamics_mask_sm_user Specify if filtering is enabled or not. Set it ON for sm_user filtering to be enabled. The default value is OFF.
appdynamics_delimiter Specify the character that you want to use as URL segment endpoints.
appdynamics_segment Specify a comma-separated list to indicate the segments that you want the agent to filter
appdynamics_match_filter The type of filter to be used to match the URL amongst the following: NOT_EMPTY
appdynamics_match_pattern Specify the string that you want to be filtered with the match-filter
custom_agent_config_path Specify the absolute path to the agent configuration file for future upgrades. Make sure that you add the agent configuration file path to the apache.conf file.

Java エージェントの Ansible 設定

次の項では、Java エージェントの Ansible ロールの使用例を示します。

注: Ansible は、コントローラが Linux で、ノードが Windows である場合にのみ、Windows でサポートされます。

Linux または Windows 上での Java エージェントのインストール

:アプリケーションのインストルメント化なしで Windows や Linux に Java エージェントをインストールする際に使用される Ansible® ロール。®

CODE
---
- hosts: all
  tasks:
    - name: Include variables for the controller settings
      # Include all yaml files under the vars directory
      include_vars:
        dir: vars
        extensions:
          - 'yaml'
          - 'yml'
    - include_role:
        name: appdynamics.agents.java
      vars:
        agent_version: 21.1.0
        agent_type: java
        agent_action: upgrade # can be upgrade/install/rollback/uninstall, defaults to upgrade when unspecified
        application_name: "IoT_API" # agent default application
        tier_name: "java_tier" # agent default tier

:Java エージェントをインストールするとともに、Java 起動スクリプトを変更し、再起動を行う際に使用される Ansible ロール。

JSON
---
- hosts: single-java-host
  tasks:
    - name: Include variables for the controller settings
      # Include all yaml files under the vars directory
      include_vars:
        dir: vars
        extensions:
          - 'yaml'
          - 'yml'
    - import_role:
        name: appdynamics.agents.java
        public: yes
      vars:
        agent_version: 21.1.0
        agent_type: java
        application_name: "BIGFLY" # agent default application
        tier_name: "java_tier" # agent default tier
    - name: Edit startup script with new java startup variables
      lineinfile:
        path: /opt/application/startAll.sh
        # Line to Search/Match against
        regexp: '^(.*)(-jar.*$)'
        # Line to Replace with
        line: '\1 -javaagent:{{ java_agent_dest_folder_linux }}/javaagent.jar -Dappdynamics.agent.nodeName=application-1 \2'
        backup: yes
        backrefs: yes
        state: present
      notify: RestartingApp
    - name: Allow appuser write to appd logs folder
      user:
        name: appuser
        groups:
        - appdynamics
        append: yes
      become: yes
  handlers:
    - name: RestartingApp
      command: '/opt/application/stopAll.sh && /opt/application/startAll.sh'
      args: 
        chdir: '/opt/application/'
注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

JBoss/Wildfly のインストゥルメント化

このロールの特徴は次のとおりです。

  • Linux の Java エージェントのインストール
  • Jboss/Wildfly のインストゥルメント化
  • アプリケーションの自動再起動(systemd サービスが存在する場合)
  • Java エージェントの起動検証

例 1:Java エージェントをインストールし、1 つ以上のアプリケーションをインストルメント化します。

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.java
# use java role variables in the following instrumentation tasks when public: yes
public: yes
vars:
agent_version: 21.1.0
agent_type: java
- include_role:
name: appdynamics.agents.instrument_jboss
vars:
# instrument jboss:
application_name: "IoT_API2"
tier_name: "Jboss"
jboss_service: wildfly
app_user: wildfly
restart_app: yes
jboss_config: /opt/wildfly/bin/standalone.sh

例 2:このロールがあると、インストルメント化されたすべてのアプリケーションが Java エージェントログのディレクトリにアクセスできるようになります。

場合によっては、アプリケーション PID ユーザーが Linux ホストでローカルでないことがあります。この場合、Splunk AppDynamics グループに追加できません。このような場合、代わりにアプリケーションユーザーに Java エージェントディレクトリを所有させることができます。

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.java
# use java role variables in the following instrumentation tasks when public: yes
public: yes
vars:
agent_version: 21.1.0
agent_type: java
# single app mode: Can skip user creation and own java-agent directory by app user (wildfly in this case)
create_appdynamics_user: no
agent_dir_permission:
user:  wildfly
group: wildfly
- include_role:
name: appdynamics.agents.instrument_jboss
vars:
# instrument jboss:
application_name: "IoT_API2"
tier_name: "Jboss"
jboss_service: wildfly
app_user: wildfly
restart_app: yes
jboss_config: /opt/wildfly/bin/standalone.sh

JBoss インストルメンテーションの変数

変数 説明 必須 デフォルト
app_user このアプリケーションを実行するユーザー。これを指定する必要があるため、java-agent ログディレクトリへの書き込み権限が付与されます。 Y jboss
jboss_service restart_app が「yes」に設定されている場合に再起動する必要がある Systemd サービス N
restart_app インストゥルメント化されたサービスを自動的に再起動するには、'yes' に設定します。 N いいえ
backup 変更前に元の構成ファイルをバックアップするかどうかです。 N いいえ
jboss_config インストゥルメント化する Jboss/Wildfly 設定。jboss standalone.sh へのパスを指定します。 Y /opt/wildfly/bin/standalone.sh

Apache Tomcatのインストゥルメント化

このロールの特徴は次のとおりです。

  • Linux の Java エージェントのインストール
  • Apache Tomcat のインストルメンテーション
  • アプリケーションの自動再起動(systemd サービスが存在する場合)
  • Java エージェントの起動検証

例 1:Java エージェントをインストールし、1 つ以上のアプリケーションをインストルメント化します。

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.java
# use java role variables in the following instrumentation tasks when public: yes
public: yes
vars:
agent_version: 21.1.0
agent_type: java
- include_role:
name: appdynamics.agents.instrument_tomcat
vars:
# instrument tomcat:
tomcat_service: tomcat9
application_name: "IoT_API22"
tier_name: "Tomcat"
app_user: tomcat
restart_app: yes
tomcat_config: /usr/share/tomcat9/bin/setenv.sh

例 2:インストルメント化されたすべてのアプリケーションが Java エージェントログのディレクトリにアクセスできるようになります。

場合によっては、アプリケーション PID ユーザーが Linux ホストでローカルでないことがあります。この場合、Splunk AppDynamics グループに追加できません。このような場合、代わりにアプリケーションユーザーに Java エージェントディレクトリを所有させることができます。

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.java
# use java role variables in the following instrumentation tasks when public: yes
public: yes
vars:
agent_version: 21.1.0
agent_type: java
# single app mode: Can skip appdynamics user creation and own java-agent directory by app user (tomcat in this case)
create_appdynamics_user: no
agent_dir_permission:
user:  tomcat
group: tomcat
- include_role:
name: appdynamics.agents.instrument_tomcat
vars:
# instrument tomcat:
tomcat_service: tomcat9
application_name: "IoT_API22"
tier_name: "Tomcat"
app_user: tomcat
restart_app: yes
tomcat_config: /usr/share/tomcat9/bin/setenv.sh

Tomcat インストルメンテーションの変数

変数 説明 必須 デフォルト
app_user このアプリケーションを実行するユーザー。これを指定する必要があるため、java-agent ログディレクトリへの書き込み権限が付与されます。 Y tomcat
tomcat_service restart_app が「yes」に設定されている場合に再起動する必要がある Systemd サービス N
add_service_override

有効になっている場合、systemd を追加

N
restart_app インストゥルメント化されたサービスを自動的に再起動するには、'yes' に設定します。 N いいえ
backup 変更前に元の構成ファイルをバックアップするかどうかです。 N いいえ
tomcat_config 変更する tomcat 構成ファイルを選択します。setenv.sh ファイルへのフルパスを設定する必要があります(例:<CATALINA_HOME>/bin/setenv.sh)。RHEL ディストリビューションで Tomcat が yum とともにインストールされている場合、このファイルはスタートアップスクリプトによって呼び出されません。その場合は、代わりに /etc/tomcat/conf.d/appdynamics.conf に設定できます。 Y

IIB エージェントの Ansible 設定

次は、AIX または Redhat ベースの Linux システムに IIB エージェントをインストールするための Ansible® ロールの例です。®

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
include_vars:
# Include all yaml files under the vars directory
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.iib
vars:
agent_version: latest
# possible value:
#          - latest: Latest version
#          - 22.10.0.5500.0: Any Specific version number
agent_type: iib
agent_action: upgrade
# possible value:
#          - upgrade: upgrade currently installed agent to  agent_version
#          - install: install agent_version
#          - rollback: rollback to previous backup if any

IIB エージェント変数

変数 説明 使用可能な値 必須 デフォルト
iib_log_dir IIB エージェントログファイルを含むディレクトリへのパス。 ディレクトリパス オプション /tmp/appd
iib_user_exit ユーザーの exit 名。これは、mqsichangebroker コマンドの規定に従い英数字の形式にする必要があります。 ecom オプション None
iib_flow_level_visibility_enabled 有効にするには 1、無効にするには 0 を設定します。IIB エージェントフローレベルの可視性 を参照してください。 0、1 オプション 0
iib_node_reuse ノード名の再利用機能により、ユーザーは過去の VM のノード名を新しい VM に再利用できます。特にノードが異なる時間に実行される同一のプロセスである場合に、異なる名前のノードが急速に増加することがなくなります。これは、寿命の短い VM がある環境をモニターするのに役立ちます。Enable the Node Name Reuse を参照してください。 true または false オプション None
iib_node_reuse_prefix iib-node-reusetrue に設定されている場合に、このプロパティを使用します。このプロパティを設定しない場合、エージェントは、IBM の内部ノード名標準に従ってノード名を生成します。Enable the Node Name Reuse を参照してください。 ecom オプション None
config_file_path このプロパティを使用して、ノードまたはサーバーの構成ファイルのパスを設定します。複数のパスをカンマで区切って指定できます。 /opt/node1.conf.yaml/opt/node2.conf.yaml オプション None
iib_controller_cert_file SSL の PEM 形式の X509 証明書へのフルパス。証明書ファイルの取得方法については、C/C++ SDK の SSL の有効化を参照してください。 /etc/controller/iib.pem オプション None
注:

カスタムプロキシ設定の変数

変数 説明 使用可能な値 必須 デフォルト
controller_proxy_host プロキシのホスト名または IP アドレス。エージェントをコントローラに接続するのに必要です。 ecommerce.proxy.com オプション None
controller_proxy_port プロキシサーバーを通じてコントローラにデータをルーティングするためのプロキシポート。 8090 オプション None
controller_proxy_username プロキシサーバーホストにログインするために必要なプロキシユーザー名。 ecommere-user オプション None
controller_proxy_password プロキシユーザーを認証するためのパスワード。 /etc/ecommerce/passwd オプション None
controller_proxy_passwordfile プロキシユーザーの認証に使用されるパスワードを含むファイルのフルパス名。 /etc/ecommerce/passwd オプション None
注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

マシンエージェントの Ansible 設定

以下は、Linux、Windows、Solaris、および AIX にマシンエージェントをインストールするための Ansible® ロールの例です。®

CODE
---
- hosts: all
tasks:
- include_role:
name: appdynamics.agents.machine
vars:
# Define Agent Type and Version
agent_version: 20.9.0
agent_type: machine
machine_hierarchy: "AppName|Owners|Environment|" # Make sure it ends with a |
sim_enabled: "true"
# Analytics settings
analytics_event_endpoint: "https://fra-ana-api.saas.appdynamics.com:443"
enable_analytics_agent: "true"
# Your controller details
controller_account_access_key: "123key" # Please add this to your Vault
controller_host_name: "fieldlab.saas.appdynamics.com" # Your Splunk AppDynamics controller
controller_account_name: "customer1" # Please add this to your Vault
enable_ssl: "false"
controller_port: "8090"
controller_global_analytics_account_name: 'customer1_e52eb4e7-25d2-41c4-a5bc-9685502317f2' # Please add this to your Vault
# config properties docs - https://docs.appdynamics.com/display/latest/Machine+Agent+Configuration+Properties
# Can be used to configure the proxy for the agent
java_system_properties: "-Dappdynamics.http.proxyHost=10.0.4.2 -Dappdynamics.http.proxyPort=9090" # mind the space between each property
注: Linux および Windows では、Ansible ロールが、インストール、アップグレード、およびロールバック中にマシンエージェントをサービスとして起動して実行します。Solaris および AIX では、Ansible ロールが、マシンエージェントをインストール、アップグレード、およびロールバックします。ただし、マシンエージェントを手動で起動する必要があります。

マシンエージェントの変数

変数 説明
java_system_properties エージェントのプロキシ設定を設定します。
analytics_event_endpoint この変数にイベントサービスの URL を指定します。
enable_analytics_agent マシンエージェントの分析エージェントを有効にします。
sim_enabled サーバー インフラストラクチャ モニタリングを有効にします。
controller_global_analytics _account_name コントローラのグローバルアカウント名
注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

.Net エージェント MSI の Ansible 設定

注: Splunk AppDynamicsこのドキュメントには、Ansible® のドキュメントへの参照が含まれています。 はいかなる権利も所有しておらず、そのようなサードパーティのドキュメントの正確性または完全性について責任を負いません。®

次の項では、.Net エージェント MSI の Ansible ロールの使用例を示します。

注:
  1. この Ansible ロールを使用したエージェントのアップグレードでは、以前の .Net エージェント MSI の設定は保持されません。ロールで指定した設定で既存の設定が上書きされます。ロールで設定の詳細が指定されていない場合、デフォルトの最小限の設定が使用されます。このロールを実行する前に、すべての重要な設定をバックアップしたことを確認してください。

  2. .Net エージェント MSI のロールバックは、次のシナリオではサポートされていません。

    1. .Net エージェント MSI がマシンにインストールされていないか、前の .Net エージェント MSI のインストールがこのロールによって管理されていない場合

    2. ロールバックがすでに実行されている場合。1 つ前のバージョンへのロールバックのみがサポートされています

.Net エージェント MSI のインストール

:以下の基本機能を備えた .Net エージェント MSI のインストールに使用される Ansible® ロール:®

  • 最新の .Net エージェントのインストール
  • コントローラ アプリケーション名の自動生成
  • すべての IIS アプリケーションのインストゥルメント化。インストール後に IIS を再起動する必要があります。
注: このプレイブックには、 からの、コントローラと通信するためのパラメータが含まれています。
CODE
---
- name: .Net Agent MSI Minimal Configuration
hosts: windows
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
ansible.builtin.include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- ansible.builtin.include_role:
name: appdynamics.agents.dotnet_msi

:以下の拡張機能を備えた .Net エージェント MSI のインストールに使用される Ansible ロール:

  • .Net エージェントバージョン 22.12.0 のインストール
  • 特定のコントローラ アプリケーション名の定義。設定時にロールで使用されるコントローラ アプリケーション名を指定します。
  • デフォルトの階層名とノード名の有無にかかわらない、特定の IIS アプリケーションのみのインストゥルメント化。インストール後に IIS を再起動する必要があります。
  • デフォルトの階層名とノード名の有無にかかわらない、スタンドアロン アプリケーションのインストゥルメント化。インストール後にスタンドアロン アプリケーションを再起動する必要があります。
注: 以下のプレイブックでは、コントローラと通信するためのパラメータがプレイブック内で定義されています。
CODE
---
- name: .Net Agent MSI Extended Configuration
hosts: windows
tasks:
- ansible.builtin.include_role:
name: appdynamics.agents.dotnet_msi
vars:
agent_version: '22.12.0'
# Your controller details
controller_host_name: 'something.saas.appdynamics.com'
controller_port: '443'
enable_ssl: 'true'
controller_account_name: 'customer1'
controller_account_access_key: '123456'
application_name: 'DotNetAgent_Application'
monitor_all_IIS_apps: 'false'
iis_applications:
# instrument a web application 'PaymentService' under a web site 'Default Web Site'
- site: 'Default Web Site'
path: '/PaymentService'
# default tier: 'site/path'
# default node: 'host-tier'
# instrument an entire web site 'BillingWebSite'
- site: 'BillingWebSite'
tier_name: 'BillingWebSiteTier'
node_name: 'BillingWebSiteNode'
standalone_applications:
# instrument any execution of a standalone aplication 'login.exe'
- executable: 'login.exe'
# default tier: 'executable'
# default node: 'host-tier'
# instrument a standalone aplication 'checker.exe' with a specific set of command line arguments
- executable: 'checker.exe'
command_line: '-arg1 value1 -flag1'
tier_name: 'CheckerTier'
node_name: 'CheckedNode'

.Net Agent Variables

Variable Description Possible Values Required Default
custom_ad_setup_file Defines a local path to the custom installation configuration file on the Ansible control node. It can be a static file or a dynamic Jinja template. System path N
custom_config Defines a local path to the custom config.xml static file on the Ansible controlling node. It takes precedence over other configuration settings. System path N
enable_tls12 Enable Controller SSL TLS1.2 connection. [true, false] N false
iis_applications List of IIS applications to monitor. It can be useful if monitor_all_IIS_apps = false or custom tier and node names are required for an application. See .NET Agent Configuration Properties. N
iis_application.site Name of the IIS website. Y (for each IIS application if iis_applications is defined)
iis_application.path Path to the IIS web application relative to the IIS website. The path must begin with '/'. If the path is missing the default value '/' indicates that all applications under the website are instrumented. N '/'
iis_application.tier_name Controller Tier Name for the IIS application. N iis_application.site/iis_application.path (if the path is defined or iis_application.site
iis_application.node_name Controller Node Name for the IIS application. N hostname-iis_application.tier_name
monitor_all_IIS_apps Enable monitoring of all IIS applications. [true, false] N true
restart_app

Set to true

Note: All the applications added or removed from instrumentation must be restarted for agent changes to take effect.
[true, false] N false
standalone_applications List of .Net standalone applications to monitor. See .NET Agent Configuration Properties. N
standalone_application.executable Name of the executable file for the standalone application (with or without extension). Y (for each standalone application if standalone_applications is defined)
standalone_application.command_line Command line arguments for the executable to limit the monitoring to a specific execution of the application. N
standalone_application.tier_name Controller Tier Name for standalone application. N standalone_application.executable
standalone_application.node_name Controller Node Name for standalone application. N hostname-standalone_application.tier_name
Note: This document contains references to the Ansible documentation. Splunk AppDynamics does not own any rights and assumes no responsibility for the accuracy or completeness of such third-party documentation.

.Net エージェント MSI の環境変数の設定

ansible.windows.win_environment Ansible モジュールを使用して、.Net エージェント MSI の環境変数を設定できます。次の例では、エージェントがインストールされるシステムで APPDYNAMICS_AGENT_UNIQUE_HOST_ID 環境変数を定義します。詳細については、「Windows ホストでの環境変数の変更」を参照してください。

JSON
---
- name: .Net Agent MSI Test Play
hosts: windows
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
ansible.builtin.include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- ansible.windows.win_environment:
state: present
name: 'APPDYNAMICS_AGENT_UNIQUE_HOST_ID'
value: '{{ ansible_hostname }}' # can be jinja template like in this example or a static `value` if needed
level: machine
- ansible.builtin.include_role:
name: appdynamics.agents.dotnet_msi

特定の階層/ノードでの .Net エージェント MSI のインストールおよびアップグレード

.Net エージェント MSI は、グローバルなマシンでのインストールを実行します。マシンに異なるバージョンのエージェントをインストールすることはできません。また、マシン上のすべてのアプリケーションは、同じバージョンのエージェントを使用してインストゥルメント化されます

特定の Windows マシンでエージェントを更新するには、Ansible インベントリファイルを作成し、目的のホストでプレイブックを実行します。詳細については、「How to build your inventory」を参照してください。

CODE
---
      # updating agent version on certain windows machines only
      - name: .Net Agent MSI Test Play
      hosts: windows_region_1 # a group 'windows_region_1' should be defined in ansible inventory and lisy all desired machines
      tasks:
      - ansible.builtin.include_role:
      name: appdynamics.agents.dotnet_msi
      vars:
      agent_version: '22.12.0' # or providing custom_config or any other changes to the configuration

マシン内のインストゥルメント化されたアプリケーションのリストを更新するには、ロール設定で目的のアプリケーションを追加または削除して、プレイブックを再実行します。

注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

Node.js エージェントの Ansible 設定

注:
  • Node.js バージョン 14.x ~ 18.x を使用していることを確認します。

  • インストール後にエージェントを再起動してください。

以下は、Linux に Node.js エージェントをインストールするための Ansible® ロールの例です。®

CODE
---
- hosts: linux
tasks:
- include_role:
name: appdynamics.agents.node
vars:
agent_version: latest # [latest or provide the specific agent version]
agent_type: node
agent_action: upgrade # can be upgrade/install/rollback, default upgrade when unspecified
controller_account_access_key: "123key" # Please add this to your Vault
controller_host_name: "fieldlab.saas.appdynamics.com" # Your Splunk AppDynamics controller
controller_account_name: "customer1" # Please add this to your Vault
enable_ssl: "false"
controller_port: "8090"

次のコマンドを使用して、インストール後にエージェントを再起動してください。

CODE
node -r appd-config.js app.js

Node.js エージェントの変数

変数 説明 デフォルト 使用可能な値 必須
agent_version インストールする Node.js エージェントのバージョン。 latest latest、[x.x.x.x 形式のエージェントバージョン] いいえ
node_agent_enableGraphQL アプリケーションで graphql が使用されている場合は、これを使用します。 false true、false いいえ
node_agent_debug_logging デバッグロギングを有効にしてアプリケーションを実行します。 false true、false いいえ
npm_registry アプリケーションをデバッグモードで実行します。 https://registry.npmjs.org いいえ
注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

PHP エージェントの Ansible 設定

次の項では、PHP エージェントの Ansible ロールの使用例を示します。

以下は、Linux に PHP エージェントをインストールするための Ansible® ロールの例です。®

CODE
---
- hosts: all
tasks:
- include_role:
name: appdynamics.agents.php
vars:
agent_version: latest
agent_type: php
agent_action: upgrade
application_name: e-commerce
controller_account_access_key: "123key"
controller_host_name: "fieldlab.saas.appdynamics.com"
controller_account_name: "customer1"
enable_ssl: false
controller_port: 8090
tier_name: tier1
node_name: node1
log_directory: "/opt/appdynamics/php-agent/ecommerce_logs"
zts_support: false
# proxy configs
proxy_host: master.ecommerce-proxy.com
proxy_port: 8080
proxy_user: ecommerce-user
proxy_password_file: /etc/ecommerce/passwd
proxy_ctrl_dir: /ecommerce/proxy_dir/

以下は、エージェントがすでにインストールされている Linux で PHP エージェントをアップグレードするための Ansible ロールの例です。

CODE
---
- hosts: all
tasks:
- include_role:
name: appdynamics.agents.php
vars:
agent_version: latest
agent_type: php
agent_action: upgrade
application_name: e-commerce
controller_account_access_key: "123key"
controller_host_name: "fieldlab.saas.appdynamics.com"
controller_account_name: "customer1"
enable_ssl: false
controller_port: 8090
tier_name: tier1
node_name: node1
log_directory: "/opt/appdynamics/php-agent/ecommerce_logs"
zts_support: false
linux_custom_agent_install_path: "/home/ubuntu/ecommerce_agent/" #this path should contain the agent files (eg: install.sh ,php etc)
custom_agent_ini_file: "/etc/php/7.4/cli/conf.d/appdynamics_agent.ini" #this file should contain your agent controller details

PHP エージェントの変数

変数 説明 使用可能な値 必須 デフォルト
custom_agent_ini_file appdynamics_agent.ini ファイルの絶対パスを設定します。 <custom path>

デフォルトでは、PHP 設定で設定されたデフォルトの .ini ファイルパスになります。

はい(linux_custom_agent_install_path が定義されている場合) None
enable_cli CLI モードを有効にする場合は、true に設定します。 true または false オプション None
enable_cli_long_running true に設定すると、長期実行 CLI アプリケーションで PHP を保護します。「PHP CLI アプリケーション用エージェントの構成」を参照してください。 true または false オプション false
ignore_permissions ファイルとディレクトリの権限の問題を無視する場合は、true に設定します。 true または false オプション None
log_directory ログディレクトリを指定します。デフォルトでは、エージェントディレクトリ内に logs フォルダが作成されます。 <agent-directory>/logs オプション <agent-directory>/logs
php_executable_path PHP バイナリのパスを指定します。 /usr/bin/php オプション global php path set
php_ini_dir appdynamics_agent.ini ファイルのディレクトリ。 /etc/php/ Ubuntu およびデフォルトの PHP CLI バイナリを特定できない場合に必要です。 global php ini path set
php_extension_dir appdynamics_agent.so ファイルの拡張ディレクトリ。 /etc/php/extensions/ Ubuntu およびデフォルトの PHP CLI バイナリを特定できない場合に必要です。 global php extension path set
php_version インストゥルメント化する PHP のバージョン。有効な形式は、1 つまたは 2 つの小数点があるバージョン番号です。たとえば、7.4 や 7.4.29 です。 7.4.29 デフォルトの PHP CLI バイナリを特定できない場合、または PHP CLI バイナリがない場合に必要です。 global php verdsion set
zts_support PHP ZTS エージェントをインストールするには、true に設定します。 true または false オプション false
注:
  1. php -i|grep appdynamics_agent.ini コマンドを使用して、appdynamics_agent.ini パスを取得します。エージェントがデフォルトの場所にインストールされていない場合、または linux_custom_agent_install_path を使用している場合は、custom_agent_ini_file を絶対ファイルパスで設定します。
  2. グローバルに設定されていない PHP バージョンでエージェントをインストールする場合は、以下の変数を定義する必要があります。これらは以下に示すすべての agent_action の必須変数です。
    • php_executable_path
    • php_ini_dir
    • php_extension_dir
    • php_version

カスタムプロキシ設定の変数

変数 説明 使用可能な値 必須 デフォルト
proxy_host プロキシサーバーを通じてコントローラにデータをルーティングするためのプロキシホスト。 master.ecommerce-proxy.com オプション None
proxy_port プロキシサーバーを通じてコントローラにデータをルーティングするためのプロキシポート。 8090 オプション None
proxy_user プロキシサーバーホストにログインするために必要なプロキシユーザー。 ecommere-user オプション None
proxy_password_file プロキシサーバーホストにログインするためのプロキシパスワードファイル。 /etc/ecommerce/passwd オプション None
proxy_ctrl_dir プロキシ制御ディレクトリ。指定しない場合、インストーラは一時的なディレクトリを作成します。 /ecommerce/proxy_dir/ オプション None
注: Ansible® は米国およびその他の国における Red Hat, Inc. の登録商標です。

Python エージェントの Ansible 設定

次の項では、Python エージェントのプレイブックの使用例を示します。

Python エージェントのインストール

:以下の機能を備えた Python エージェントのインストールに使用される Ansible® ロール:®

  • Linux(Debian、Alpine、および RedHat)への Python エージェントのインストール
  • 既存のインストールが検出された場合のバックアップの作成
PYTHON
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.python
vars:
agent_version: 22.10.0.5500.0
# possible value:
#          - latest: Latest version
#          - 22.10.0.5500.0: Any Specific version number
agent_type: python
agent_action: upgrade
# possible value:
#          - upgrade: upgrade currently installed agent to agent_version
#          - install: install agent_version
#          - rollback: rollback to previous backup if any
#          - uninstall: uninstall agent
# Python specific Args
install_env: default # [default - (main python path taken automatically), virtualenv - (virtualenv path need to be provided)]
# possible value:
#          - default: install agent in global python
#          - virtualenv: install agent  to specific virtualenv
virtualenv_path: /home/ansible/venv
# possible value:
#          - /home/ansible/venv: virtualenv path
#          - None
install_agent_from: appd-portal
# possible value:
#          - pypi: Downlaod agent from PYPI
#          - appd-portal: Download agent from AppD portal

:Python エージェントでサンプルアプリケーションを起動するための Ansible ロール:

CODE
---
- hosts: all
tasks:
- name: Include variables for the controller settings
# Include all yaml files under the vars directory
include_vars:
dir: vars
extensions:
- 'yaml'
- 'yml'
- include_role:
name: appdynamics.agents.python
- name: Start Sample Python app
shell: "nohup pyagent run -c /opt/appdynamics/python-agent/appd.cfg python3 /home/ubuntu/app.py &"
async: 100
poll: 0
register: status
failed_when: "'FAILED' in status.stdout"
Config path and the application path has to be changed accordingly.