1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

added lxd disk plugin

the lxd deamon provides a REST interface which can be queried by pylxd
to get container related information. It graphs the disk usage of all
disks in all containers.

This plugin depends on python3 pylxd
This commit is contained in:
Felix Engelmann 2016-08-03 12:50:28 +02:00
parent ca71d12f29
commit 46983fdc99

26
plugins/lxd/lxd_disk Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/python3
import sys
from pylxd import api
c=api.API()
if len(sys.argv) == 2:
if sys.argv[1]=="autoconf":
print("yes")
sys.exit(0)
elif sys.argv[1]=="config":
print("graph_title LXD container disk usage")
print("graph_args --base 1000 --lower-limit 0")
print("graph_vlabel Bytes")
print("graph_category lxd")
print("graph_info This shows the disk usage of storage in containers. Make sure to install pylxd in python3.")
for name in c.container_list():
for disk in c.container_info(name)['disk']:
print(name+"-"+disk+".label "+name)
print(name+"-"+disk+".draw LINE2")
sys.exit(0)
for name in c.container_list():
for disk in c.container_info(name)['disk']:
print(name+"-"+disk+".value "+str(c.container_info(name)['disk'][disk]['usage']))