From 727a22f925ccc585555e59b4d6fc43a1ea1a0330 Mon Sep 17 00:00:00 2001 From: Michael Heinemann Date: Thu, 8 Jun 2017 12:26:37 +0200 Subject: [PATCH] test connection without needing admin rights (#7947) SHOW DIAGNOSTICS always needs admin privileges on influxdb. For the purposes of home-assistant this is too much. Use 'SHOW SERIES' to have a relatively lightweight query which only needs READ privileges. --- homeassistant/components/influxdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/influxdb.py b/homeassistant/components/influxdb.py index abd02554ac0..7ac3f4dcdce 100644 --- a/homeassistant/components/influxdb.py +++ b/homeassistant/components/influxdb.py @@ -96,7 +96,7 @@ def setup(hass, config): try: influx = InfluxDBClient(**kwargs) - influx.query("SHOW DIAGNOSTICS;", database=conf[CONF_DB_NAME]) + influx.query("SHOW SERIES LIMIT 1;", database=conf[CONF_DB_NAME]) except exceptions.InfluxDBClientError as exc: _LOGGER.error("Database host is not accessible due to '%s', please " "check your entries in the configuration file and that "