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 16:11:20 +01:00
parent 6ffdebec0d
commit f769371079
22 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,90 @@
#!/usr/bin/perl -w
# -*- perl -*-
# vim: ft=perl
=head1 NAME
snmp__cisco_sbs_cpu - Munin plugin to monitor CPU Usage on Cisco Small Business Switches.
=head1 APPLICABLE SYSTEMS
Cisco Small Business Switches (SBXXXX devices)
=head1 CONFIGURATION
As a rule SNMP plugins need site specific configuration. The default
configuration (shown here) will only work on insecure sites/devices.
[snmp_*]
env.version 2
env.community public
In general SNMP is not very secure at all unless you use SNMP version
3 which supports authentication and privacy (encryption). But in any
case the community string for your devices should not be "public".
Please see 'perldoc Munin::Plugin::SNMP' for further configuration
information.
=head1 INTERPRETATION
CPU Percentage gives an idea of utilization of the device. High CPU
can indicate a configuration problem or overutilization of the device.
=head1 MAGIC MARKERS
#%# family=snmpauto
#%# capabilities=snmpconf
=head1 VERSION
$Id$
=head1 BUGS
None known.
=head1 AUTHOR
Copyright (C) 2015 James DeVincentis
=head1 LICENSE
GPLv3.
=cut
use strict;
use Munin::Plugin::SNMP;
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
print "require 1.3.6.1.4.1.9.6.1.101.1.7.0 [0-9]\n";
exit 0;
}
if (defined $ARGV[0] and $ARGV[0] eq "config") {
my ($host) = Munin::Plugin::SNMP->config_session();
print "host_name $host\n" unless $host eq 'localhost';
print <<"EOF";
graph_title CPU Utilization
graph_args --base 1000 -l 0 -u 100
graph_vlabel CPU %
graph_category system
graph_info This graph shows the percentage of CPU used at different intervals. High CPU Utilization can indicate a configuration problem or overutilization of the device.
load5sec.label 5s
load5sec.info 5 Second CPU Utilization Average
load5sec.draw LINE1
load1min.label 1m
load1min.info 1 Minute CPU Utilization Average
load1min.draw LINE1
load5min.label 5m
load5min.info 5 Minute CPU Utilization Average
EOF
exit 0;
}
my $session = Munin::Plugin::SNMP->session();
print "load5sec.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.7.0'), "\n";
print "load1min.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.8.0'), "\n";
print "load5min.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.9.0'), "\n";

114
plugins/router/snmp__linksys_poe Executable file
View file

@ -0,0 +1,114 @@
#!/usr/bin/ruby
"
=head1 NAME
snmp__linksys_poe - Munin plugin to monitor the current supplied by Linksys PoE
switches.
Requires ruby and the ruby SNMP library.
=head1 APPLICABLE SYSTEMS
I wrote this to query SRW2008MP switches and determined the OIDs by trial and
error. There may be other Linksys devices that this will also work for.
=head1 CONFIGURATION
This plugin defaults to SNMP version 2c and a community string of 'public'. The
defaults can be overridden in the usual way:
[snmp_*]
env.version 1
env.community private
SNMP version 3 is not supported.
=head1 INTERPRETATION
The plugin simply reports the current being supplied on each of the device's
PoE ports.
=head1 MIB INFORMATION
Information is gathered from Linksys' private MIB space, so it's probably only
applicable to Linksys devices. I have been unable to get an actual copy of
the appropriate MIB, so I don't know the actual names of the values I'm
retrieving.
=head1 MAGIC MARKERS
#%# family=snmpauto contrib
#%# capabilities=snmpconf
=head1 VERSION
1.0
=head1 BUGS
None known.
=head1 AUTHOR
Written by Phil Gold <phil_g@pobox.com>.
=head1 LICENSE
CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
To the extent possible under law, all copyright and related or neighboring
rights to this plugin are waived. Do with it as you wish.
=cut
"
require 'snmp'
idx_oid = "enterprises.3955.89.108.1.1.2"
max_oid = "enterprises.3955.89.108.1.1.6"
cur_oid = "enterprises.3955.89.108.1.1.5"
community = ENV['community'] || "public"
version = ENV['version'] == '1' ? :SNMPv1 : :SNMPv2c
case ARGV[0]
when "autoconf"
puts "no"
exit 1
when "snmpconf"
puts "require 1.3.6.1.4.1.3955.89.108.1.1.2.1. [0-9]"
puts "require 1.3.6.1.4.1.3955.89.108.1.1.5.1. [0-9]"
puts "require 1.3.6.1.4.1.3955.89.108.1.1.6.1. [0-9]"
exit 0;
when "config"
host = $0.match('^(?:|.*\/)snmp_([^_]+)')[1]
puts "host_name #{host}"
puts "graph_title PoE Power Usage"
puts "graph_vlabel Watts"
puts "graph_category sensors"
max_current = 0
SNMP::Manager.open(:Host => host,
:Community => community,
:Version => version) do |manager|
manager.walk([idx_oid, max_oid]) do |row|
puts "iface_#{row[0].value}.label Port #{row[0].value}"
puts "iface_#{row[0].value}.cdef iface_#{row[0].value},1000,/"
puts "iface_#{row[0].value}.line #{row[1].value.to_f / 1000}"
if row[1].value > max_current
max_current = row[1].value
end
end
end
puts "graph_args --upper-limit #{max_current.to_f / 1000}"
exit 0
else
host = $0.match('^(?:|.*\/)snmp_([^_]+)')[1]
SNMP::Manager.open(:Host => host,
:Community => community,
:Version => version) do |manager|
manager.walk([idx_oid, cur_oid]) do |row|
puts "iface_#{row[0].value}.value #{row[1].value}"
end
end
end

170
plugins/router/snmp__screenos Executable file
View file

@ -0,0 +1,170 @@
#!/usr/bin/perl -w
# -*- cperl -*-
=head1 NAME
snmp__screenos_ - SNMP plugin to monitor Juniper ScreenOS based routers
=head1 APPLICABLE SYSTEMS
This has been developed against a Juniper SSG5-Serial router, but
should work with any ScreenOS-based router as manufactured by Juniper.
Using a command such as "munin-node-configure --snmp
switch.langfeldt.net --snmpversion 2c --snmpcommunity public | sh -x"
should identify whether this plugin can apply.
=head1 CONFIGURATION
As a rule SNMP plugins need site specific configuration. The default
configuration (shown here) will only work on insecure sites/devices:
[snmp_*]
env.version 2
env.community public
In general SNMP is not very secure at all unless you use SNMP version
3 which supports authentication and privacy (encryption). But in any
case the community string for your devices should not be "public".
Please see 'perldoc Munin::Plugin::SNMP' for further configuration
information.
=head1 MIB INFORMATION
This plugin requires NETSCREEN-RESOURCE-MIB information.
=head1 MAGIC MARKERS
#%# family=snmpauto
#%# capabilities=snmpconf
=head1 AUTHOR
Copyright (C) 2012 Diego Elio Pettenò.
=head1 LICENSE
GPLv2
=cut
use strict;
use Munin::Plugin;
use Munin::Plugin::SNMP;
# This corresponds to NETSCREEN-SMI::netscreenResource
my $oidBase = '1.3.6.1.4.1.3224.16';
my $oidCpuAvg = "$oidBase.1.1";
my $oidCpuLast1Min = "$oidBase.1.2";
my $oidCpuLast5Min = "$oidBase.1.3";
my $oidCpuLast15Min = "$oidBase.1.4";
my $oidMemAllocate = "$oidBase.2.1";
my $oidMemLeft = "$oidBase.2.2";
my $oidSessAllocate = "$oidBase.3.2";
my $oidSessMaximum = "$oidBase.3.3";
my $oidSessFailed = "$oidBase.3.4";
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
print "require $oidBase.[23].[13].0";
exit 0;
}
my $session = Munin::Plugin::SNMP->session();
my $data = $session->get_entries(-columns => [$oidCpuAvg,
$oidCpuLast1Min,
$oidCpuLast5Min,
$oidCpuLast15Min,
$oidMemAllocate,
$oidMemLeft,
$oidSessAllocate,
$oidSessMaximum,
$oidSessFailed ]);
if ($ARGV[0] and $ARGV[0] eq "config") {
my ($host) = Munin::Plugin::SNMP->config_session();
my $memTotal = $data->{"$oidMemAllocate.0"} + $data->{"$oidMemLeft.0"};
# this is the closet I can get to the yellow/red on the ScreenOS
# interface.
my $memWarning = int($memTotal * 0.75 + 0.5);
my $memCritical = int($memTotal * 0.85 + 0.5);
my $sessWarning = int($data->{"$oidSessMaximum.0"} * 0.75 + 0.5);
my $sessCritical = int($data->{"$oidSessMaximum.0"} * 0.85 + 0.5);
print <<END;
host_name $host
multigraph screenos_memory
graph_title Memory allocation
graph_vlabel bytes
graph_args --base 1024
graph_category system
memory.label Memory
memory.min 0
memory.max $memTotal
memory.warning $memWarning
memory.critical $memCritical
multigraph screenos_sessions
graph_title Sessions allocation
graph_vlabel Count
graph_category system
sessions.label Active Sessions
sessions.min 0
sessions.max $data->{"$oidSessMaximum.0"}
sessions.warning $sessWarning
sessions.critical $sessCritical
failed.label Failed Sessions
failed.min 0
failed.critical 1
multigraph screenos_cpu
graph_title CPU Utilization
graph_vlabel Percentage
graph_category system
average.label Average
average.min 0
average.max 100
average.warning 75
average.critical 85
last1.label Last minute
last1.min 0
last1.max 100
last1.warning 75
last1.critical 85
last5.label Last 5 minutes
last5.min 0
last5.max 100
last5.warning 75
last5.critical 85
last15.label Last 15 minutes
last15.min 0
last15.max 100
last15.warning 75
last15.critical 85
END
exit 0;
}
print <<END;
multigraph screenos_memory
memory.value $data->{"$oidMemAllocate.0"}
multigraph screenos_sessions
sessions.value $data->{"$oidSessAllocate.0"}
failed.value $data->{"$oidSessFailed.0"}
multigraph screenos_cpu
average.value $data->{"$oidCpuAvg.0"}
last1.value $data->{"$oidCpuLast1Min.0"}
last5.value $data->{"$oidCpuLast5Min.0"}
last15.value $data->{"$oidCpuLast15Min.0"}
END