Postgres is the world’s most advanced database system, with a global community of thousands of users and contributors and dozens of companies and organizations.
postgres plugin is included with the AppOptics host agent by default, please follow the directions below to enable it for a host agent instance.
You’ll need to have a Postgres server accessible. Take note of the host address, username, database name, and password. This will be needed later in the configuration step.
Make sure a role is created for the Postgres user you add to the configuration file. If you don’t the logs will report that Postgres is “Unable to log in as <user>”. If Postgres is installed on a Ubuntu server you can connect to psql as user
postgres and create a role.
$ sudo su - postgres $ psql # CREATE ROLE username;
The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your Postgres installation. To enable the plugin:
- Make a copy of the postgres example configuration file
/opt/appoptics/etc/plugins.d/postgresql.yaml.example, renaming it to
$ sudo cp /opt/appoptics/etc/plugins.d/postgresql.yaml.example /opt/appoptics/etc/plugins.d/postgresql.yaml
- Update the
/opt/appoptics/etc/plugins.d/postgresql.yamlconfiguration file with settings specific to your Postgres install, for example:
#in /opt/appoptics/etc/plugins.d/postgresql.yaml: address: "host=localhost user=my_username sslmode=disable dbname=my_database password=my_password"
If running the database locally on a cloud instance you may need to replace
127.0.0.1. Verify the host adddress by running
$ sudo netstat -plunt |grep postgresin the console.
- Restart the agent after saving your configuration changes:
$ sudo service appoptics-snapteld restart
- Enable the Postgres plugin
Select the Postgres plugin to open the configuration menu in the UI, and enable the plugin.