Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSL parameter for PostgreSQL checks #391

Merged
merged 2 commits into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions manifests/integrations/postgres.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# The postgres port number
# $username
# The username for the datadog user
# $ssl
# Boolean to enable SSL
# $use_psycopg2
# Boolean to flag connecting to postgres with psycopg2 instead of pg8000.
# Warning, psycopg2 doesn't support ssl mode.
Expand All @@ -36,6 +38,7 @@
# dbname => 'postgres'
# username => 'datadog',
# password => 'some_pass',
# ssl => false,
# custom_metrics => {
# a_custom_query => {
# query => "select tag_column, %s from table",
Expand All @@ -57,6 +60,7 @@
$dbname = 'postgres',
$port = '5432',
$username = 'datadog',
$ssl = false,
$use_psycopg2 = false,
$tags = [],
$tables = [],
Expand All @@ -82,6 +86,7 @@
'dbname' => $dbname,
'port' => $port,
'username' => $username,
'ssl' => $ssl,
'use_psycopg2' => $use_psycopg2,
'tags' => $tags,
'tables' => $tables,
Expand Down
4 changes: 4 additions & 0 deletions templates/agent-conf.d/postgres.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ instances:
# username: my_username
# password: my_password
# dbname: db_name
# ssl: false
# use_psycopg2: false # Force using psycogp2 instead of pg8000 to connect. WARNING: psycopg2 doesn't support ssl mode.
# tags:
# - optional_tag1
Expand All @@ -17,6 +18,9 @@ instances:
username: <%= instance['username'] %>
password: <%= instance['password'] %>
dbname: <%= instance['dbname'] %>
<% if instance['ssl'] == true -%>
ssl: true
<% end -%>
<% if instance['use_psycopg2'] == true -%>
use_psycopg2: true
<% end -%>
Expand Down