3.2. 監視クライアントパラメーターの設定

監視ソリューションは、定期的にシステム情報を収集し、データ収集エージェントを使用してさまざまな方法で値を保管し、監視するメカニズムを提供します。Red Hat は、collectd をコレクションエージェントとしてサポートします。collectd-sensubility は collectd の機能拡張であり、RabbitMQ を介して Sensu サーバー側と通信します。Service Telemetry Framework (STF) を使用してデータを保存し、続いてシステムの監視、パフォーマンスのボトルネックの特定、将来のシステム負荷の予測を行うことができます。Service Telemetry Framework についての詳細は、Service Telemetry Framework 1.3 を参照してください。

collectd および collectd-sensubility を設定するには、以下の手順を実行します。

  1. ホームディレクトリーに /home/templates/custom などの config.yaml を作成し、MetricsQdrConnectors パラメーター が STF サーバー側をポイントするように設定します。

    MetricsQdrConnectors:
        - host: qdr-normal-sa-telemetry.apps.remote.tld
          port: 443
          role: inter-router
          sslProfile: sslProfile
          verifyHostname: false
    MetricsQdrSSLProfiles:
        - name: sslProfile
  2. config.yaml ファイルで、CollectdExtraPlugins の下に使用するプラグインをリスト表示します。ExtraConfig セクションにパラメーターを指定することもできます。デフォルトでは、collectd のプラグインには cpudfdiskhugepagesinterfaceloadmemoryprocessestcpconnsunixsock、および uptime があります。追加のプラグインは、CollectdExtraPlugins パラメーターを使用して追加できます。また、ExtraConfig オプションを使用して、CollectdExtraPlugins の設定情報を追加することもできます。たとえば、virt プラグインを有効にし、接続文字列とホスト名の形式を設定するには、以下の構文を使用します。

    parameter_defaults:
      CollectdExtraPlugins:
        - disk
        - df
        - virt
    
      ExtraConfig:
        collectd::plugin::virt::connection: "qemu:///system"
        collectd::plugin::virt::hostname_format: "hostname uuid"
    注記

    unixsock プラグインは削除しないでください。削除すると、collectd コンテナーは正常ではないと永続的に指定されます。

  3. オプション: AMQ Interconnect でメトリックおよびイベントデータを収集するには、MetricsQdrExternalEndpoint: true 行を config.yaml ファイルに追加します。

    parameter_defaults:
        MetricsQdrExternalEndpoint: true
  4. collectd-sensubility を有効にするには、以下の環境設定を config.yaml ファイルに追加します。

    parameter_defaults:
      CollectdEnableSensubility: true
    
      # Use this if there is restricted access for your checks by using the sudo command.
      # The rule will be created in /etc/sudoers.d for sensubility to enable it calling restricted commands via sensubility executor.
      CollectdSensubilityExecSudoRule: "collectd ALL = NOPASSWD: <some command or ALL for all commands>"
    
      # Connection URL to Sensu server side for reporting check results.
      CollectdSensubilityConnection: "amqp://sensu:sensu@<sensu server side IP>:5672//sensu"
    
      # Interval in seconds for sending keepalive messages to Sensu server side.
      CollectdSensubilityKeepaliveInterval: 20
    
      # Path to temporary directory where the check scripts are created.
      CollectdSensubilityTmpDir: /var/tmp/collectd-sensubility-checks
    
      # Path to shell used for executing check scripts.
      CollectdSensubilityShellPath: /usr/bin/sh
    
      # To improve check execution rate use this parameter and value to change the number of goroutines spawned for executing check  scripts.
      CollectdSensubilityWorkerCount: 2
    
      # JSON-formatted definition of standalone checks to be scheduled on client side. If you need to schedule checks
      # on overcloud nodes instead of Sensu server, use this parameter. Configuration is compatible with Sensu check definition.
      # For more information, see https://docs.sensu.io/sensu-core/1.7/reference/checks/#check-definition-specification
      # There are some configuration options which sensubility ignores such as: extension, publish, cron, stdin, hooks.
      CollectdSensubilityChecks:
        example:
          command: "ping -c1 -W1 8.8.8.8"
          interval: 30
    
      # The following parameters are used to modify standard, standalone checks for monitoring container health on overcloud nodes.
      # Do not modify these parameters.
      # CollectdEnableContainerHealthCheck: true
      # CollectdContainerHealthCheckCommand: <snip>
      # CollectdContainerHealthCheckInterval: 10
      # The Sensu server side event handler to use for events created by the container health check.
      # CollectdContainerHealthCheckHandlers:
      #   - handle-container-health-check
      # CollectdContainerHealthCheckOccurrences: 3
      # CollectdContainerHealthCheckRefresh: 90
  5. オーバークラウドをデプロイする。overcloud deploy コマンドに、config.yamlcollectd-write-qdr.yaml のほか、qdr-*.yaml ファイルのいずれかを含めます。

    $ openstack overcloud deploy
    -e  /home/templates/custom/config.yaml
    -e tripleo-heat-templates/environments/metrics/collectd-write-qdr.yaml
    -e tripleo-heat-templates/environments/metrics/qdr-form-controller-mesh.yaml
  6. オプション: オーバークラウドの RabbitMQ 監視を有効にするには、overcloud deploy コマンドに collectd-read-rabbitmq.yaml ファイルを追加します。

関連情報