1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 09:57:09 +00:00

Plugin-Gallery: Better 2nd level headings

This commit is contained in:
dipohl 2017-02-24 16:11:20 +01:00
parent 6ffdebec0d
commit f769371079
22 changed files with 0 additions and 0 deletions

33
plugins/bsd/openbsd-swap Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
# @author northox <northox@mantor.org>
# Mantor Organization
#
if [ "$1" = "config" ]; then
echo "graph_title Swap usage (in MB)"
echo 'graph_category system'
echo "swap.label Swap used"
echo "swapt.label Swap total"
exit 0
fi
# Memory: Real: 14M/69M act/tot Free: 173M Swap: 0K/612M used/tot
top -un | nawk '
function scale(v) {
if (value ~ /G$/) { sub("G", "", v); v *= 1024 }
else if (v ~ /M$/) sub("M", "", v)
else if (v ~ /K$/) { sub("K", "", v); v /= 1024 }
else v /= 1024 * 1024;
return v;
}
function spliter(v, i) {
split(v,a,"/");
return(a[i]);
}
/^Memory/ {
swap = scale(spliter($8,1));
swapt = scale(spliter($8,2));
print "swap.value", swap
print "swapt.value", swapt
}'