Skip to content
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
1 change: 1 addition & 0 deletions mysql/changelog.d/23607.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Log a warning when a 1045 access denied error occurs with no SSL configuration, hinting that SSL may be required by the MySQL instance.
12 changes: 12 additions & 0 deletions mysql/datadog_checks/mysql/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,18 @@ def _connect(self):
self.SERVICE_CHECK_NAME, AgentCheck.OK, tags=service_check_tags, hostname=self.reported_hostname
)
yield db
except pymysql.err.OperationalError as e:
self.service_check(
self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL, tags=service_check_tags, hostname=self.reported_hostname
)
if e.args[0] == 1045 and not self._config.ssl:
self.log.warning(
"Access denied error (1045) with no SSL configuration. If your MySQL instance requires SSL "
"connections, configure the 'ssl' option in the check configuration "
"(e.g. 'ssl.check_hostname: false' for connections without certificate verification). "
"See https://docs.datadoghq.com/database_monitoring/setup_mysql/ for more details."
)
raise
except Exception:
self.service_check(
self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL, tags=service_check_tags, hostname=self.reported_hostname
Expand Down
Loading