From 25f4d1b9b110961c4f7b298c4406ef396fec8851 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 19 Sep 2023 20:50:41 +0200 Subject: [PATCH] Fix Netdata install with remote MySQL server --- wo/cli/plugins/stack_pref.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index ec1011f..c3d2d12 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1183,8 +1183,13 @@ def post_pref(self, apt_packages, packages, upgrade=False): self, "/etc/netdata/orig/health_alarm_notify.conf", 'SEND_EMAIL="YES"', 'SEND_EMAIL="NO"') + if self.app.config.has_section('mysql'): + wo_grant_host = self.app.config.get('mysql', 'grant-host') + else: + wo_grant_host = 'localhost' # check if mysql credentials are available - if WOShellExec.cmd_exec(self, "mysqladmin ping"): + if (WOShellExec.cmd_exec(self, "mysqladmin ping") + and wo_grant_host == 'localhost'): try: WOMysql.execute( self,