Chapter 18. Configuring an Agent
Install the agent:
# apt install ppem-agent
The
ppem-agent.ymlagent configuration file will be downloaded to your local device.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.
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.confconfiguration file.For more information, refer to the official Postgres Pro documentation on the
pg_hba.confconfiguration file.Get an API key to configure the agent:
In the navigation panel, go to Summary.
If the agent installation instruction is displayed on the page, then copy the key from the instruction.
If no instruction is displayed, then complete the following steps:
In the navigation panel, go to Infrastructure → Agents.
In the Authentication key column for any agent, click either
to copy the key or
to view the key.
In the
ppem-agent.ymlagent 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 theformat.scheme://manager_network_address/path_to_API_versionagent.manager.api_key: The previously obtained API key for connecting the agent to the manager.agent.instance.connection_defaults.userandagent.instance.connection_defaults.password: The name and password of the DBMS user.http.server.addressandhttp.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.
Start the agent service and add it to the server startup:
# systemctl start ppem-agent # systemctl enable ppem-agent