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

added lxd memory plugin

the lxd deamon provides a REST interface which can be queried by pylxd
to get container related information. It stacks all containers, so the
total memory footprint of lxd is visible.

This plugin depends on python3 pylxd
This commit is contained in:
Felix Engelmann 2016-08-03 12:49:53 +02:00
parent b0d1f5b595
commit ca71d12f29

24
plugins/lxd/lxd_mem Executable file
View file

@ -0,0 +1,24 @@
#!/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 memory")
print("graph_args --base 1024 --lower-limit 0")
print("graph_vlabel Bytes")
print("graph_category lxd")
print("graph_info This shows the memory usage of each container. Make sure to install pylxd in python3.")
for name in c.container_list():
print(name+".label "+name)
print(name+".draw AREASTACK")
sys.exit(0)
for name in c.container_list():
print(name+".value "+str(c.container_info(name)['memory']['usage']))