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
opensslcommand:CODEopenssl 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:
PYTHON
sudo keytool -import -noprompt -trustcacerts -alias AmazonRDS -file rds-combined-ca-bundle.der -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeitYou can verify that the certificate was added by running the following command:
CODEkeytool -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:
CODE
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 sslrootcertThe location of the downloaded PEM file sslmodeverify-full
- In the Custom JDBC Connection String field, enter the following JDBC string: