@cryptotaxi247 / netdata-1 / commits / d4fd6a3ec

Add peer charts only if `show_peers` is `True`

Sven Mäder committed Mar 12, 2018 at 23:57 UTC d4fd6a3ecd54fa4dff7eba2e464ed35b4f2b7cca
1 file changed +3 -1
python.d/ntpd.chart.py
+3 -1
@@ -225,7 +225,6 @@ class Service(SocketService):
225 SocketService.__init__(self, configuration=configuration, name=name)
226 self.order = list(ORDER)
227 self.definitions = dict(CHARTS)
228 - self.definitions.update(PEER_CHARTS)
228
229 self.port = 'ntp'
230 self.dgram_socket = True
@@ -236,6 +235,9 @@ class Service(SocketService):
235 self.show_peers = self.configuration.get('show_peers', False)
236 self.peer_rescan = self.configuration.get('peer_rescan', 60)
237
238 + if self.show_peers:
239 + self.definitions.update(PEER_CHARTS)
240 +
241 def check(self):
242 """
243 Checks if we can get valid systemvars.