mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin-Gallery: Get better 2nd level headings
sensors, weather, snmp
This commit is contained in:
parent
37d658526b
commit
95de964ec9
24 changed files with 10 additions and 10 deletions
112
plugins/sfsnmp/snmp__sfsnmp_fan
Executable file
112
plugins/sfsnmp/snmp__sfsnmp_fan
Executable file
|
@ -0,0 +1,112 @@
|
|||
#!/usr/bin/perl
|
||||
# -*- perl -*-
|
||||
#
|
||||
# snmp__sfsnmp_fan - Munin plugin for measuring fan on a windowssystem running SpeedFan and sfsnmp
|
||||
# Copyright (C) 2010 Nils Henrik Tvetene
|
||||
#
|
||||
# Author: Nils Henrik Tvetene <nils@tvetene.net>
|
||||
#
|
||||
# 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; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp__sfsnmp_fan - Munin plugin for measuring fanspeed on a windowssystem running SpeedFan and sfsnmp
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Windows-system running SpeedFan and the sfsnmp extension
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
Example config:
|
||||
[snmp_twinspark_sfsnmp_*]
|
||||
env.fan1 CPU
|
||||
env.fan7.ignore true
|
||||
|
||||
Plugin is linked using hostname of monitored system:
|
||||
|
||||
ln -s /usr/share/munin/plugins/snmp__sfsnmp_fan /etc/munin/plugins/snmp_<hostname>_sfsnmp_fan
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Nils Henrik Tvetene <nils@tvetene.net>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Munin::Plugin::SNMP;
|
||||
use vars qw($DEBUG);
|
||||
|
||||
$DEBUG = $ENV{'MUNIN_DEBUG'};
|
||||
|
||||
# OIDs used
|
||||
# 1.3.6.1.4.1.30503.1.1.2 number of fans
|
||||
# 1.3.6.1.4.1.30503.1.3.x where x is 1 => above number
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
|
||||
print "number 1.3.6.1.4.1.30503.1.1.2\n";
|
||||
print "index 1.3.6.1.4.1.30503.1.3.\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $session = Munin::Plugin::SNMP->session();
|
||||
my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session();
|
||||
my ($idx, $numFans, @fan, @label);
|
||||
|
||||
$numFans = $session->get_single('1.3.6.1.4.1.30503.1.1.2');
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
print "host_name $host\n" unless $host eq 'localhost';
|
||||
print "graph_title $host fan\n";
|
||||
print "graph_args --base 1000 --lower-limit 1000\n";
|
||||
print "graph_scale no\n";
|
||||
print "graph_printf %3.0lf\n";
|
||||
print "graph_vlabel fan RPM\n";
|
||||
print "graph_category sensors\n";
|
||||
print "graph_info This graph shows the fans on host $host\n";
|
||||
foreach $idx ( 0..$numFans-1 ) {
|
||||
$label[$idx] = exists $ENV{"fan".($idx+1)} ? $ENV{"fan".($idx+1)} : "fan".($idx+1);
|
||||
print "fan".($idx+1).".info ".$label[$idx]." fan in RPM's.\n";
|
||||
|
||||
print "fan".($idx+1).".graph no\n" if exists $ENV{"fan".($idx+1).".ignore"};
|
||||
|
||||
print "fan".($idx+1).".type GAUGE\n";
|
||||
print "fan".($idx+1).".label $label[$idx]\n";
|
||||
print "fan".($idx+1).".min 1000\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
foreach $idx ( 0..$numFans-1 ) {
|
||||
$fan[$idx] = $session->get_single('1.3.6.1.4.1.30503.1.3.'.($idx+1));
|
||||
print "fan".($idx+1).".value $fan[$idx]\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
||||
|
111
plugins/sfsnmp/snmp__sfsnmp_temp
Executable file
111
plugins/sfsnmp/snmp__sfsnmp_temp
Executable file
|
@ -0,0 +1,111 @@
|
|||
#!/usr/bin/perl
|
||||
# -*- perl -*-
|
||||
#
|
||||
# snmp__sfsnmp_temp - Munin plugin for measuring temperatures on a windowssystem running SpeedFan and sfsnmp
|
||||
# Copyright (C) 2010 Nils Henrik Tvetene
|
||||
#
|
||||
# Author: Nils Henrik Tvetene <nils@tvetene.net>
|
||||
#
|
||||
# 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; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp__sfsnmp_temp - Munin plugin for measuring temperatures on a windowssystem running SpeedFan and sfsnmp
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Windows-system running SpeedFan and the sfsnmp extension
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
Example config:
|
||||
[snmp_twinspark_sfsnmp_temp]
|
||||
env.temp1 System
|
||||
env.temp7.ignore true
|
||||
|
||||
Plugin is linked using hostname of monitored system:
|
||||
|
||||
ln -s /usr/share/munin/plugins/snmp__sfsnmp_temp /etc/munin/plugins/snmp_<hostname>_sfsnmp_temp
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Nils Henrik Tvetene <nils@tvetene.net>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Munin::Plugin::SNMP;
|
||||
use vars qw($DEBUG);
|
||||
|
||||
$DEBUG = $ENV{'MUNIN_DEBUG'};
|
||||
|
||||
# OIDs used
|
||||
# 1.3.6.1.4.1.30503.1.1.1 number of temperatures
|
||||
# 1.3.6.1.4.1.30503.1.2.x where x is 1 => above number
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
|
||||
print "number 1.3.6.1.4.1.30503.1.1.1\n";
|
||||
print "index 1.3.6.1.4.1.30503.1.2.\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $session = Munin::Plugin::SNMP->session();
|
||||
my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session();
|
||||
my ($idx, $numTemps, @temp, @label);
|
||||
|
||||
$numTemps = $session->get_single('1.3.6.1.4.1.30503.1.1.1');
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
print "host_name $host\n" unless $host eq 'localhost';
|
||||
print "graph_title $host temperatures\n";
|
||||
print "graph_args --base 1000 --lower-limit 30\n";
|
||||
print "graph_vlabel degrees Celsius\n";
|
||||
print "graph_category sensors\n";
|
||||
print "graph_info This graph shows the temperatures on host $host\n";
|
||||
foreach $idx ( 0..$numTemps-1 ) {
|
||||
$label[$idx] = exists $ENV{"temp".($idx+1)} ? $ENV{"temp".($idx+1)} : "temp".($idx+1);
|
||||
print "temp".($idx+1).".info ".$label[$idx]." temperature in Celsius.\n";
|
||||
|
||||
print "temp".($idx+1).".graph no\n" if exists $ENV{"temp".($idx+1).".ignore"};
|
||||
|
||||
print "temp".($idx+1).".type GAUGE\n";
|
||||
print "temp".($idx+1).".label $label[$idx]\n";
|
||||
print "temp".($idx+1).".cdef temp".($idx+1).",100,/\n";
|
||||
print "temp".($idx+1).".min 30\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
foreach $idx ( 0..$numTemps-1 ) {
|
||||
$temp[$idx] = $session->get_single('1.3.6.1.4.1.30503.1.2.'.($idx+1));
|
||||
print "temp".($idx+1).".value $temp[$idx]\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
||||
|
112
plugins/sfsnmp/snmp__sfsnmp_volt
Executable file
112
plugins/sfsnmp/snmp__sfsnmp_volt
Executable file
|
@ -0,0 +1,112 @@
|
|||
#!/usr/bin/perl
|
||||
# -*- perl -*-
|
||||
#
|
||||
# snmp__sfsnmp_volt - Munin plugin for measuring volt on a windowssystem running SpeedFan and sfsnmp
|
||||
# Copyright (C) 2010 Nils Henrik Tvetene
|
||||
#
|
||||
# Author: Nils Henrik Tvetene <nils@tvetene.net>
|
||||
#
|
||||
# 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; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp__sfsnmp_volt - Munin plugin for measuring volts on a windowssystem running SpeedFan and sfsnmp
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Windows-system running SpeedFan and the sfsnmp extension
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
Example config:
|
||||
[snmp_twinspark_sfsnmp_*]
|
||||
env.volt1 Vcore
|
||||
env.volt3.ignore true
|
||||
|
||||
Plugin is linked using hostname of monitored system:
|
||||
|
||||
ln -s /usr/share/munin/plugins/snmp__sfsnmp_volt /etc/munin/plugins/snmp_<hostname>_sfsnmp_volt
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Nils Henrik Tvetene <nils@tvetene.net>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Munin::Plugin::SNMP;
|
||||
use vars qw($DEBUG);
|
||||
|
||||
$DEBUG = $ENV{'MUNIN_DEBUG'};
|
||||
|
||||
# OIDs used
|
||||
# 1.3.6.1.4.1.30503.1.1.3 number of voltages
|
||||
# 1.3.6.1.4.1.30503.1.4.x where x is 1 => above number
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
|
||||
print "number 1.3.6.1.4.1.30503.1.1.3\n";
|
||||
print "index 1.3.6.1.4.1.30503.1.4.\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $session = Munin::Plugin::SNMP->session();
|
||||
my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session();
|
||||
my ($idx, $numVolts, @volt, @label);
|
||||
|
||||
$numVolts = $session->get_single('1.3.6.1.4.1.30503.1.1.3');
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
print "host_name $host\n" unless $host eq 'localhost';
|
||||
print "graph_title $host volt\n";
|
||||
print "graph_args --base 1000 --lower-limit 0 --upper-limit 13\n";
|
||||
print "graph_scale no\n";
|
||||
print "graph_vlabel Volt\n";
|
||||
print "graph_category sensors\n";
|
||||
print "graph_info This graph shows the volt on host $host\n";
|
||||
foreach $idx ( 0..$numVolts-1 ) {
|
||||
$label[$idx] = exists $ENV{"volt".($idx+1)} ? $ENV{"volt".($idx+1)} : "volt".($idx+1);
|
||||
print "volt".($idx+1).".info ".$label[$idx]." volt in Celsius.\n";
|
||||
|
||||
print "volt".($idx+1).".graph no\n" if exists $ENV{"volt".($idx+1).".ignore"};
|
||||
|
||||
print "volt".($idx+1).".type GAUGE\n";
|
||||
print "volt".($idx+1).".label $label[$idx]\n";
|
||||
print "volt".($idx+1).".cdef volt".($idx+1).",100,/\n";
|
||||
print "volt".($idx+1).".min 30\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
foreach $idx ( 0..$numVolts-1 ) {
|
||||
$volt[$idx] = $session->get_single('1.3.6.1.4.1.30503.1.4.'.($idx+1));
|
||||
print "volt".($idx+1).".value $volt[$idx]\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue