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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部