16.4. Configuring web hooks in Performance Co-Pilot by using the metrics RHEL system role


The Performance Co-Pilot (PCP) suite contains the performance metrics inference engine (PMIE) service. This service evaluates performance rules in real time. For example, you can use the default rules to detect excessive swap activities.

You can configure a host as a central PCP management site that collects the monitoring data from multiple PCP nodes. If a rule matches, this central host sends a notification to a web hook to notify other services. For example, the web hook can trigger Event-Driven Ansible to run on Ansible Automation Platform template or playbook on the host that had caused the event.

By using the metrics RHEL system role, you can automate the configuration of a central PCP management host that notifies a web hook.

Prerequisites

Procedure

  1. Create a playbook file, for example, ~/playbook.yml, with the following content:

    ---
    - name: Monitoring performance metrics
      hosts: managed-node-01.example.com
      tasks:
        - name: Configure PMIE web hooks
          ansible.builtin.include_role:
            name: redhat.rhel_system_roles.metrics
          vars:
            metrics_manage_firewall: true
            metrics_retention_days: 7
            metrics_monitored_hosts:
              - pcp-node-01.example.com
              - pcp-node-02.example.com
            metrics_webhook_endpoint: "https://<webserver>:<port>/<endpoint>"

    The settings specified in the example playbook include the following:

    metrics_retention_days: <number>
    Sets the number of days after which the pmlogger_daily systemd timer removes old PCP archives.
    metrics_manage_firewall: <true|false>
    Defines whether the role should open the required ports in the firewalld service. If you want to remotely access PCP on the managed nodes, set this variable to true.
    metrics_monitored_hosts: <list_of_hosts>
    Specifies the hosts to observe.
    metrics_webhook_endpoint: <URL>
    Sets the web hook endpoint to which the performance metrics inference engine (PMIE) sends notifications about detected performance issues. By default, these issues are logged to the local system only.

    For details about all variables used in the playbook, see the /usr/share/ansible/roles/rhel-system-roles.metrics/README.md file on the control node.

  2. Validate the playbook syntax:

    $ ansible-playbook --syntax-check ~/playbook.yml

    Note that this command only validates the syntax and does not protect against a wrong but valid configuration.

  3. Run the playbook:

    $ ansible-playbook ~/playbook.yml

Verification

  1. Check the configuration summary on managed-node-node-01.example.com:

    # ansible managed-node-01.example.com -m command -a 'pcp summary'
    Performance Co-Pilot configuration on managed-node-01.example.com:
    
     platform: Linux managed-node-node-01.example.com 6.12.el10_0.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Feb 23 01:51:18 EST 2024 x86_64
     hardware: 8 cpus, 1 disk, 1 node, 1773MB RAM
     timezone: CEST-2
     services: pmcd pmproxy
     pmcd: Version 6.2.0-1, 12 agents, 6 clients
     pmda: root pmcd proc pmproxy xfs linux nfsclient mmv kvm jbd2
           dm openmetrics
     pmlogger: primary logger: /var/log/pcp/pmlogger/managed-node-node-01.example.com/20240510.16.25
               pcp-node-01.example.com: /var/log/pmlogger/pcp-node-01.example.com/20240510.16.25
               pcp-node-02.example.com: /var/log/pmlogger/pcp-node-02.example.com/20240510.16.25
     pmie: primary engine: /var/log/pcp/pmie/managed-node-node-01.example.com/pmie.log
           pcp-node-01.example.com: : /var/log/pcp/pmie/pcp-node-01.example.com/pmie.log
           pcp-node-02.example.com: : /var/log/pcp/pmie/pcp-node-02.example.com/pmie.log

    The last three lines confirm that PMIE is configured to monitor three systems.

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る