In my company, we use PostgreSQL, Postgres Plus (a commercial fork of PostgreSQL provided by EnterpriseDB) beside Oracle databases. Unfortunately different databases need different tools to monitor, and implementing a standard monitoring procedure for all databases becomes a real problem. Good thing is Oracle Enterprise Manager is an extendable software supporting 3rd party plugins, and there are companies like Blue Medora which focuses on the product enhancements for Enterprise Manager. Blue Medora released a plugin to monitor PostgreSQL for Oracle Enterprise Manager, and I just deployed it to our servers. In this blog post, I’ll try to give brief instructions to set up the plugin.
First you need to download the plugin from Blue Medora website. I do not know when it will be added to self-update of Enterprise Manager but for now, you need to downloaded it manually. After you download the zip file, copy the zip file to your Enterprise Manager 12c server, and unzip it. I unzip it to a folder called postgre_plugin (under home directory of oracle user):
unzip bm.em.xpgs_188.8.131.52.0_1.0.6.zip -d postgre_plugin
The zip contains a file named “bm.em.xpgs_184.108.40.206.0_1.0.6.opar”. It’s the plugin file which we’ll need to import to Enterprise Manager. We’ll use “emcli” to login to Enterprise Manager, and then import the plugin:
bin/emcli login -username=SYSMAN
bin/emcli import_update -omslocal \
I divided the last command to two lines, using \ symbol, so it fits into the code-window on my website but you may write it one line (without \ symbol).
After you import the plugin, you’ll see it on the setup > extensibility > plugins page. First we need to deploy the plugin to our OMS server.
Select the plugin and click deploy on management servers.
Enterprise Manager will do some prerequisite checks. Click next or continue buttons on the screens until you reach the deployment page. Do not forget:
- OMS will be out of service while you are deploying a plugin to OMS server. You may check the deployment process by using emcli.
- It’s highly recommended to backup your EM repository and software before deploying a plugin to OMS server.
If you’re ready (have backups), click “deploy” button to start deployment. It takes only a few minutes on my system but it may change depending on your hardware.
So we deployed the plugin to our OMS, now it’s time to deploy the plugin to an agent. I have already installed my agents to the servers hosting PostgreSQL. You do not need to deploy agent for each PostgreSQL Server. The PostgreSQL Plugin can remotely monitor databases, but I recommend you to monitor locally unless you have resource problems on the PostgreSQL database servers. In case you need to know how to deploy EM12c agents to host, you can read my previous blog posts.
Select the plugin and click deploy on management agent, click continue to move to the screen you select the target agent/host which you’ll deploy the plugin.
Select the agent and click continue. EM will do some prerequisite check, click continue to deploy page, click deploy (it will not restart the agent, so it can be deployed anytime).
When the deployment is done, you can add a PostgreSQL target to your system.
Go to “”add targets manually” page, check “add targets declaratively by specifying target monitoring properties”. Select “postgresql database” as target type. Select the monitoring agent (the one we already deployed the plugin). Click “add manually”.
Enter the required fields, test connection, and click OK to add it.
You can reach the PostgreSQL databases by listing all targets, and click “PostgreSQL Database” in the databases section.
I have tested the plugin for only 2 days, but I can say that it’s a great addition to EM12c. The PostgreSQL plugin of Blue Medora helps you easily monitor PostgreSQL instance, examine tables, indexes, connections and queries.
You need to enable “pg_stat_statements” extension on PostgreSQL if you want to monitor queries.
The PostgreSQL plugin collects important metrics, so you can define thresholds and use Incident Management features of Enterprise Manager. I have also tried to use this plugin to monitor Postgres Plus databases and it seems it works without any problems. By the way, Blue Medora provides fully functional free edition!