If you followed the first, second and the third post the current ppas infrastructure consists of a primary database, a hot standby database and a backup and recovery server.
Now we will add the monitoring server on another host so that the system overview looks like this:

server ip address purpose
ppas ppas database cluster
ppasstandby ppas hot standby database
ppasbart backup and recovery server
ppasem ppas enterprise manager

On the ppasem host we will now install postgres enterprise manager to monitor our postgres infrastructure. As with ppas you’ll need to install java before you start:

yum install java
And as with the installer for ppas there are several ways to get pem installed on the system:
[[email protected] tmp]# chmod u+x pem_server-5.0.0-2-linux-x64.run
[[email protected] tmp]# ./pem_server-5.0.0-2-linux-x64.run --help
Postgres Enterprise Manager Server 5.0.0-2

 --help                         Display the list of valid options

 --version                      Display product information

 --unattendedmodeui unattendedmodeui Unattended Mode UI
                                Default: minimal
                                Allowed: none minimal minimalWithDialogs

 --optionfile optionfile      Installation option file

 --debuglevel debuglevel      Debug information level of verbosity
                                Default: 2
                                Allowed: 0 1 2 3 4

We’ll go with the GUI mode for this demo. Basically it is just clicking next, next, next and everything should go fine. A lot of screenshots will follow:

[[email protected] tmp]# ./pem_server-5.0.0-2-linux-x64.run
 [[email protected] tmp]# systemctl list-unit-files | grep fire
 firewalld.service enabled
 [[email protected] tmp]# systemctl stop firewalld.service
 [[email protected] tmp]# systemctl disable firewalld.service
 rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
 rm '/etc/systemd/system/basic.target.wants/firewalld.service'
 [[email protected] tmp]#

alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt alt
Once pem is installed adjust the httpd.conf to match the server’s IP-Address:

[[email protected] tmp]# grep /opt/PostgreSQL/EnterpriseDB-ApachePHP/apache/conf/httpd.conf

Then do a restart:
service EnterpriseDBApachePhp restart
Now you should be able to check the http connection:
For interacting with the PEM there is the pem client. This client can be installed on any Linux or Windows host. I’ll do it on my linux box:
localhost:~/Downloads$ chmod u+x pem_client-5.0.0-2-linux-x64.run
localhost:~/Downloads$ ./pem_client-5.0.0-2-linux-x64.run
localhost:~/Downloads$ sudo ./pem_client-5.0.0-2-linux-x64.run

alt alt alt alt alt alt
A shortcut in your Windows Start-Menu or you Linux Desktop should be available from now on:
One the client is started you can connect to the PEM server:
altalt alt
If the connection can be established you see the dashboard:
As we want to have at least the primary database monitored we will need to install pem agent on the primary host. Before we start the pem agent installation we need to allow connection to the postgres database on the pem host. To do this I’ll add all my postgres hosts (primary,standby,bart) to the pg_hba.conf file on the pem server:

-bash-4.2$ tail -3 data/pg_hba.conf
host     all             postgres       md5
host     all             postgres       md5
host     all             postgres       md5

Remember to reload postgres for this changes to take effect:

-bash-4.2$ pg_ctl -D data/ reload
server signaled

Ready to install:

[[email protected] tmp]# ls
pem_agent-5.0.0-2-linux-x64.run  primary_base_backup
[[email protected] tmp]# chmod u+x pem_agent-5.0.0-2-linux-x64.run
[[email protected] tmp]# ./pem_agent-5.0.0-2-linux-x64.run 

alt alt alt alt alt alt alt alt
So now that the pem agent is installed on the primary database host we can add the database to pem. Remember to put the host from where you start the pem client into the pg_hba.conf file on the primary database server (otherwise you will not be able to connect):

-bash-4.2$ tail -1 data/pg_hba.conf
host    all             enterprisedb            md5

Start the pem client and just add the database and create the binding for the pem agent:
alt alt alt alt alt
Mission complete. Have fun with the Postgres Enterprise Manager. I might be a good idea to add the standby database, too. Btw.: There is a web client for PEM, too, but this requires a product key:

Thumbnail [60x60]
Daniel Westermann