Plugins sind zu munin/contrib verschoben wurden

This commit is contained in:
Michael Grote 2021-12-12 14:50:49 +01:00
parent 8baa885bb1
commit 4948ce1544
4 changed files with 0 additions and 205 deletions

View File

@ -1,52 +0,0 @@
#!/bin/bash
#%# family=auto
#%# capabilities=autoconf
# Michael Grote
# michael.grote ät posteo.de
# Outputs various metrics about same page merging.
# Variablen
ksm_dir_run="/sys/kernel/mm/ksm/run"
function labels {
cat << EOF
graph_title kernel same page merging
graph_category system
graph_order pages_unshared pages_volatile pages_shared pages_sharing
pages_shared.info how many shared pages are being used
pages_sharing.info how many more sites are sharing them i.e. how much saved
pages_unshared.info how many pages unique but repeatedly checked for merging
pages_volatile.info how many pages changing too fast to be placed in a tree
pages_shared.label pages_shared
pages_sharing.label pages_sharing
pages_unshared.label pages_unshared
pages_volatile.label pages_volatile
pages_shared.draw AREASTACK
pages_sharing.draw AREASTACK
pages_unshared.draw AREASTACK
pages_volatile.draw AREASTACK
EOF
}
# prüfe ob ksm aktiviert ist
if [ ! -f "$ksm_dir_run" ]; then
exit 1
fi
# wenn parameter = ...
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
# setze label
labels
exit 0
fi
echo pages_shared.value $(cat "/sys/kernel/mm/ksm/pages_shared")
echo pages_sharing.value $(cat "/sys/kernel/mm/ksm/pages_sharing")
echo pages_unshared.value $(cat "/sys/kernel/mm/ksm/pages_unshared")
echo pages_volatile.value $(cat "/sys/kernel/mm/ksm/pages_volatile")

View File

@ -1,63 +0,0 @@
#!/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
# Pfade zu binaries
wqm=$(command -v qm)
wpct=$(command -v pct)
# Berechne VMs
total_vm=$($wqm list | sed 1d | wc -l)
running_vm=$($wqm list | sed 1d | grep -c running )
stopped_vm=$($wqm list | sed 1d | grep -c stopped )
# Berechne LXCs
total_lxc=$($wpct list | sed 1d | wc -l)
running_lxc=$($wpct list | sed 1d | grep -c running )
stopped_lxc=$($wpct list | sed 1d | grep -c stopped )
# Berechne Gesamtwert
total=$((total_vm + total_lxc))
# wenn parameter = ...
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
# setze label
echo total_vm.label total Virtual Machines
echo total.label total VMs and LXCs
echo running_vm.label running Virtual Machines
echo running_lxc.label running LXCs
echo stopped_vm.label stopped Virtual Machines
echo stopped_lxc.label stopped LXCs
echo total_lxc.label total LXCs
# setze optionen
echo 'graph_title ProxMox - Number of VMs and LXCs'
echo 'graph_vlabel Count'
echo 'graph_category virtualization'
echo 'graph_args -l 0'
exit 0
fi
echo total.value "$total"
echo total_vm.value "$total_vm"
echo total_lxc.value "$total_lxc"
echo running_vm.value "$running_vm"
echo running_lxc.value "$running_lxc"
echo stopped_vm.value "$stopped_vm"
echo stopped_lxc.value "$stopped_lxc"
exit 0

View File

@ -1,45 +0,0 @@
#!/bin/bash
#%# family=auto
#%# capabilities=autoconf
# Michael Grote
# michael.grote ät posteo.de
# Outputs the count of zfs pools, datasets and snapshots.
# lese alle pools, sed löscht die erste zeile
list_pools=$(zpool list | sed 1d)
# wenn parameter = ...
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
# https://superuser.com/questions/284187/bash-iterating-over-lines-in-a-variable
while read -r line; do
# setze label <pool>.label <pool> snapshots
echo "$line" | awk '{print $1"_snapshot.label " $1 " snapshots"}'
echo "$line" | awk '{print $1"_dataset.label " $1 " datasets"}'
done <<< "$list_pools"
echo 'pools.label pools'
# setze optionen
echo 'graph_title zfs - pool, dataset and snapshot count' # Titelzeile
echo 'graph_vlabel count' # Text links, hochkant
echo 'graph_category fs' # Kategorie
echo 'graph_args -l 0' # wertebegrenzer 0-100
exit 0
fi
# lese jede Zeile der Variable $list
# tue für jede Zeile
# "echo" die Zeile, wende awk drauf, Spalte $1/$7
while read -r line; do
echo pools.value "$(zpool list | sed 1d | wc -l)"
# setze poolnamen
poolname=$(echo "$line" | awk '{ print $1 }')
# zähle snapshots
echo "$poolname""_snapshot.value" "$(zfs list -r -t snapshot "$poolname" | sed 1d | wc -l)"
echo "$poolname""_dataset.value" "$(zfs list -r "$poolname" | sed 1d | wc -l)"
done <<< "$list_pools"
exit 0

View File

@ -1,45 +0,0 @@
#!/bin/bash
#%# family=auto
#%# capabilities=autoconf
# Michael Grote
# michael.grote ät posteo.de
# Outputs the zpool fragmentation per zfs pool.
# lese alle pools, sed löscht die erste zeile
# entferne das %-zeichen
list=$(zpool list | sed 1d | tr -d %)
# wenn parameter = ...
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
# https://superuser.com/questions/284187/bash-iterating-over-lines-in-a-variable
while read -r line; do
# setze label
echo "$line" | awk '{print $1".label " $1}'
# setze warn-limits
echo "$line" | awk '{print $1".warning " 50}'
echo "$line" | awk '{print $1".critical " 75}'
done <<< "$list"
# setze optionen
echo 'graph_title ZFS storage pool - fragmentation' # Titelzeile
echo 'graph_vlabel fragmentation in %' # Text links, hochkant
echo 'graph_category fs' # Kategorie
echo 'graph_info This graph shows the ZFS Pool fragmentation.' # Text über Tabelle/Infos
echo 'graph_args -l 0 --upper-limit 100' # wertebegrenzer 0-100
exit 0
fi
# lese jede Zeile der Variable $list
# tue für jede Zeile
# "echo" die Zeile, wende awk drauf, Spalte $1/$7
while read -r line; do
# gebe wert aus
# <name>.value <wert>
echo "$line" | awk '{print $1".value " $7}'
done <<< "$list"
exit 0