Monitor SSL-enabled PostgreSQL on Amazon RDS
-
Create the .postgresql directory under the system home folder, then create a
file, root.crt in the directory
/home/<name>/.postgresql/root.crt
. - Download PEM file from Amazon and copy to a local directory.
-
Convert the PEM file to a DER file using the following
openssl
command:openssl x509 -outform der -in rds-combined-ca-bundle.pem -out rds-combined-ca-bundle.der
-
Add the certificate to the Java keystore using the following command:
sudo keytool -import -noprompt -trustcacerts -alias AmazonRDS -file rds-combined-ca-bundle.der -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit
You can verify that the certificate was added by running the following command:
keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit
- Re-start the dbagent process to register the certificate you added.
-
In the Controller, create a new collector for PostgreSQL.
-
In the Custom JDBC Connection String field,
enter the following JDBC string:
jdbc:postgresql://<RDS-Hostname>:<RDS-Port>/postgres?ssl=true
-
In the ADVANCED OPTIONS section, select
Connection Properties and then specify these
property details:
Property Name Property Value sslrootcert
The location of the downloaded PEM file sslmode
verify-full
-
In the Custom JDBC Connection String field,
enter the following JDBC string: