mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin-Gallery: Better 2nd level headings
This commit is contained in:
parent
6ffdebec0d
commit
f769371079
22 changed files with 0 additions and 0 deletions
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ "$1" = "config" ]; then
|
||||
echo "graph_title Memory usage (in MB)"
|
||||
echo 'graph_category system'
|
||||
echo "acti.label Active"
|
||||
echo "used.label Used"
|
||||
echo "total.label Total"
|
||||
echo "free.label Free"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Memory: Real: 14M/69M act/tot Free: 173M Swap: 0K/612M used/tot
|
||||
|
||||
top -un | nawk '
|
||||
function scale(v) {
|
||||
if (v ~ /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/ {
|
||||
acti = scale(spliter($3,1));
|
||||
used = scale(spliter($3,2));
|
||||
free = scale($6);
|
||||
total = used + free;
|
||||
|
||||
print "acti.value", acti
|
||||
print "used.value", used
|
||||
print "total.value", total
|
||||
print "free.value", free
|
||||
}'
|
|
@ -1,33 +0,0 @@
|
|||
#!/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
|
||||
}'
|
|
@ -1,118 +0,0 @@
|
|||
#! /bin/ksh
|
||||
# Copyright (c) 2010, Wikimedia Deutschland
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Wikimedia Deutschland nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY WIKIMEDIA DEUTSCHLAND ''AS IS'' AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL WIKIMEDIA DEUTSCHLAND BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# NOTE: This software is not released as a product. It was written primarily for
|
||||
# Wikimedia Deutschland's own use, and is made public as is, in the hope it may
|
||||
# be useful. Wikimedia Deutschland may at any time discontinue developing or
|
||||
# supporting this software. There is no guarantee any new versions or even fixes
|
||||
# for security issues will be released.
|
||||
###
|
||||
# Munin plugin to report Solaris memory usage via mdb's memstat.
|
||||
# Must be run as root.
|
||||
#
|
||||
# river@tamara.tcx.org.uk 2010-08-28
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -e /usr/bin/mdb ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo /usr/bin/mdb not found
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo '
|
||||
graph_args --base 1024 -l 0 --vertical-label Bytes
|
||||
graph_title Memory usage
|
||||
graph_category system
|
||||
graph_info This graph shows system memory use.
|
||||
graph_order kernel anon exec cacheused zfs cachefree free
|
||||
|
||||
kernel.label kernel
|
||||
kernel.draw AREA
|
||||
kernel.info Memory used by kernel
|
||||
|
||||
anon.label anon
|
||||
anon.draw STACK
|
||||
anon.info Memory used by programs
|
||||
|
||||
exec.label exec_and_libs
|
||||
exec.draw STACK
|
||||
exec.info Memory used by executable files and libraries
|
||||
|
||||
cacheused.label cacheused
|
||||
cacheused.draw STACK
|
||||
cacheused.info Memory used by page cache
|
||||
|
||||
zfs.label zfs
|
||||
zfs.draw STACK
|
||||
zfs.info Memory used for ZFS file cache
|
||||
|
||||
cachefree.label cachefree
|
||||
cachefree.draw STACK
|
||||
cachefree.info Free memory in cache list
|
||||
|
||||
free.label free
|
||||
free.draw STACK
|
||||
free.info Free memory
|
||||
'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "::memstat" | mdb -k | nawk '
|
||||
BEGIN {
|
||||
pagesize='$(getconf PAGESIZE)'
|
||||
kernel=0
|
||||
zfs=0
|
||||
anon=0
|
||||
exec=0
|
||||
cache=0
|
||||
phys=0
|
||||
}
|
||||
|
||||
/^Kernel/ { kernel=$2 }
|
||||
/^ZFS File Data/ { zfs=$4 }
|
||||
/^Anon/ { anon=$2 }
|
||||
/^Exec and libs/ { exec=$4 }
|
||||
/^Page cache/ { cacheused=$3 }
|
||||
/^Free \(cachelist\)/ { cachefree=$3 }
|
||||
/^Free \(freelist\)/ { free=$3 }
|
||||
|
||||
END {
|
||||
print "kernel.value " (kernel * pagesize)
|
||||
print "zfs.value " (zfs * pagesize)
|
||||
print "anon.value " (anon * pagesize)
|
||||
print "exec.value " (exec * pagesize)
|
||||
print "cacheused.value " (cacheused * pagesize)
|
||||
print "cachefree.value " (cachefree * pagesize)
|
||||
print "free.value " (free * pagesize)
|
||||
}
|
||||
'
|
|
@ -1,63 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
# -*- perl -*-
|
||||
# Plugin to monitor the system uptime
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my %IN;
|
||||
|
||||
my $sysctl = defined($ENV{sysctl}) ? $ENV{sysctl} : '/sbin/sysctl';
|
||||
my $ostype = `uname -s`;
|
||||
chomp ($ostype);
|
||||
|
||||
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) {
|
||||
if ( -x $sysctl ) {
|
||||
print "yes\n";
|
||||
} else {
|
||||
print "no (sysctl binary not found)\n";
|
||||
};
|
||||
exit;
|
||||
};
|
||||
|
||||
if (defined($ARGV[0]) and ($ARGV[0] eq 'config')) {
|
||||
print <<EOT ;
|
||||
graph_title Uptime
|
||||
graph_args --base 1000 -l 0
|
||||
graph_vlabel days
|
||||
graph_category system
|
||||
compile.label Kernel age
|
||||
compile.type GAUGE
|
||||
compile.min 0
|
||||
compile.max 1000
|
||||
compile.draw AREA
|
||||
uptime.label Uptime
|
||||
uptime.type GAUGE
|
||||
uptime.min 0
|
||||
uptime.max 1000
|
||||
uptime.draw AREA
|
||||
EOT
|
||||
exit;
|
||||
}
|
||||
|
||||
use Date::Parse;
|
||||
|
||||
my $kern=`sysctl -n kern.version`;
|
||||
$kern=~ /:\s+(.*\S)\s+\w+\@/;
|
||||
#print "Compile: $1\n";
|
||||
$kern=str2time($1);
|
||||
|
||||
my $boot=`sysctl -n kern.boottime`; # OpenBSD will return seconds from the epoch
|
||||
if ($ostype ne "OpenBSD") {
|
||||
$boot=~ / sec = (\d+)/;
|
||||
#print "Boot: $1\n";
|
||||
$boot=$1;
|
||||
}
|
||||
|
||||
my $now=time;
|
||||
|
||||
print "compile.value ",($now-$kern)/60/60/24,"\n";
|
||||
print "uptime.value ",($now-$boot)/60/60/24,"\n";
|
Loading…
Add table
Add a link
Reference in a new issue