3.3 Installing a PEM Agent
3 Installing Postgres Enterprise Manager™ : 3.3 Installing a PEM Agent
The PEM agent executes tasks scheduled via the PEM server, and reports statistics from the agent's operating system and one or more monitored Postgres servers.To invoke the PEM agent installer, assume superuser (or Administrative) privileges and navigate into the directory that contains the installer. Then, invoke the installer with the command:pem_agent-7.x.x-x-platform.extThe Setup… page opens, welcoming you to the PEM Agent installer (as shown in Figure 3.60).Click Next to continue to the License Agreement (shown in Figure 3.61).Carefully review the license agreement before highlighting the appropriate radio button and accepting the agreement; click Next to continue to the Installation Directory dialog (shown in Figure 3.62).By default, the PEM agent is installed in the /home/opt/PEM directory. You can accept the default installation directory, or modify the contents of the Installation Directory field, specifying an alternate installation directory for the PEM agent.By default, the PEM agent installer places a certificate in ~root/.pem (on Linux) or in the Administrator’s %APPDATA%\pem directory (on Windows). Check the Show advanced options box to indicate that you would like the PEM agent installer to include a dialog that allows you to specify an alternate path for the certificate file.Check the box next to Register now? to instruct the installer to register the newly installed PEM agent with the PEM server.Click Next to continue to the PEM Server Installation Details dialog (shown in Figure 3.63).
• Specify the name or IP address of the system on which the PEM database server resides in the Host field. Please note: If the ApacheHTTPD web server and PEM database are hosted on different systems, you must specify the host of the PEM database.
• Specify the name of the database superuser in the User Name field.
• Click Next to continue. The installer will attempt to connect to the server to verify that the details are correct.Please Note: The PEM server must allow connections from the PEM agent installer. If you encounter a connection error, confirm the connection properties specified on the PEM Server Installation Details dialog are correct, and confirm that the pg_hba.conf file (on the PEM server) will allow a connection to the server described in the error message. For information about modifying the pg_hba.conf file, see .The tree control displayed in the Browser panel of the PEM web interface displays the value entered in the Description field (shown in Figure 3.64) to identify the PEM agent. Specify a descriptive name for the agent, such as the hostname of the machine the agent is installed on, or a name that reflects the host's functionality.Provide a descriptive name, or accept the default provided by the PEM agent host, and click Next to continue.If you checked the Show advanced options checkbox shown in Figure 3.24, the Advanced options dialog opens (shown in Figure 3.65).By default, the PEM agent installer places the certificate in the /root/.pem directory. Specify an alternate path for the certificate or accept the default and click Next.The wizard is now ready to install the PEM agent; click Back to amend the installation directory, or Next to continue.Click Next on the Ready to Install dialog (shown in Figure 3.66) to instruct the installer to copy files to the system and register the agent on the PEM server.The PEM agent installer displays progress bars (shown in Figure 3.67) to mark the PEM agent's installation progress.When the installation has completed, the PEM agent will be running and reporting operating system and host data to the PEM server. To start monitoring Postgres instances on the host of the PEM agent, they must now be added to PEM’s enterprise directory and bound to the agent.On a Linux system, you can use the yum package manager to install a PEM agent. Please note that before using a package manager to install the PEM agent, the host must contain the following packages:
1. Download the edb-repo installation package from:The edb-repo package creates the repository configuration file (named edb.repo). The edb.repo file defines multiple repositories hosted at EnterpriseDB.com.
2. Assume superuser privileges and use the following command to install the edb-repo package, and create the repository configuration file:rpm -Uvh edb-repo-9.x-x.noarch.rpmWhere x specifies the version of the file.Then, use your choice of editor to modify the configuration file, enabling the enterprisedb-tools and enterprisedb-dependencies repositories. The configuration file is named edb.repo; it resides in /etc/yum.repos.d.To enable a repository, change the value of the enabled parameter to 1 and replace the user_name and password placeholders in the baseurl specification with your repository credentials. Contact for repository credentials.baseurl=http://user_name:email@example.com/tools/redhat/rhel-$releasever-$basearchbaseurl=http://user_name:firstname.lastname@example.org/dependencies/redhat/rhel-$releasever-$basearchbaseurl=http://user_name:email@example.com/9.6/redhat/rhel-$releasever-$basearch
3. After modifying the content of the repository configuration file, you can use yum to install the PEM agent:When the installation is complete, yum will display a list of the installed packages and dependencies (see Figure 3.69).When you install an RPM package that is signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter a y, and press Return to continue.During the installation, yum may encounter a dependency that it cannot resolve. If it does, it will provide a list of the required dependencies that you must manually resolve.18.104.22.168 Registering an AgentAfter an installation, you must register the PEM agent. The registration process provides the PEM server with the information it needs to communicate with the agent. You can use the pemworker utility to register the agent if you:The RPM installer places the PEM agent in the /usr/pem/agent/bin directory. To register an agent, include the --register-agent keywords along with registration details when invoking the pemworker utility:Append command line options to the command string when invoking the pemworker utility. Each option should be followed by a corresponding value:
Before any changes are made on the PEM database, the connecting agent is authenticated with the PEM database server. When invoking the pemworker utility, you must provide the password associated with the PEM server administrative user role (postgres). There are three ways to specify the administrative password; you can:
• set the PEM_SERVER_PASSWORD environment variable.
• provide the password on the command line with the PGPASSWORD keyword.
• create an entry in the .pgpass file.Failure to provide the password will result in a password authentication error; you will be prompted for any other required but omitted information. When the registration is complete, the server will confirm that the agent has been successfully registered.The PEM agent RPM installer creates a sample configuration file named agent.cfg.sample. When you register the PEM agent, the pemworker program creates the actual agent configuration file (named agent.cfg). If you have performed an RPM installation, both files reside in /usr/pem-7.x/etc. You must modify the agent.cfg file, adding the following configuration parameter:You must also add the location of the ca-bundle.crt file (the certificate authority). By default, the installer creates a ca-bundle.crt file in the location specified in your agent.cfg.sample file. You can copy the default parameter value from the sample file, or, if you use a ca-bundle.crt file that is stored in a different location, specify that value in the ca_file parameter:The service will confirm that it is starting the agent; when the agent is registered and started, it will be displayed on the Global Overview dashboard and in the Object browser tree control of the PEM web interface.
3 Installing Postgres Enterprise Manager™ : 3.3 Installing a PEM Agent