Chapter 18. Configuring an Agent

  1. Install the agent:

    # apt install ppem-agent
    

    The ppem-agent.yml agent configuration file will be downloaded to your local device.

  2. Create the DBMS user on behalf of which the agent will connect to the managed DBMS server database:

    # sudo -u postgres createuser -s --pwprompt ppem_agent
    

    When executing this command, specify the DBMS user password.

  3. Ensure that the DBMS user can connect to the repository database:

    # psql -h localhost -U ppem_agent -d ppem
    

    In case of connection issues, ensure that the HBA rule allowing the DBMS user to connect to the database, as well as the authorization method, are specified in the pg_hba.conf configuration file.

    For more information, refer to the official Postgres Pro documentation on the pg_hba.conf configuration file.

  4. Get an API key to configure the agent:

    1. Log in to the web application.

    2. In the navigation panel, go to Summary.

    3. If the agent installation instruction is displayed on the page, then copy the key from the instruction.

    4. If no instruction is displayed, then complete the following steps:

      1. In the navigation panel, go to InfrastructureAgents.

      2. In the Authentication key column for any agent, click either Copy the key to copy the key or Reveal to view the key.

  5. In the ppem-agent.yml agent configuration file, specify agent parameters:

    agent:
      name: "agent_name"
      manager:
        url: "URL_for_connecting_to_manager"
        api_key: "API_key_for_connecting_to_manager"
      instance:
        connection_defaults:
          user: "DBMS_username"
          password: "DBMS_user_password"
    http:
      server:
        address: "network_address_for_incoming_connections"
        port: "port_for_incoming_connections"
    

    Where:

    • agent.name: The unique agent name.

    • agent.manager.url: The URL for connecting the agent to the manager in the scheme://manager_network_address/path_to_API_version format.

    • agent.manager.api_key: The previously obtained API key for connecting the agent to the manager.

    • agent.instance.connection_defaults.user and agent.instance.connection_defaults.password: The name and password of the DBMS user.

    • http.server.address and http.server.port: The network address and port number for incoming network connections.

      To enable listening of all network addresses and ports, do not specify any values for these parameters.

  6. Start the agent service and add it to the server startup:

    # systemctl start ppem-agent
    # systemctl enable ppem-agent