From 585f6f15394e7b82051c6956e9d106591c10b186 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Tue, 27 Mar 2018 04:31:43 +0200 Subject: [PATCH] various plugins: fixed small style issues --- plugins/ntp/ntp_packets | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/ntp/ntp_packets b/plugins/ntp/ntp_packets index 987ed1fd..1fb19b05 100755 --- a/plugins/ntp/ntp_packets +++ b/plugins/ntp/ntp_packets @@ -34,7 +34,8 @@ import sys if len(sys.argv) == 2 and sys.argv[1] == 'config': print('graph_title NTP traffic') print('graph_vlabel Packets/${graph_period} received(-)/sent(+)') - print('graph_info This graph shows the packet rates of this ntpd. Bad means packets received with bad length or format. Authfailed means packets for which authentication failed.') + print('graph_info This graph shows the packet rates of this ntpd. Bad means packets received ' + 'with bad length or format. Authfailed means packets for which authentication failed.') print('graph_category time') print('received.label Received') print('received.type DERIVE') @@ -72,7 +73,8 @@ os.environ['PATH'] = '/usr/local/sbin:/usr/local/bin:' + os.environ['PATH'] # Assuming that the ntpd version is the same as the ntpq or ntpdc # version. This is how a proper install should be. -version = subprocess.check_output(['ntpq', '-c', 'version'], universal_newlines=True).split()[1][0:5].replace('.', '') +version = subprocess.check_output(['ntpq', '-c', 'version'], + universal_newlines=True).split()[1][0:5].replace('.', '') if int(version) >= 427: cmd = 'ntpq' @@ -81,9 +83,11 @@ else: stats = dict() -stats_output = subprocess.check_output([cmd, '-c', 'iostats', '-c', 'sysstats'], universal_newlines=True).splitlines() +stats_output = subprocess.check_output([cmd, '-c', 'iostats', '-c', 'sysstats'], + universal_newlines=True).splitlines() -for line in stats_output: stats[line.split(':')[0]] = int(line.split(':')[1]) +for line in stats_output: + stats[line.split(':')[0]] = int(line.split(':')[1]) print('received.value ' + str(stats['received packets'])) print('sent.value ' + str(stats['packets sent']))