The PEM agent executes tasks scheduled via the PEM server, and reports statistics from the agent's operating system and one or more Postgres servers running on the agent's host. A PEM agent must reside on each monitored virtual or physical machine. A copy of the PEM server must be installed and running on the network on which the PEM agent's host resides.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-5.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.Click Next to continue to the PEM Server Installation Details dialog (shown in Figure 3.63).
• Specify the name or IP address of the host running the PEM server in the Host field (that is, the host running the database server containing the pem database, not the host running the Apache/PHP web server if two separate hosts are being used).
• Specify the name of the Postgres 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 PEM client tree control displays the value entered in the Description field (on the Agent Details dialog, 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 hosts functionality (such as Acctg).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.3.5.1 PEM Agent PrivilegesBy default, the PEM agent is installed with root privileges for the operating system host and superuser privileges for the database server. These privileges allow the PEM agent to invoke unrestricted probes on the monitored host and database server about system usage, retrieving and returning the information to the PEM server.Please note that PEM functionality diminishes as the privileges of the PEM agent decrease. For complete functionality, the PEM agent should run as root. If the PEM agent is run under the database server's service account, PEM probes will not have complete access to the statistical information used to generate reports, and functionality will be limited to the capabilities of that account. If the PEM agent is run under another lesser-privileged account, functionality will be limited even further.Please note that if you limit the operating system privileges of the PEM agent, some of the PEM probes will not return information, and the following functionality may be affected:
If you restrict the database privileges of the PEM agent, the following PEM functionality may be affected:
If the probe is querying the operating system with insufficient privileges, the probe may return a 'permission denied' error.If the probe is querying the database with insufficient privileges, the probe may return a 'permission denied' error or display the returned data in a PEM chart or graph as an empty value.When a probe fails, an entry will be written to the log file that contains the name of the probe, the reason the probe failed, and a hint that will help you resolve the problem.You can view probe-related errors that occurred on the server in the Probe Log Dashboard, or review error messages in the PEM agent log files. On Linux, the default location of the PEM agent log file is: