1
0
Fork 0
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:
dipohl 2017-02-24 05:01:30 +01:00
parent 349edaf819
commit 6ffdebec0d
17 changed files with 9 additions and 9 deletions

View file

@ -36,7 +36,7 @@ if [ "$1" = "config" ]; then
echo 'graph_title Auth Log Parser'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Daily Auth Counters'
echo 'graph_category system'
echo 'graph_category auth'
echo 'illegal_user.label Illegal User'
echo 'possible_breakin.label Breakin Attempt'
echo 'authentication_failure.label Authentication Fail'

View file

@ -29,7 +29,7 @@ if [ "$1" = "config" ]; then
echo 'graph_title Hosts denied by BlockHosts'
echo 'graph_args -l 0'
echo 'graph_vlabel denied hosts '
echo 'graph_category system'
echo 'graph_category security'
echo 'HostsDenied.label Hosts denied by BlockHosts'
echo 'HostsWatched.label Hosts watched by BlockHosts'
exit 0

View file

@ -1,101 +0,0 @@
#!/usr/bin/perl -w
# -*- perl -*-
=head1 NAME
dar_cpuusage - Munin plugin to monitor darwin cpu usage.
=head1 APPLICABLE SYSTEMS
Should work on any darwin (Mac OS X) system with the 'top' command.
=head1 CONFIGURATION
None needed
=head1 INTERPRETATION
The plugin runs the top command and shows the CPU usage for the machine.
=head1 BUGS
The stats are a snapshot at the time of the command - a 5 minute average would
be better.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v.0.0.1
=head1 AUTHOR
Copyright (C) 2010.
Original version by J.T.Sage (at) gmail (dot) com.
=head1 LICENSE
GPLv2
=cut
use Munin::Plugin;
if ( defined($ARGV[0])) {
if ($ARGV[0] eq 'autoconf') {
$uname = `uname`;
if ( not ( $uname =~ /Darwin/ ) ) { print "no (not a Darwin System)\n"; }
else {
if ( not -x "/usr/bin/top" ) { print "no (top not found)\n"; }
else {
print "yes\n";
}
}
exit 0;
}
if ( $ARGV[0] eq "config" ) {
print "graph_title CPU usage\n";
print "graph_args --base 1000 -r --lower-limit 0 --upper-limit 100\n";
print "graph_vlabel %\n";
print "graph_scale no\n";
print "graph_category system\n";
print "sys.label system\n";
print "sys.type GAUGE\n";
print "sys.min 0\nsys.draw AREA\n";
print "user.label user\n";
print "user.type GAUGE\n";
print "user.min 0\nuser.draw STACK\n";
print "idle.label idle\n";
print "idle.type GAUGE\n";
print "idle.min 0\nidle.draw STACK\n";
exit 0;
}
}
@top = `top -l1 -n0 -u`;
$quit = 0;
for ( $i = 1; ($i < $#top and $quit == 0); $i++ ) {
if ( $top[$i] =~ /^CPU/ ) {
$usr = $sys = $idl = $top[$i];
$usr =~ s/^.+?: (\d+\.\d+)\% user.+$/$1/;
chomp($usr);
$sys =~ s/^.+?, (\d+\.\d+)\% sys.+$/$1/;
chomp($sys);
$idl =~ s/^.+?, (\d+\.\d+)\% idle.+$/$1/;
chomp($idl);
print "sys.value " . $sys . "\n";
print "user.value " . $usr . "\n";
print "idle.value " . $idl . "\n";
$quit = 1;
}
}
# vim:syntax=perl

View file

@ -1,104 +0,0 @@
#!/usr/bin/perl -w
# -*- perl -*-
=head1 NAME
dar_mumusage - Munin plugin to monitor darwin physical memory usage.
=head1 APPLICABLE SYSTEMS
Should work on any darwin (Mac OS X) system with the 'top' command.
=head1 CONFIGURATION
None needed
=head1 INTERPRETATION
The plugin runs the top command and shows the physical memory for the machine.
=head1 BUGS
The stats are a snapshot at the time of the command - a 5 minute average would
be better.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v.0.0.1
=head1 AUTHOR
Copyright (C) 2010.
Original version by J.T.Sage (at) gmail (dot) com.
=head1 LICENSE
GPLv2
=cut
use Munin::Plugin;
if ( defined($ARGV[0])) {
if ($ARGV[0] eq 'autoconf') {
$uname = `uname`;
if ( not ( $uname =~ /Darwin/ ) ) { print "no (not a Darwin System)\n"; }
else {
if ( not -x "/usr/bin/top" ) { print "no (top not found)\n"; }
else {
print "yes\n";
}
}
exit 0;
}
if ( $ARGV[0] eq "config" ) {
$maxmemcmd = `hostinfo | grep memory`;
$maxmemcmd =~ m/^.+?: (\d+\.\d+) (\w).+$/;
$memline = $1;
if ( $2 eq "m" ) { $memline = $memline * 1024 * 1024; }
if ( $2 eq "g" ) { $memline = $memline * 1024 * 1024 * 1024; }
print "graph_title Memory usage\n";
print "graph_args --base 1024 --lower-limit 0 --upper-limit ".$memline." --rigid\n";
print "graph_vlabel Bytes\n";
print "graph_scale yes\n";
print "graph_category system\n";
print "wired.label wired\nwired.type GAUGE\nwired.draw AREA\n";
print "active.label active\nactive.type GAUGE\nactive.draw STACK\n";
print "inactive.label inactive\ninactive.type GAUGE\ninactive.draw STACK\n";
print "free.label free\nfree.type GAUGE\nfree.draw STACK\n";
print "used.label used\nused.type GAUGE\nused.draw LINE2\n";
exit 0;
}
}
@top = `top -l1 -n0 -u`;
$quit = 0;
for ( $i = 1; ($i < $#top and $quit == 0); $i++ ) {
if ( $top[$i] =~ /^PhysMem/ ) {
$wired = $active = $inactive = $free = $used = $top[$i];
$wired =~ s/^.+?: (\d+)M wired.+$/$1/; chomp $wired; $wired = $wired * 1024 * 1024;
$active =~ s/^.+?, (\d+)M active.+$/$1/; chomp $active; $active = $active * 1024 * 1024;
$inactive =~ s/^.+?, (\d+)M inactive.+$/$1/; chomp $inactive; $inactive = $inactive * 1024 * 1024;
$free =~ s/^.+?, (\d+)([M|K]) free.+$/$1/; chomp $free; $free = $free * 1024 * 1024; if ( $2 eq "K" ) { $free = $free / 1024; }
$used =~ s/^.+?, (\d+)([M|G]) used.+$/$1/; chomp $used; $used = $used * 1024 * 1024; if ( $2 eq "G" ) { $used = $used * 1024; }
print "wired.value " . $wired . "\n";
print "active.value " . $active . "\n";
print "inactive.value " . $inactive . "\n";
print "free.value " . $free . "\n";
print "used.value " . $used . "\n";
$quit = 1;
}
}
# vim:syntax=perl

View file

@ -1,97 +0,0 @@
#!/usr/bin/perl -w
# -*- perl -*-
=head1 NAME
dar_swap - Munin plugin to monitor darwin swap in/out.
=head1 APPLICABLE SYSTEMS
Should work on any darwin (Mac OS X) system with the 'vm_stat' command.
=head1 CONFIGURATION
None needed
=head1 INTERPRETATION
The plugin runs the vm_stat command a shows the number of pages swapped
in/out per second.
=head1 BUGS
None right now.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v.0.0.1
=head1 AUTHOR
Copyright (C) 2010.
Original version by J.T.Sage (at) gmail (dot) com.
=head1 LICENSE
GPLv2
=cut
use Munin::Plugin;
if ( defined($ARGV[0])) {
if ($ARGV[0] eq 'autoconf') {
$uname = `uname`;
if ( not ( $uname =~ /Darwin/ ) ) { print "no (not a Darwin System)\n"; }
else {
if ( not -x "/usr/bin/vm_stat" ) { print "no (vm_stat not found)\n"; }
else {
print "yes\n";
}
}
exit 0;
}
if ( $ARGV[0] eq "config" ) {
print "graph_title Swap in/out\n";
print "graph_args -l 0 --base 1000\n";
print "graph_vlabel pages per \${graph_period} in (-) / out (+)\n";
print "graph_category system\n";
print "swap_in.label swap\nswap_in.type DERIVE\nswap_in.max 100000\nswap_in.min 0\nswap_in.graph no\n";
print "swap_out.label swap\nswap_out.type DERIVE\nswap_out.max 100000\nswap_out.min 0\nswap_out.negative swap_in\n";
exit 0;
}
}
@vmstat = `vm_stat`;
for ( $i = 1; $i < $#vmstat; $i++ ) {
$line = $vmstat[$i];
$label = $line;
$label =~ s/"//g;
$label =~ s/(\w+)\:.+$/$1/;
$label =~ s/\n//g;
$name = $label;
$name =~ tr/A-Z/a-z/;
$name =~ s/[^A-Za-z0-9_]/_/g;
$data = $line;
$data =~ s/.+?(\d+)\./$1/;
$data =~ s/\n//g;
$data = int(($data / 1000) + .5);
if ( $name eq "pageins" ) {
print "swap_in.value " . $data . "\n";
}
if ( $name eq "pageouts" ) {
print "swap_out.value " . $data . "\n";
}
}
# vim:syntax=perl

View file

@ -1,96 +0,0 @@
#!/usr/bin/perl
# -*- perl -*-
=head1 NAME
dar_uptime - Munin plugin to monitor darwin system uptime.
=head1 APPLICABLE SYSTEMS
Should work on any darwin (Mac OS X) system with the 'uptime' command.
=head1 CONFIGURATION
None needed
=head1 INTERPRETATION
The plugin runs the uptime command, and parses the value into days.
=head1 BUGS
Limited test data set, probably fails some of the time - very likely
on systems with a very low uptime.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v.0.0.1
=head1 AUTHOR
Copyright (C) 2010.
Original version by J.T.Sage (at) gmail (dot) com.
=head1 LICENSE
GPLv2
=cut
use Munin::Plugin;
if ( defined($ARGV[0])) {
if ($ARGV[0] eq 'autoconf') {
$uname = `uname`;
if ( not ( $uname =~ /Darwin/ ) ) { print "no (not a Darwin System)\n"; }
else {
if ( not -x "/usr/bin/uptime" ) { print "no (uptime not found)\n"; }
else {
print "yes\n";
}
}
exit 0;
}
if ( $ARGV[0] eq "config" ) {
print "graph_title Uptime\n";
print "graph_args --base 1000 -l 0 \n";
print "graph_vlabel uptime in days\n";
print "graph_category system\n";
print "uptime.label uptime\n";
print "uptime.draw AREA\n";
exit 0;
}
}
@uptime = `/usr/bin/uptime`;
foreach(@uptime) {
$_ =~ m/^.+up (.+?), \d+ us.+$/;
$timestr = $1;
if ( $timestr =~ m/^(\d+) day.+?$/ ) {
$days = $1;
} else { $days = 0; }
if ( $timestr =~ m/(\d+) h/ ) {
$hrs = $1;
} else { $hrs = 0; }
if ( $timestr =~ m/(\d+)\:(\d+)/ ) {
$hours = $1; $min = $2;
} else { $hours = 0; $min = 0; }
if ( $timestr =~ m/(\d+) m/ ) {
$mint = $1;
} else {
$mint = 0;
}
$total = ( $days * 24 * 60 * 60 ) + ( ( $hrs + $hours ) * 60 * 60 ) + ( ( $min + $mint ) * 60 );
$daysf = $total / ( 24 * 60 * 60 );
$daysi = ( int( $daysf * 1000 ) / 1000 );
print "uptime.value " . $daysi . "\n";
}
# vim:syntax=perl

View file

@ -1,110 +0,0 @@
#!/usr/bin/perl -w
# -*- perl -*-
=head1 NAME
dar_vmstat - Munin plugin to monitor darwin virtual memory usage.
=head1 APPLICABLE SYSTEMS
Should work on any darwin (Mac OS X) system with the 'vm_stat' command.
=head1 CONFIGURATION
None needed
=head1 INTERPRETATION
The plugin runs the vm_stat command a shows the results. Consult the
vm_stat man page for more information on the output.
=head1 BUGS
None right now.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v.0.0.1
=head1 AUTHOR
Copyright (C) 2010.
Original version by J.T.Sage (at) gmail (dot) com.
=head1 LICENSE
GPLv2
=cut
use Munin::Plugin;
if ( defined($ARGV[0])) {
if ($ARGV[0] eq 'autoconf') {
$uname = `uname`;
if ( not ( $uname =~ /Darwin/ ) ) { print "no (not a Darwin System)\n"; }
else {
if ( not -x "/usr/bin/vm_stat" ) { print "no (vm_stat not found)\n"; }
else {
print "yes\n";
}
}
exit 0;
}
if ( $ARGV[0] eq "config" ) {
print "graph_title Virtual Memory Statiscs\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel bytes\n";
print "graph_scale yes\n";
print "graph_category system\n";
@vmstat = `vm_stat`;
for ( $i = 1; $i < $#vmstat; $i++ ) {
$line = $vmstat[$i];
$label = $line;
$label =~ s/"//g;
$label =~ s/(\w+)\:.+$/$1/;
$label =~ s/\n//g;
$name = $label;
$name =~ tr/A-Z/a-z/;
$name =~ s/[^A-Za-z0-9_]/_/g;
if ( $name eq "pages_free" || $name eq "pages_active" || $name eq "pages_inactive" || $name eq "pages_speculative" || $name eq "pages_wired_down" ) {
$label =~ s/Pages //;
print $name, ".label ", $label, "\n";
print $name, ".type GAUGE\n";
print $name, ".cdef ", $name, ",4096,*\n";
}
}
exit 0;
}
}
@vmstat = `vm_stat`;
for ( $i = 1; $i < $#vmstat; $i++ ) {
$line = $vmstat[$i];
$label = $line;
$label =~ s/"//g;
$label =~ s/(\w+)\:.+$/$1/;
$label =~ s/\n//g;
$name = $label;
$name =~ tr/A-Z/a-z/;
$name =~ s/[^A-Za-z0-9_]/_/g;
$data = $line;
$data =~ s/.+?(\d+)\./$1/;
$data =~ s/\n//g;
#$data = int(($data / 1000) + .5);
if ( $name eq "pages_free" || $name eq "pages_active" || $name eq "pages_inactive" || $name eq "pages_speculative" || $name eq "pages_wired_down" ) {
print $name, ".value ", $data, "\n";
}
}
# vim:syntax=perl

View file

@ -188,7 +188,7 @@ sub config # print config message and exit.
print "graph_args --base 1024 -l 0 --upper-limit " . $h_ramvalue{"Total.value"}. "--rigid" . "\n";
print "graph_vlabel Bytes\n";
print "graph_title RAM usage\n";
print "graph_category system\n";
print "graph_category memory\n";
print "graph_info This graph shows what the machine uses RAM for.\n";
print "graph_order ";

View file

@ -39,7 +39,7 @@ elif len(sys.argv) == 2 and sys.argv[1] == "config":
print 'graph_title Temperatuur in de serverruimte'
print 'graph_vlabel temperature in C'
print 'graph_category System'
print 'graph_category sensors'
print 'temperature.label temperature'
print 'graph_info Dit is de temperatuur in het rek in de serverruimte B104'
print 'graph_scale no'
@ -50,4 +50,4 @@ else:
print 'temperature.value %s' % gettemperature()