Révision 8b010aad
fixed lxc_disk with stopped containers
stopped containers have no disk space info and the plugin crashed. Now
it only shows disk usage for running containers
| plugins/lxd/lxd_disk | ||
|---|---|---|
| 38 | 38 |
print("graph_category lxd")
|
| 39 | 39 |
print("graph_info This shows the disk usage of storage in containers. Make sure to install pylxd in python3.")
|
| 40 | 40 |
for name in c.container_list(): |
| 41 |
for disk in c.container_info(name)['disk']: |
|
| 42 |
print(name+"-"+disk+".label "+name) |
|
| 43 |
print(name+"-"+disk+".draw LINE2") |
|
| 41 |
info = c.container_info(name) |
|
| 42 |
if info['disk']: |
|
| 43 |
for disk in info['disk']: |
|
| 44 |
print(name+"-"+disk+".label "+name) |
|
| 45 |
print(name+"-"+disk+".draw LINE2") |
|
| 44 | 46 |
sys.exit(0) |
| 45 | 47 |
|
| 46 | 48 |
for name in c.container_list(): |
| 47 |
for disk in c.container_info(name)['disk']: |
|
| 48 |
print(name+"-"+disk+".value "+str(c.container_info(name)['disk'][disk]['usage'])) |
|
| 49 |
info = c.container_info(name) |
|
| 50 |
if info['disk']: |
|
| 51 |
for disk in info['disk']: |
|
| 52 |
print(name+"-"+disk+".value "+str(info['disk'][disk]['usage'])) |
|
Formats disponibles : Unified diff