Throughout this guide, the term Postgres refers to either a PostgreSQL or an Advanced Server installation, where either is appropriate.Language pack installers contain supported languages that may be used with EDB Postgres Advanced Server and EnterpriseDB PostgreSQL database installers. The language pack installer allows you to install Perl, TCL/TK, and Python without installing supporting software from third party vendors. For more information about installing and using Language Pack, please see the EDB Postgres Language Pack Guide, available from the EnterpriseDB Website.
1.1 What's New
In the following descriptions a term refers to any word or group of words that are language keywords, user-supplied values, literals, etc. A term’s exact meaning depends upon the context in which it is used.
• Italic font introduces a new term, typically, in the sentence that defines it for the first time.
• Fixed-width (mono-spaced) font is used for terms that must be given literally such as SQL commands, specific table and column names used in the examples, programming language keywords, etc. For example, SELECT * FROM emp;
• Italic fixed-width font is used for terms for which the user must substitute values in actual usage. For example, DELETE FROM table_name;
• Square brackets [ ] denote that one or none of the enclosed term(s) may be substituted. For example, [ a | b ], means choose one of “a” or “b” or neither of the two.
• Braces {} denote that exactly one of the enclosed alternatives must be specified. For example, { a | b }, means exactly one of “a” or “b” must be specified.
• Ellipses ... denote that the proceeding term may be repeated. For example, [ a | b ] ... means that you may have the sequence, “b a a b a”.
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.The PEM worker log file contains information related to PEM worker activity (probe activities, heartbeat responses, etc.), and is stored in /var/log/pem/worker.log.
The pg_hba.conf file manages connections for the Postgres server. You must ensure that the pg_hba.conf file on each monitored server allows connections from the PEM server, the monitoring PEM agent, and the host of the PEM-HTTPD server.For information about modifying the pg_hba.conf file, see the PEM Getting Started Guide, available at:Before installing the PEM Server on a system that is running SELinux, you must set SELinux to permissive mode.The following example works on Redhat Enterprise Linux, Fedora Core or CentOS distributions; use comparable commands that are compatible with your Linux distribution to set SELinux to permissive mode during installation and return it to enforcing mode when installation is complete.Before installing the PEM agent on a CentOS 7.x host, you must ensure that the host contains the wxBase and epel-release packages. To install the packages, open a command line, assume root privileges, and invoke the commands:If you are installing PEM components on Windows, you may be required to invoke the PEM installers with Administrative privileges. To invoke an installer using Administrator privileges, right click on the installer icon and select Run as Administrator from the context menu.At this time, the PEM server and web interface support a locale of English(US) en_US and use of a period (.) as a language separator character. Using an alternate locale, or a separator character other than a period may result in errors.
The PEM server graphical installer installs and configures the PEM server, a PEM agent, and the software required to connect to the PEM web interface with your choice of browser. The PEM agent that is installed with the PEM server is capable of monitoring multiple servers that reside on the same host, or on remote hosts; please note that PEM functionality on servers monitored by a remote agent may be limited. For detailed information about using the PEM server graphical installer, see Section 3.1.You can use an RPM package on a RHEL 7 host to install the PEM server; for detailed information about using the installer, see Section 3.2.
The PEM server backend database may be an EnterpriseDB distribution of the PostgreSQL or Advanced Server database server, or an existing Postgres server installed from another source. The Postgres backing database server must be version 9.3 or later, and will contain a database named pem, which is used by the PEM server as a repository.
• If you would like to use an existing Postgres server to host the PEM server, the PEM server installer can create the pem database on the Postgres host. You must manually satisfy the software pre-requisites if you choose to use an existing server.For more information about using an existing Postgres server to host the PEM server backend database, see Section 3.1.3.Before installing the PEM server, you must decide if you wish to run PostgreSQL and PEM-HTTPD on the same host or on separate hosts. If you intend to run the PostgreSQL database server and PEM-HTTPD on different hosts, then you must run the PEM server installer twice – once on each host, as detailed in Section 3.1.2.The PEM server installer will also install the software required to access the server via the PEM web interface (shown in Figure 3.1). You can access the web interface with a supported version of your browser of choice.
On a Windows system, right click the installer icon and select Run as Administrator. The installer displays a Welcome dialog (shown in Figure 3.2).Carefully review the license agreement (see Figure 3.3) before highlighting the appropriate radio button and accepting the agreement. Click Next to continue to the Installation Directory dialog.Use the Installation Directory dialog (shown in Figure 3.4) to specify the location of the PEM server:
• By default, the PEM server is installed in the /opt/PEM directory on Linux or in C:\Program Files\PEM on Windows. Accept the default location, or use the Installation Directory button to open a browser dialog and select the directory in which the PEM server will be installed.
• Use the Show advanced options check box to instruct the installer to open the Advanced options dialog.Use the Advanced options dialog when installing the Postgres database server and the PEM-HTTPD on different hosts, or if you wish the PEM server to reside on an existing Postgres server installation.To install the PostgreSQL server packaged with the installer and PEM-HTTPD on the same host, leave the Show advanced options box unchecked and click Next.The PEM server installer will perform a pre-installation check for PEM-HTTPD, LanguagePack, and PostgreSQL 10. If the installer does not locate these packages, it will inform you in the Dependency missing dialog (shown in Figure 3.5).After installing any missing dependencies, the installation process continues by displaying the Database Server Installation Details dialog.The information provided on the Database Server Installation Details dialog (see Figure 3.6) enables the installer to connect to the PostgreSQL server. Provide the User name and Password of a database superuser. After supplying the requested information, click Next to continue to the Network Details dialog.Use the Network Details dialog (see Figure 3.7) to specify the CIDR-style network address from which the PEM agents will connect to the server (the client-side address).You may specify the address of a network host, or a network address range. For example, if you wish to monitor database servers with the addresses 192.168.10.23, 192.168.10.76 and 192.168.10.184, enter 192.168.10.0/24 to allow connections with hosts in that network.The specified address will be added to the server's pg_hba.conf file. You can specify additional network addresses by manually adding entries to the pg_hba.conf file on the PostgreSQL server if required, using the initial entry as a template.The PEM server installer will install a PEM agent on the host on which the server resides, to monitor the server and provide alert processing and garbage collection services. A certificate will also be installed in the location specified in the Agent certificate path field (see Figure 3.8).Enter an alternate description or select an alternate agent certificate path for the PEM agent, or accept the defaults. Click Next to continue to the Ready to Install dialog.Click Back to modify any of the options previously selected, or Next to continue with the installation.During the installation process, the installer will copy files to the system, and set up the database and web services required to run PEM. When the installation completes, a popup dialog opens (shown in Figure 3.11) confirming that the webservice has been configured, and is listening on port 8443, and that the pem database has been created and configured.Click OK to acknowledge that the webservice has been configured, and that the pem database has been created, and continue to the Completed… dialog (shown in Figure 3.12).
1. Invoke the PEM server installer on the host of the Postgres server that will contain the pem database. During the installation, select the Database option on the Advanced options dialog, and provide connection information for the Postgres server.
2. Modify the pg_hba.conf file of the Postgres installation on which the PEM server (and pem database) resides, allowing connections from the host of the PEM-HTTPD server.
3. Invoke the PEM server installer on the host of the PEM-HTTPD server, selecting the Web Services option on the Installation Type dialog.On a Windows system, right click the installer icon and select Run as Administrator. The installer displays a Welcome dialog (shown in Figure 3.13).Carefully review the license agreement (see Figure 3.14) before highlighting the appropriate radio button and accepting the agreement; click Next to continue.Use fields on the Installation Directory dialog (see Figure 3.15) to specify the directory in which the PEM server will reside, and to access the Advanced options dialog:
• By default, the PEM server is installed in the /opt/PEM directory on Linux or in C:\Program Files\PEM on Windows. Accept the default location, or use the Installation Directory field to open a browser dialog and select the directory in which the PEM server will be installed.
• To install the PEM server and PEM-HTTPD on separate hosts, you must use the Advanced options dialog to specify the installation type (Web Services or Database). Select the Show advanced options check box to instruct the installer to include the Advanced options dialog in the installation process.Use the radio buttons on the Advanced options dialog (see Figure 3.16) to specify the component or components that you would like to install:
• Select Web Services and Database to indicate that the Postgres server and PEM-HTTPD will both reside on the current host. If you select the Web Services and Database option, the PEM server installer will allow you to specify which Postgres server you wish to use for the PEM server before checking for a PEM-HTTPD installation.
• Select Web Services to install PEM-HTTPD on the current host, while using a Postgres database server that resides on another host to host the PEM server and pem database.Please note: you must complete the PEM server installation process on the host of the PEM server (and pem backend database), selecting Database on the Advanced options dialog, and modifying the connection properties of the pg_hba.conf file on the PEM server before using the Web Services option to install PEM-HTTPD.
• Select Database to use an existing Postgres server (version 9.3 or greater), or to install only the database server that is distributed with the PEM server installer.This option invokes the installation steps documented in Section 3.1.2.1, Specifying a Database Host.After selecting an installation option, click Next to continue.
3.1.2.1 Specifying a Database HostSelecting the Database option on the Advanced options dialog (Figure 3.17) allows you to specify connection information for the host on which the PEM server backend database (named pem) will reside.Use the drop-down listbox on the Database Server Selection dialog (see Figure 3.18) to select a host for the PEM server backend database. You can:
• Select a host from existing Postgres installations that reside on the current host. Please note that you may be required to add the sslutils package to your installation.
• Select the PostgreSQL 9.6 option to install the Postgres server that is distributed with the PEM server installer. If you decide to use the version of PostgreSQL that is bundled with the PEM server installer, the EnterpriseDB one-click PostgreSQL installer will open and walk you through the installation.
• Select Other Database Server to specify connection information for a Postgres server that was not installed using a one-click graphical installer from EnterpriseDB. For information about the software pre-requisites for the PEM server database host, please see Section 3.1.3.1, Preparing the Postgres Server.Click Next to continue.If the PEM server will reside on an existing Postgres server, the Database Server Installation Details dialog shown in Figure 3.19 opens.The information required on the Database Server Installation Details dialog may vary; the PEM server installer will ask you to provide only the information about the selected installation that it cannot locate:
•
• Specify the password associated with that user in the Password field.Click Next to continue.If prompted, provide the system password for the service account under which the PEM agent will run, and click Next to continue to the Network Details dialog.Use the Network Details dialog (see Figure 3.20) to specify the CIDR-style network address from which PEM agents will connect to the server (the client-side address). The specified address will be added to the server's pg_hba.conf file.Please note: you can specify additional network addresses by manually adding entries to the pg_hba.conf file on the PostgreSQL server.Accept the default (specifying the localhost), or specify a Network address range, and click Next to continue to the Agent Details dialog.The PEM server installer will install a PEM agent on the host on which the server resides, to monitor the server and provide alert processing and garbage collection services. A certificate will also be installed in the location specified in the Agent certificate path field (see Figure 3.21).You can enter an alternate description or an alternate agent certificate path for the PEM agent, or accept the defaults. Click Next to continue.The wizard is now ready to install the PEM server (see Figure 3.22). Click Back to modify any of the options previously selected, or Next to proceed with the installation.During the installation process, the installer will copy files to the system, and set up the PEM server's backend database. A popup dialog opens (shown in Figure 3.24) confirming that the pem database has been created and configured.Click OK to acknowledge that the pem database has been created, and continue to the Completed… dialog.
3.1.2.2 Installing Web ServicesSelecting the Web Services radio button on the Advanced options dialog (Figure 3.26) instructs the PEM server installer to either install PEM-HTTPD on the current host or update an existing PEM-HTTPD installation.
• Modified the pg_hba.conf file on the PEM server database host to allow connections from the PEM-HTTPD host, and restarted the database server.When you select the Web Services option and click Next, the PEM server installer will check the current host for existing PEM-HTTPD and LanguagePack installations.Click Next to instruct the server to instruct the server to install LanguagePack (see Figure 3.28).Follow the onscreen instructions of the PEM-HTTPD Setup Wizard. When the wizard completes the installation, click Finish to open the Database Server Installation Details dialog.Use the fields on the Database Server Installation Details dialog (see Figure 3.30) to provide connection information for the Postgres installation that is hosting the PEM server installation:
•
• Enter the password associated with the Postgres superuser in the Password field.Click Next to continue. Before completing the PEM server installation, the installer will contact the database host. The pg_hba.conf file on the PEM database host must be configured to accept connections from the host of the httpd server and the firewall must allow a connection for the installation to continue. The PEM server installer will complete the PEM server installation, adding only those items that must reside on the host of the PEM-HTTPD server.
You can use an existing Postgres server (version 9.3 or later) to host the PEM server and the pem database. Postgres installers and pre-requisite software extensions are freely available from the EnterpriseDB website at:The following versions of Postgres are pre-configured to contain the sslutils extension and a service script; no additional preparation is required to use the following Postgres versions as a PEM backend database server:3.1.3.1 Preparing the Postgres Server
• Ensure that the Postgres server contains an installation of the sslutils extension. For more information, see Section 3.1.3.1.1.
• 3.1.3.1.1 Installing the sslutils ExtensionThe Postgres server on which the PEM server will reside must contain the sslutils extension. The sslutils package is freely available for download from the EnterpriseDB website at:When the web page opens, select the link for the SRC- SSL Utils 1.2 package. When the download completes, extract the file, and copy it into the Postgres installation directory.
2.
3.
4. Move into the sslutils folder, and enter:Remember: You are not required to manually add the sslutils extension when using the following Postgres installations:sslutils must be built with the same compiler that was used to compile the backend Postgres installation. If you are using a backend Postgres database that was installed on a Windows platform using a PostgreSQL one-click installer (from EnterpriseDB) or an Advanced Server installer, you must use Visual Studio to build sslutils.
1. Copy the sslutils package to the Postgres installation directory.
2. Open the command line of the appropriate compiler, and navigate into the sslutils directory.
3. Use the following commands to build sslutils:SET USE_PGXS=1
SET GETTEXTPATH=path_to_gettext
SET OPENSSLPATH=path_to_openssl
SET PGPATH=path_to_pg_installation_dir
SET ARCH=x86
REM Set ARCH x64 for 64 bit
msbuild sslutils.proj /p:Configuration=Releasepath_to_pg_installation_dir specifies the location of the Postgres installation.
4. Copy the compiled sslutils files to the appropriate directory for your installation. The sslutils directory will contain the following files:On Linux, the service script must reside in the /etc/init.d directory. The service script must be able to start, stop and restart the database server. Service scripts are platform-specific; you can find a sample service script for Linux in Section 7 Linux Service Script (Sample). For information about customizing a Postgres service, visit:If you are using Windows to host the PEM backend database, you must register the name of the Postgres server with the Windows service manager. If you are using a Postgres server that was created using an EnterpriseDB installer, the service will be registered automatically. If you are manually building the installation, you can use the register clause of the Postgres pg_ctl command to register the service. The syntax of the command is:user_name specifies the name of an operating system user with sufficient privileges to access the Postgres installation directory and start the Postgres service.password specifies the operating system password associated with the user.data_directory specifies the location of the Postgres data directory.For more information about using the pg_ctl command and the available command options, see the Postgres core documentation, available at:
The installer displays a Welcome dialog (shown in Figure 3.31).Carefully review the license agreement (see Figure 3.32) before highlighting the appropriate radio button and accepting the agreement; click Next to continue to the Installation Directory dialog.Use the Installation Directory dialog (shown in Figure 3.33) to specify the location of the PEM server, and access the Advanced options dialog:
• Use the Installation Directory field to open a browser dialog and select the directory in which the PEM server will be installed.
• If you are installing the PEM server on an existing server, check the box next to Show advanced options to instruct the installer to include the Advanced options dialog in the installation process.Click Next to continue.Use the radio buttons on the Advanced options dialog (shown in Figure 3.34) to specify an installation type. Select:
• Web Services and Database if both the Postgres server and the PEM-HTTPD server will reside on the current host. This option is valid if you are using an existing Postgres server to host the PEM server, or using the PEM server installer to install the Postgres server on which the PEM server will reside.If you select Web Services and Database, the PEM server installer will check the current host for a PEM-HTTPD installation, and upgrade or install PEM-HTTPD if necessary.
• Web Services if only the PEM-HTTPD server will reside on the current host. See Section 3.1.2.2 for more information about invoking this option.
• Database if you are installing only the PEM server (and creating the pem backend database) on the current host. This option is valid if you are using an existing Postgres server to host the PEM server, or using the PEM server installer to install the PostgreSQL server on which PEM will reside.After selecting an installation option, click Next to continue.Use the drop-down listbox on the Database Server Selection dialog (Figure 3.35) to select a backend database for the PEM server:
• Select the PostgreSQL 9.6 (Packaged) option to instruct the installation wizard to install and use the PostgreSQL server that is packaged with the PEM server installer.
• Select Other Database Server to instruct the PEM server installer to use a Postgres database that was installed from a source other than an EnterpriseDB installer (i.e. from an rpm, or built from source).Note that the selected database server must include an installation of the sslutils contrib module, and have a startup script (on Linux) or a registered service (on Windows). For information about Preparing the Postgres Server, please see Section 3.1.3.1.If you selected Web Services and Database on the Advanced options dialog, the installation wizard will check the current host for an existing PEM-HTTPD installation, and upgrade or install the service as needed.If you selected Database on the Advanced options dialog, the Database Server Installation Details dialog opens (shown in Figure 3.36).Use the fields on the Database Server Installation Details dialog to describe the connection to the Postgres server that will host the PEM server:
• Enter the name of a database superuser in the User field.
• Enter the password associated with the superuser in the Password field.
• Click Next to continue.Use the Network Details dialog (Figure 3.37) to specify the CIDR-style network address from which the PEM agents will connect to the server (the client-side address). The specified address will be added to the server's pg_hba.conf file.You can specify additional network addresses by manually adding entries to the pg_hba.conf file on the PostgreSQL server if required, using the initial entry as a template.The PEM server installer will install a PEM agent to the host on which the server resides, to monitor the server and provide alert processing and garbage collection services. A certificate will also be installed in the location specified in the Agent certificate path field (see Figure 3.38).You can enter an alternate description or an alternate agent certificate path for the PEM agent, or accept the defaults. Click Next to continue to the Ready to Install dialog.The wizard is now ready to install the PEM server (see Figure 3.39). Click Back to modify any of the options previously selected, or Next to continue with the installation.During the installation process, the installer will copy files to the system, and set up the PEM server's backend database. A popup dialog opens (shown in Figure 3.41) confirming that the pem database has been created and configured.Click OK to acknowledge that the pem database has been created, and continue to the Completed… dialog (shown in Figure 3.42).
• Modify the pg_hba.conf file on the Postgres server host to allow connections between the hosts.
• Invoke the PEM server installer on the host of the PEM-HTTPD server. See Section 3.1.2.2 for more information about installing PEM-HTTPD.
The pg_hba.conf file on the backing database must be configured to use trust authentication for connections. For information about modifying the pg_hba.conf file, visit:Before installing the PEM server, you must create the repository configuration file (edb.repo). The repository configuration file contains connection and authentication information for the EnterpriseDB repository. To prepare your system to perform an RPM installation, assume superuser privileges and use yum to create the repository configuration file:Please note: If you are a Red Hat Network user you must also enable the rhel-x-server-optional-rpms repository to use EPEL packages, where x specifies the version of RHEL on the host. You can make the repository accessible by enabling the RHEL optional subchannel for RHN-Classic. If you have a certificate-based subscription, please see the Red Hat Subscription Management Guide. You must also enable the rhel-x-server-extras-rpms repository, where x specifies the version of RHEL on the host.After creating the repository configuration file, use your choice of editor to enable the repository entries from which you will install packages. The repository configuration file is named edb.repo, and resides in /etc/yum.repos.d. To enable a repository, change the value of the enabled parameter to 1 and replace the username and password placeholders in the baseurl specification with your user name and the repository password.Run following commands to install rh-python36:Before installing the PEM server, you must disable SELinux; use the command:
CIDR formatted network address range that agents will connect to the server from, to be added to the server's pg_hba.conf file. For example, 192.168.1.0/24. The default is 0.0.0.0/0. The directory for the database server installation. For example, /usr/edb/as10 for Advanced Server or /usr/pgsql-10 for PostgreSQL. The unit file name of the PEM database server. For Advanced Server, the default file name is edb-as-10; for PostgreSQL, it is postgresql-10. The installation type: Specify 1 if the configuration is for web services and backing database, 2 if you are configuring web services, or 3 if you are configuring the backing database. If you specify 3, please note that the database must reside on the local host.
2.
3. If you are using a RHEL or CentOS 6.x host, restart the httpd24 server after configuring the PEM server; use the command:
The Setup… page opens, welcoming you to the PEM Agent installer (as shown in Figure 3.43).Carefully review the license agreement (see Figure 3.44) before highlighting the appropriate radio button and accepting the agreement; click Next to continue to the Installation Directory dialog.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 (see Figure 3.45), 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.Enter the connection details for the PEM server on the PEM server installation details dialog (see Figure 3.46):
• 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 3.47) 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.48).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.49) to instruct the installer to copy files to the system and register the agent on the PEM server.
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: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 3.52).
3.3.4 Registering an AgentEach 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/pem/agent/bin directory. To register an agent, include the --register-agent keywords along with registration details when invoking the pemworker utility:
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/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:
• 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.
Before invoking the installer, you must disable SE Linux; for more information, see Section 2.3. You must be a superuser to install the PEM server../edb-languagepack-version-linux-x64.run --mode unattended
./pem-httpd-version-linux-x64.run --mode unattended
./postgresql-version-linux-x64.run --mode unattended./pem-server-7.x.x-linux-x64.run --mode unattended
--existing-user registered_edb_user --existing-password edb_user_password --pgport port --pguser postgres
--pgpassword postgres -–cidr-address cidr_address_rangeregistered_edb_user specifies the name of a registered EnterpriseDB user. To register, visit the EDB website at: https://www.enterprisedb.com/user/registeredb_user_password specifies the password associated with the EDB user account.port specifies the port used by the backing PostgreSQL database; by default, the PostgreSQL database uses port 5432.cidr_address_range specifies the address range that will be added to the pg_hba.conf file of the PEM server's backing database to allow connections from the agents that will be monitored by the server. You may wish to specify a network range (for example, 192.168.2.0/24) to provide server access to agents that reside on the same network.Please note: when invoked in unattended mode, the PostgreSQL installer creates a user named postgres, with a password of postgres.In our example, the files are extracted to the C:\ directory. After extracting the files, you must install each program. Navigate into the directory that contains the files (in our example, C:\), and enter:edb-languagepack-version-windows-x64.exe --mode unattended
pem-httpd-version-windows-x64.exe --mode unattended
postgresql-version-windows-x64.exe --mode unattendedpem-server-7.x.x-windows-x64.exe --mode unattended
--existing-user registered_edb_user --existing-password edb_user_password --pgport port --pguser postgres
--pgpassword postgres -–cidr-address cidr_address_range
--agent_description pem-agent --systempassword windows_password
--agent-crt-path C:\edbregistered_edb_user specifies the name of a registered EnterpriseDB user. To register, visit the EDB website at: https://www.enterprisedb.com/user/registeredb_user_password specifies the password associated with the EDB user account.port specifies the port used by the backing PostgreSQL database; by default, the PostgreSQL database uses port 5432.cidr_address_range specifies the address range that will be added to the pg_hba.conf file of the PEM server's backing database to allow connections from the agents that will be monitored by the server. You may wish to specify a network range (for example, 192.168.2.0/24) to provide server access to agents that reside on the same network.windows_password specifies the password associated with the Windows Administrator's account.Please note: when invoked in unattended mode, the PostgreSQL installer creates a user named postgres, with a password of postgres.
• 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-linux-x64.run --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.
• 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.
Before invoking the installer, you must disable SE Linux; for more information, see Section 2.3. You must be a superuser to install the PEM server../edb-languagepack-version-linux-x64.run --mode unattended
./pem-httpd-version-1-linux-x64.run --mode unattended
./postgresql-version-linux-x64.run --mode unattendededb-languagepack-version-windows-x64.exe --mode unattended
pem-httpd-version-windows-x64.exe --mode unattended
postgresql-version-windows-x64.exe --mode unattended----------------------------------------------------------------
Welcome to the Postgres Enterprise Manager (PEM) Server Setup Wizard.
----------------------------------------------------------------
Before installing the PEM server, you must review and accept the terms of the PEM license agreement:Please read the following License Agreement. You must accept the terms of this agreement before continuing with the installation.
Review the license agreement; when prompted, accept the agreement, and press Return.
Do you accept this license? [y/n]: y
----------------------------------------------------------------
After accepting the license agreement, you will be prompted for the name and address of a registered EnterpriseDB user; provide the information when prompted:Email address []:
Password :
----------------------------------------------------------------
Next, you will be prompted for an installation directory; you can use the default installation directory, or specify an alternate location.Enter a Y after Show advanced options to access menu options that allow you to use a pre-existing Postgres server installation or PEM-HTTPD installation with the PEM server.Please specify user and password for the local server - 'PostgreSQL 10' installation running on port 5432.
User [postgres]:
Password :
----------------------------------------------------------------
When prompted, provide the network address or range that will be added to the pg_hba.conf file of the PEM server host; this will allow PEM agents on monitored hosts to contact the server:Network address [127.0.0.1/32]:
----------------------------------------------------------------
Use the Agent Details fields to specify a descriptive name for the agent and the location of the agent certificate:
Before invoking the installer, you must disable SE Linux; for more information, see Section 2.3. You must be a superuser to install the PEM agent.-----------------------------------------------------------------
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 ~root/.pem (on Linux) or 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.
Where ip_address_of_PEM_host specifies the IP address of the host of the PEM server. The Postgres Enterprise Manager Web Login window (shown in Figure 4.1) opens:Use the fields on the Postgres Enterprise Manager Login window to authenticate yourself with the PEM server:
• Provide the name of a pem database user in the Username field. For the first user connecting, this will be the name provided when installing the PEM server.
• Provide the password associated with the user in the Password field.Click the Login button to connect to the PEM server.Before you can use the PEM web interface to manage or monitor a database server, you must register the server with the PEM server. When you register a server, you describe the connection to the server, provide authentication information for the connection, and specify any management preferences (optionally binding an agent).
• A managed server is bound to a PEM agent. The PEM agent will monitor the server to which it is bound, and perform tasks or report statistics for display on the PEM dashboards. A managed server has access to extended PEM functionality such as Package Management or Custom Alerting; when registering a server, you can also allow a managed server to be restarted by PEM as required.
• An unmanaged server is not bound to a PEM agent; you can create database objects on an unmanaged server, but extended PEM functionality (such as Package Management or Custom Alerting) is not supported on an unmanaged server.You must also ensure the pg_hba.conf file of the server that you are registering allows connections from the host of the PEM web interface.To access online help information about the PEM web interface, select Help from the menu bar (see Figure 4.2). Additional information is available in .pdf and .html format from the EnterpriseDB website at:The PEM Getting Started Guide contains information about registering and managing servers, agents, and users.The PEM Enterprise Features Guide contains information about using the tools and wizards that are part of the web interface.The PEM EDB Ark Management Guide contains information about using PEM to manage cloud installations of Advanced Server and PostgreSQL.The PEM Upgrade and Migration Guide contains information about upgrading to PEM 7.6 from a previous version.
Follow the installation steps listed below to install the plugin for PostgreSQL before continuing to the Configuration section. If you are using Advanced Server, skip ahead to the Configuration section.
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 5.3).Specify an alternate location for the installation directory, or accept the default location and click Next to continue.
1. Edit the postgresql.conf file on the server you wish to profile, modifying the shared_preload_libraries parameter as shown below:
3. Using the Query Tool or the psql command line interface, run the sql-profiler.sql script in the database specified as the Maintenance Database on the server you wish to profile. If you are using:
• To use the PEM Query Tool to run the script, highlight the name of the maintenance database in the Browser tree control, and navigate through the Tools menu to select Query tool. When the Query Tool opens, use the Open option on the Files menu to open a web browser and navigate to the sql-profiler.sql script. By default, the sql-profiler.sql script is located in the contrib folder, under your Postgres installation.When the script opens in the SQL Editor panel of the Query Tool, highlight the content of the script in the SQL Editor and select the Execute option from the Query menu (or click the Execute icon) to invoke the script and configure SQL Profiler.You can also use the psql command line to invoke the configuration script. The following command uses psql to invoke the sql-profiler.sql script on an Advanced Server database on a Linux system:To access SQL Profiler functionality, highlight the name of the database in the PEM Browser tree control; navigate through the Management menu to the SQL Profiler pull-aside menu. Menu options allow you to manage your SQL traces:
•
•
•
• For more information about using SQL Profiler, consult the online help text for SQL Profiler (accessed through the Help menu) or the PEM Getting Started Guide.
1. Invoke the PEM agent installer on each monitored node except the PEM server node.
2. Invoke the PEM server installer; this installer will upgrade both the PEM server and the PEM agent that resides on the PEM server node.For detailed information about upgrading from a previous version, see the PEM Upgrade and Migration Guide.
1. Delete the existing SQL Profiler query set on each node by invoking the uninstall-sql-profiler.sql script.Where x specifies the installed Postgres version.
1. Delete the existing SQL Profiler query set on each node by invoking the uninstall-sql-profiler.sql script.Where x specifies the installed Postgres version.To correct this error, you must replace the existing query set with a new query set. First, uninstall SQL Profiler by invoking the uninstall-sql-profiler.sql script, and then reinstall SQL Profiler by invoking the sql-profiler.sql script.
Where component_name is the name of the component that you wish to remove.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.