mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Update ntp_packets
With Debian 10 the command "ntpq -c iostats -c sysstats" produces one empty line. The additional if condition tackles this. Traceback (most recent call last): File "/etc/munin/plugins/ntp_packets", line 91, in <module> stats[line.split(':')[0]] = int(line.split(':')[1]) IndexError: list index out of range
This commit is contained in:
parent
ee68a404b5
commit
d0139a588d
1 changed files with 2 additions and 1 deletions
|
@ -87,6 +87,7 @@ stats_output = subprocess.check_output([cmd, '-c', 'iostats', '-c', 'sysstats'],
|
|||
universal_newlines=True).splitlines()
|
||||
|
||||
for line in stats_output:
|
||||
if len(line.split(':')) == 2:
|
||||
stats[line.split(':')[0]] = int(line.split(':')[1])
|
||||
|
||||
print('received.value ' + str(stats['received packets']))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue