mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Added check to ensure network stats for container exist before reading them
This commit is contained in:
parent
78aac0314b
commit
64d5d8af08
1 changed files with 4 additions and 3 deletions
|
@ -320,6 +320,7 @@ def print_containers_network(client):
|
||||||
for container, stats in parallel_container_stats(client):
|
for container, stats in parallel_container_stats(client):
|
||||||
tx_bytes = 0
|
tx_bytes = 0
|
||||||
rx_bytes = 0
|
rx_bytes = 0
|
||||||
|
if "networks" in stats:
|
||||||
for data in stats['networks'].values():
|
for data in stats['networks'].values():
|
||||||
tx_bytes += data['tx_bytes']
|
tx_bytes += data['tx_bytes']
|
||||||
rx_bytes += data['rx_bytes']
|
rx_bytes += data['rx_bytes']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue