mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
remove plugins existing in the main munin distribution
This commit is contained in:
parent
b084f05b70
commit
62d43835d4
19 changed files with 0 additions and 3254 deletions
|
@ -1,97 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Plugin to monitor physical cpu usage in an IBM POWER P5 / OpenPower LPAR
|
||||
#
|
||||
# Usage: Place in /etc/munin/plugins (or make a symlink to it there)
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config
|
||||
# autoconf
|
||||
#
|
||||
# This should be run as root, so drop a file with something like this in
|
||||
# /etc/munin/plugin-conf.d/lpar_cpu:
|
||||
# [lpar_cpu]
|
||||
# user root
|
||||
#
|
||||
# Great thanks to Nigel Griffith of IBM for the magic to get these values
|
||||
#
|
||||
# Author: Ingvar Hagelund <ingvar(at)linpro.no>
|
||||
#
|
||||
# Licence: GNU General Public Licence v2.0,
|
||||
# see http://www.gnu.org/copyleft/gpl.html
|
||||
|
||||
use strict;
|
||||
|
||||
my $stats="/proc/ppc64/lparcfg";
|
||||
my $cpuinfo="/proc/cpuinfo";
|
||||
my $seconds=2;
|
||||
my $counter="";
|
||||
my $after="";
|
||||
my $timebase="";
|
||||
|
||||
sub readstats {
|
||||
my $stats=shift;
|
||||
my $purr;
|
||||
|
||||
open (STATS,"$stats") or die "Unable to read $stats, $!";
|
||||
while (<STATS>) {
|
||||
if ( /^purr\=(\d+)$/ ) { $purr = $1; }
|
||||
}
|
||||
close STATS;
|
||||
return $purr;
|
||||
}
|
||||
|
||||
sub error {
|
||||
print "something horrible happened\n";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
|
||||
################
|
||||
#
|
||||
# Main
|
||||
#
|
||||
#
|
||||
|
||||
if ( defined $ARGV[0] ) {
|
||||
|
||||
if ( $ARGV[0] eq 'autoconf' ) {
|
||||
if ( -e $stats && -e $cpuinfo ) {
|
||||
print "yes\n";
|
||||
exit 0;
|
||||
}
|
||||
else {
|
||||
print "no\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
elsif ( $ARGV[0] eq 'config' ) {
|
||||
print "graph_title LPAR physical CPU usage\n";
|
||||
print "graph_args --base 1000\n";
|
||||
print "graph_vlabel percent\n";
|
||||
print "graph_category system\n";
|
||||
print "cpu.label cpu\n";
|
||||
print "cpu.type DERIVE\n";
|
||||
print "cpu.min 0\n";
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
||||
$counter=readstats($stats);
|
||||
|
||||
open (CPUINFO,$cpuinfo) or die "Unable to read $cpuinfo, $!";
|
||||
while (<CPUINFO>) {
|
||||
if (/^timebase\s+\:\s+(\d+)/) { $timebase=$1; }
|
||||
}
|
||||
close CPUINFO;
|
||||
|
||||
error() if $cpuinfo eq "";
|
||||
error() if $counter eq "";
|
||||
error() if $timebase eq "";
|
||||
|
||||
my $val=100*$counter/$timebase;
|
||||
$val =~ s/(\d+)\..+/$1/;
|
||||
print "cpu.value " . $val . "\n";
|
||||
exit 0;
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor SELinux' Access Vector Cache (AVC).
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# GNU GPL, Lars Strand
|
||||
#
|
||||
#
|
||||
# Magic markers (used by munin-config and some installation scripts (i.e.
|
||||
# optional)):
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
|
||||
AVCSTATS="/selinux/avc/cache_stats"
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -r $AVCSTATS ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo "graph_title SELinux' Access Vector Cache"
|
||||
echo 'graph_args -l 0 --base 1000'
|
||||
echo 'graph_vlabel AVC operations'
|
||||
echo 'graph_category system'
|
||||
echo 'graph_order lookups hits misses allocations reclaims frees lookups'
|
||||
|
||||
echo 'lookups.label lookups'
|
||||
echo 'lookups.type DERIVE'
|
||||
echo 'lookups.min 0'
|
||||
echo 'lookups.max 1000000000'
|
||||
echo 'lookups.draw AREA'
|
||||
echo 'lookups.colour ff0000' # Red
|
||||
echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.'
|
||||
|
||||
echo 'hits.label hits'
|
||||
echo 'hits.type DERIVE'
|
||||
echo 'hits.min 0'
|
||||
echo 'hits.max 1000000000'
|
||||
echo 'hits.draw STACK'
|
||||
echo 'hits.colour 0022ff' # Blue
|
||||
echo 'hits.info Number of access vector hits.'
|
||||
|
||||
echo 'misses.label misses'
|
||||
echo 'misses.type DERIVE'
|
||||
echo 'misses.min 0'
|
||||
echo 'misses.max 1000000000'
|
||||
echo 'misses.draw STACK'
|
||||
echo 'misses.colour 990000' # Darker red
|
||||
echo 'misses.info Number of cache misses.'
|
||||
|
||||
echo 'allocations.label allocations'
|
||||
echo 'allocations.type DERIVE'
|
||||
echo 'allocations.min 0'
|
||||
echo 'allocations.max 100000000'
|
||||
echo 'allocations.draw STACK'
|
||||
echo 'allocations.colour ffa500' # Orange
|
||||
echo 'allocations.info Number of AVC entries allocated.'
|
||||
|
||||
echo 'reclaims.label reclaims'
|
||||
echo 'reclaims.type DERIVE'
|
||||
echo 'reclaims.min 0'
|
||||
echo 'reclaims.max 1000000000'
|
||||
echo 'reclaims.draw STACK'
|
||||
echo 'reclaims.colour 00aaaa' # Darker turquoise
|
||||
echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).'
|
||||
|
||||
echo 'frees.label frees'
|
||||
echo 'frees.type DERIVE'
|
||||
echo 'frees.min 0'
|
||||
echo 'frees.max 1000000000'
|
||||
echo 'frees.draw STACK'
|
||||
echo 'frees.colour 00ff7f' # Spring green
|
||||
echo 'frees.info Number of free AVC entries.'
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -r $AVCSTATS ]; then
|
||||
awk ' NR > 1 {
|
||||
lookups += $1;
|
||||
hits += $2;
|
||||
misses += $3;
|
||||
allocations += $4;
|
||||
reclaims += $5;
|
||||
frees += $6;
|
||||
} END {
|
||||
print "lookups.value " lookups;
|
||||
print "hits.value " hits;
|
||||
print "misses.value " misses;
|
||||
print "allocations.value " allocations;
|
||||
print "reclaims.value " reclaims;
|
||||
print "frees.value " frees;
|
||||
} ' < $AVCSTATS
|
||||
else
|
||||
echo "lookups.value U"
|
||||
echo "hits.value U"
|
||||
echo "misses.value U"
|
||||
echo "allocations.value U"
|
||||
echo "reclaims.value U"
|
||||
echo "frees.value U"
|
||||
fi
|
|
@ -1,110 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor SELinux's Access Vector Cache (AVC).
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Lars Strand, 2007
|
||||
#
|
||||
#
|
||||
# Magic markers (used by munin-config and some installation scripts (i.e.
|
||||
# optional)):
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
|
||||
AVCSTATS="/selinux/avc/cache_stats"
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -r $AVCSTATS ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo "graph_title SELinux's Access Vector Cache"
|
||||
echo 'graph_args -l 0 --base 1000'
|
||||
echo 'graph_vlabel AVC operations'
|
||||
echo 'graph_category system'
|
||||
|
||||
echo 'lookups.label lookups'
|
||||
echo 'lookups.type DERIVE'
|
||||
echo 'lookups.min 0'
|
||||
echo 'lookups.max 1000000000'
|
||||
echo 'lookups.draw AREA'
|
||||
echo 'lookups.colour ff0000' # Red
|
||||
echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.'
|
||||
|
||||
echo 'hits.label hits'
|
||||
echo 'hits.type DERIVE'
|
||||
echo 'hits.min 0'
|
||||
echo 'hits.max 1000000000'
|
||||
echo 'hits.draw STACK'
|
||||
echo 'hits.colour 0022ff' # Blue
|
||||
echo 'hits.info Number of access vector hits.'
|
||||
|
||||
echo 'misses.label misses'
|
||||
echo 'misses.type DERIVE'
|
||||
echo 'misses.min 0'
|
||||
echo 'misses.max 1000000000'
|
||||
echo 'misses.draw STACK'
|
||||
echo 'misses.colour 990000' # Darker red
|
||||
echo 'misses.info Number of cache misses.'
|
||||
|
||||
echo 'allocations.label allocations'
|
||||
echo 'allocations.type DERIVE'
|
||||
echo 'allocations.min 0'
|
||||
echo 'allocations.max 100000000'
|
||||
echo 'allocations.draw STACK'
|
||||
echo 'allocations.colour ffa500' # Orange
|
||||
echo 'allocations.info Number of AVC entries allocated.'
|
||||
|
||||
echo 'reclaims.label reclaims'
|
||||
echo 'reclaims.type DERIVE'
|
||||
echo 'reclaims.min 0'
|
||||
echo 'reclaims.max 1000000000'
|
||||
echo 'reclaims.draw STACK'
|
||||
echo 'reclaims.colour 00aaaa' # Darker turquoise
|
||||
echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).'
|
||||
|
||||
echo 'frees.label frees'
|
||||
echo 'frees.type DERIVE'
|
||||
echo 'frees.min 0'
|
||||
echo 'frees.max 1000000000'
|
||||
echo 'frees.draw STACK'
|
||||
echo 'frees.colour 00ff7f' # Spring green
|
||||
echo 'frees.info Number of free AVC entries.'
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -r $AVCSTATS ]; then
|
||||
awk ' NR > 1 {
|
||||
lookups += $1;
|
||||
hits += $2;
|
||||
misses += $3;
|
||||
allocations += $4;
|
||||
reclaims += $5;
|
||||
frees += $6;
|
||||
} END {
|
||||
print "lookups.value " lookups;
|
||||
print "hits.value " hits;
|
||||
print "misses.value " misses;
|
||||
print "allocations.value " allocations;
|
||||
print "reclaims.value " reclaims;
|
||||
print "frees.value " frees;
|
||||
} ' < $AVCSTATS
|
||||
else
|
||||
echo "lookups.value U"
|
||||
echo "hits.value U"
|
||||
echo "misses.value U"
|
||||
echo "allocations.value U"
|
||||
echo "reclaims.value U"
|
||||
echo "frees.value U"
|
||||
fi
|
|
@ -1,105 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2006 Lars Strand
|
||||
#
|
||||
# Munin plugin to monitor uptime by use of SNMP.
|
||||
# Based on snmp__users plugin.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# $Log$
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
|
||||
my $response;
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
print "require 1.3.6.1.2.1.1.3.0 \n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_uptime$/)
|
||||
{
|
||||
$host = $1;
|
||||
if ($host =~ /^([^:]+):(\d+)$/)
|
||||
{
|
||||
$host = $1;
|
||||
$port = $2;
|
||||
}
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
print "host_name $host\n";
|
||||
print "graph_title Uptime
|
||||
graph_category system
|
||||
graph_args --base 1000 -l 0
|
||||
graph_vlabel uptime
|
||||
graph_info This graph shows the uptime (in days) of the system.
|
||||
uptime.label uptime
|
||||
uptime.draw AREA
|
||||
";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port,
|
||||
-translate => ['-timeticks']
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
printf "uptime.value %.2f\n", &get_single($session, "1.3.6.1.2.1.1.3.0");
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid...\n" if $DEBUG;
|
||||
|
||||
|
||||
$response = $handle->get_request($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (($response->{$oid}/100)/(60*60*24));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue