From 6e4a0392a3df11fc4f78eb3d56ef4682a29bbce5 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Thu, 16 Sep 2021 14:30:47 +0200 Subject: [PATCH] docker wip --- docker_storage | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docker_storage diff --git a/docker_storage b/docker_storage new file mode 100644 index 0000000..1326bbd --- /dev/null +++ b/docker_storage @@ -0,0 +1,77 @@ +#!/bin/bash +#%# family=auto +#%# capabilities=autoconf + +# Michael Grote +# michael.grote ät posteo.de +# Outputs the running, stopped and total counts of ProxMox VMs and LXCs. +# needs to be run as user: root AND group: root +# [proxmox_count] +# user root +# group root + +# Include plugin.sh +# . $MUNIN_LIBDIR/plugins/plugin.sh + +# is_multigraph + +# Pfade zu binaries +wdocker=$(which docker) + +# werte +count_images=$($wdocker system df | sed 1d | grep -i images | awk '{print $2}') +count_container=$($wdocker system df | sed 1d | grep -i containers | awk '{print $2}') +count_active_container=$($wdocker system df | sed 1d | grep -i containers | awk '{print $3}') +count_volumes=$($wdocker system df | sed 1d | grep -i volumes | awk '{print $3}') # wg leerzeichen in zeile +size_images=$($wdocker system df | sed 1d | grep -i images | awk '{print $4}') +size_container=$($wdocker system df | sed 1d | grep -i containers | awk '{print $4}') +size_volumes=$($wdocker system df | sed 1d | grep -i volumes | awk '{print $4}') + + +# anzahl active containers + +# wenn parameter = ... +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + # setze label + + + + # setze optionen + echo 'multigraph docker_count' + echo 'graph_title docker count' + echo 'graph_vlabel Count' + echo 'graph_category virtualization' + echo 'graph_args -l 0' + echo count_images.label images + echo count_container.label container + echo count_active_container.label active containers + echo count_volumes.label volumes + + echo 'multigraph docker_size' + echo 'graph_title docker size' + echo 'graph_vlabel Size' + echo 'graph_category virtualization' + echo 'graph_args -l 0' + echo size_images.label size images + echo size_container.label size container + echo size_volumes.label size volumes + exit 0 +fi + +echo 'multigraph docker_count' +echo count_images.value $count_images +echo count_container.value $count_container +echo count_active_container.value $count_active_container +echo count_volumes.value $count_volumes + +echo 'multigraph docker_size' +echo size_images.value $size_images +echo size_container.value $size_container +echo size_volumes.value $size_volumes + +exit 0