]> arthur.barton.de Git - netdata.git/commitdiff
postgres plugin: better error handling on plugin start
authorIlya <ilyamaschenko@gmail.com>
Thu, 2 Feb 2017 04:21:03 +0000 (13:21 +0900)
committerIlya <ilyamaschenko@gmail.com>
Thu, 2 Feb 2017 04:21:03 +0000 (13:21 +0900)
python.d/postgres.chart.py

index 4087e8c4da5762ce9c6a08b452ff593b7eff6944..eb3224bf0b3da471664c583e83052858ec7e1283 100644 (file)
@@ -218,7 +218,9 @@ class Service(SimpleService):
 
     def check(self):
         try:
-            self._connect()
+            if not self._connect():
+                self.error('Can\'t connect to %s' % str(self.configuration))
+                return False
             cursor = self.connection.cursor()
             self._discover_databases(cursor)
             self._check_if_superuser(cursor)