The PEM Agent installer creates two executables: the PEM worker (pemworker.exe) and the PEM agent (pemagent.exe). Each PEM worker has a corresponding PEM agent that you can use to start or stop the PEM worker. The PEM agent will also restart the PEM worker should it terminate unexpectedly.
On a Windows system, you can invoke the installer by right-clicking on the downloaded installer’s icon, and selecting Run as Administrator. The PEM Agent Setup Wizard opens, welcoming you.Carefully review the license agreement (see Figure 2.2) before highlighting the appropriate radio button and accepting the agreement; click Next to continues to the Installation Directory dialog.By default, the PEM agent is installed in C:\Program Files\PEM directory. You can accept the default installation directory, or modify the contents of the Installation Directory field (see Figure 2.3), specifying an alternate installation directory for the PEM agent.By default, the PEM agent installer places a certificate 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.Enter the connection details for the PEM server on the PEM server installation details dialog (see Figure 2.4):
• Specify the name or IP address of the system on which the PEM database server resides in the Host field. Please note: If the PEM-HTTPD web server and PEM database are hosted on different systems, you must specify the host of the PEM database.
•
•
• 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.The tree control displayed in the Browser panel of the PEM web interface displays the value entered in the Description field (shown in Figure 2.5) 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 2.6).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 2.7) to instruct the installer to copy files to the system and register the agent on the PEM server.
• Include the --mode unattended option when invoking the installer to perform an installation without additional user input.
• Include the --mode text option when invoking the installer to perform an installation from the command line with an interactive installer.Not all command line options are suitable for all platforms. For a complete reference guide to the command line options, include the --help option when you invoke the installer.-----------------------------------------------------------------
Welcome to the Postgres Enterprise Manager (PEM) Agent Setup Wizard.
-----------------------------------------------------------------Before installing the PEM server, you must review and accept the terms of the PEM license agreement:By default, the PEM agent installer places a certificate in the Administrator’s %APPDATA%\pem directory (on Windows). Enter a Y after Show advanced options to access menu options that allow you to specify an alternate path for the certificate file.
• install the PEM server; the pg_hba.conf file of the PEM server must allow connections from the host of the PEM agent.pem-agent-7.x.x-windows-x64.exe --mode unattended
--pghost pem_server_host_address --pgport pem_server_port
--pguser postgres --pgpassword pguser_password
--agent_description agent_namepem_server_port specifies the port used by the backing PEM database; by default, the database uses port 5432.pguser_password specifies the password associated with the PEM database superuser.agent_name specifies a descriptive name for the PEM agent.
On a RHEL or CentOS 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:Where 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 EnterpriseDB for repository credentials.baseurl=http://user_name:password@yum.enterprisedb.com/dependencies/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 2.10).
To install a PEM agent on a Debian or Ubuntu host, you must have credentials that allow access to the EnterpriseDB repository. To request credentials for the repository, visit the EnterpriseDB Advanced Downloads page at:2. Configure the EnterpriseDB repository:3. Add support to your system for secure APT repositories:4. Add the EBD signing key:5. Update the repository metadata:6. Use the following command to install the Debian package:
• For PEM Server and agent: apt-get install edb-pem-server
• For PEM agent: apt-get install edb-pem-agent
Each PEM agent must be registered with the PEM server. The registration process provides the PEM server with the information it needs to communicate with the agent. The PEM agent graphical installer supports agent self-registration, but you can use the pemworker utility to register the agent if you skip PEM agent registration during a graphical installation or use an RPM package to install a PEM agent.The RPM installer places the PEM agent in the /usr/edb/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:
•
• provide the password on the command line with the PGPASSWORD keyword.
• create an entry in the .pgpass file.The PEM agent RPM installer creates a sample configuration file named agent.cfg.sample in the /usr/edb/pem/agent/etc directory. When you register the PEM agent, the pemworker program creates the actual agent configuration file (named agent.cfg). 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:Then, use a platform-specific command to start the PEM agent service; the service is named pemagent. For example, on a CentOS or RHEL 6.x system, you would use the command: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.For information about using the pemworker utility to register a server, please see the PEM Getting Started Guide, available at:
To register a PEM agent using a non-root user, you first need to install PEM agent as a root user. After installation, change to a non-root user (for example, edb) and perform the following steps:
1.
2. Register the agent with PEM server using pemworker utility as following:The above command creates agent certificates & agent.cfg inside /home/edb/.pem directory. Assign 600 permission to these files using the command:
3. Change the parameters of agent.cfg file as following.
• If you are using CentOS 6, update the pemagent service file to reflect the correct path of agent.cfg file and also change user su to su edb.
By 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.
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.
With the exception of the PEM_MAXCONN parameter, we strongly recommend against modifying any of the configuration parameters or registry entries listed below without first consulting EnterpriseDB support experts unless the modifications are required to enable PEM functionality.
• On 64 bit Windows systems, PEM registry entries are located in HKEY_LOCAL_MACHINE\Software\Wow6432Node\EnterpriseDB\PEM\agent
• On Linux systems, PEM configuration options are stored in the agent.cfg file, located in /opt/edb/pem/agent/etc
The PEM Agent properties dialog provides information about the PEM agent from which the dialog was opened; to open the dialog, right-click on an agent name in the PEM client tree control, and select Properties from the context menu.
• The Description field displays a modifiable description of the PEM agent. This description is displayed in the tree control of the PEM client.
• You can use groups to organize your servers and agents in the PEM client tree control. Use the Group drop-down listbox to select the group in which the agent will be displayed.
• Use the Team field to specify the name of the group role that should be able to access servers monitored by the agent; the servers monitored by this agent will be displayed in the PEM client tree control to connected team members. Please note that this is a convenience feature. The Team field does not provide true isolation, and should not be used for security purposes.
• The Heartbeat interval fields display the length of time that will elapse between reports from the PEM agent to the PEM server. Use the selectors next to the Minutes or Seconds fields to modify the interval.
If an agent has been deleted from pem.agent table then you cannot restore it. You need to re-register the agent using PEM worker utility.If an agent has been deleted from PEM Web client but still has an entry in the pem.agent table with value of active = f, then you can restore the agent using the following steps:
3. Use the following command to drop the pem database:
4. Move the certificates from /root/.pem/ to another location:
5.
Using the PEM web interface to delete PEM agents with a Down or Unknown status may be difficult if the number of such agents is large. In such situations, you might want to use the command line interface to delete Down or Unknown agents.You can use the following query to delete the agents that are Down for more than <N> number of hours:Where <N> specifies the number of hours.Use the following query to delete the agents with an Unknown status:
If the PEM installation resides on a Windows host, you can use the Windows Uninstall a Program applet to remove PEM components. To open the Uninstall a Program applet, navigate through the Programs submenu on the Windows Control Panel, selecting Programs and Features. When the Uninstall a Program window opens, highlight the name of the PEM component that you wish to remove, and click the Uninstall/Change button. A Windows popup will open, prompting you to confirm that you wish to remove the component; click Yes to remove the component.