@ -1,2 +0,0 @@
|
|||||||
Check http://aouyar.github.com/PyMunin/ to get the most recent versionof the
|
|
||||||
PyMunin Multi graph Munin Plugins and documentation.
|
|
62
plugins/beboxsync/beboxstats
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my ($Args) = @ARGV;
|
||||||
|
|
||||||
|
my $expecter = "/home/alex/bin/beboxstats.expect";
|
||||||
|
|
||||||
|
if ($Args) {
|
||||||
|
|
||||||
|
# work out line to grab
|
||||||
|
if ($Args eq 'autoconf') {
|
||||||
|
# Check the expect script that polls the router exists
|
||||||
|
unless ( -e $expecter ) {
|
||||||
|
print "no (Can't find expect script. Check value of \$expecter: $expecter)\n";
|
||||||
|
} else {
|
||||||
|
print "yes\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif ($Args eq 'config') { # print out plugin parameters
|
||||||
|
printf("
|
||||||
|
graph_title bebox line stats
|
||||||
|
graph_vlabel deciBels
|
||||||
|
graph_category other
|
||||||
|
graph_info This graph shows the various line parameters
|
||||||
|
attenuationdownstream.label Downstream Attenuation
|
||||||
|
attenuationupstream.label Upstream Attenuation
|
||||||
|
margindownstream.label Downstream Noise Margin
|
||||||
|
marginupstream.label Upstream Noise Margin
|
||||||
|
outputpowerdownstream.label Downstream Output Power
|
||||||
|
outputpowerupstream.label Upstream Output Power
|
||||||
|
margindownstream.type GAUGE
|
||||||
|
outputpowerupstream.type GAUGE
|
||||||
|
attenuationdownstream.type GAUGE
|
||||||
|
marginupstream.type GAUGE
|
||||||
|
outputpowerdownstream.type GAUGE
|
||||||
|
attenuationupstream.type GAUGE
|
||||||
|
");
|
||||||
|
# .label is the Key on the graph
|
||||||
|
} else {
|
||||||
|
printf("Usage: $0
|
||||||
|
No arguments: print line stats
|
||||||
|
autoconf: print 'yes'
|
||||||
|
config: print config info for Munin\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
# if no arguments, just fetch the data and print it out
|
||||||
|
|
||||||
|
my @insplitted = split(' ', `$expecter | grep dB`);
|
||||||
|
|
||||||
|
print "margindownstream.value $insplitted[3]\n";
|
||||||
|
print "marginupstream.value $insplitted[4]\n";
|
||||||
|
|
||||||
|
print "attenuationdownstream.value $insplitted[8]\n";
|
||||||
|
print "attenuationupstream.value $insplitted[9]\n";
|
||||||
|
|
||||||
|
print "outputpowerdownstream.value $insplitted[13]\n";
|
||||||
|
print "outputpowerupstream.value $insplitted[14]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
25
plugins/beboxsync/beboxstats.expect
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/expect -f
|
||||||
|
|
||||||
|
# script to log on to a BeBox router [ST Speedtouch 780] and gather line stats
|
||||||
|
|
||||||
|
# set timeout for response from router to 30 seconds
|
||||||
|
set timeout 30
|
||||||
|
set router "host.or.ip.of.router"
|
||||||
|
set port "23"
|
||||||
|
set username "Administrator"
|
||||||
|
set password "routerpassword"
|
||||||
|
|
||||||
|
# telnet to $router on $port
|
||||||
|
spawn telnet $router $port
|
||||||
|
|
||||||
|
expect "Username :"
|
||||||
|
send "$username\r"
|
||||||
|
|
||||||
|
expect "Password :"
|
||||||
|
send "$password\r"
|
||||||
|
|
||||||
|
expect "}=>"
|
||||||
|
send "adsl info\r"
|
||||||
|
|
||||||
|
expect "}=>"
|
||||||
|
send "exit\r"
|
50
plugins/beboxsync/beboxsync
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
# (C) Alex Dekker <me@ale.cx>
|
||||||
|
# License is GPL
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my ($Args) = @ARGV;
|
||||||
|
|
||||||
|
my $expecter = "/home/alex/bin/beboxstats.expect";
|
||||||
|
|
||||||
|
if ($Args) {
|
||||||
|
|
||||||
|
# work out line to grab
|
||||||
|
if ($Args eq 'autoconf') {
|
||||||
|
# Check the expect script that polls the router exists
|
||||||
|
unless ( -e $expecter ) {
|
||||||
|
print "no (Can't find expect script. Check value of \$expecter: $expecter)\n";
|
||||||
|
} else {
|
||||||
|
print "yes\n";
|
||||||
|
}
|
||||||
|
} elsif ($Args eq 'config') { # print out plugin parameters
|
||||||
|
printf("
|
||||||
|
graph_title bebox sync stats
|
||||||
|
graph_vlabel ATM kbps
|
||||||
|
graph_category other
|
||||||
|
graph_info This graph shows line sync speed
|
||||||
|
syncdownstream.label Downstream Sync Speed
|
||||||
|
syncupstream.label Upstream Sync Speed
|
||||||
|
syncdownstream.type GAUGE
|
||||||
|
syncupstream.type GAUGE
|
||||||
|
");
|
||||||
|
# .label is the Key on the graph
|
||||||
|
} else {
|
||||||
|
printf("Usage: $0
|
||||||
|
No arguments: print line stats
|
||||||
|
autoconf: print 'yes'
|
||||||
|
config: print config info for Munin\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
# if no arguments, just fetch the data and print it out
|
||||||
|
|
||||||
|
my @insplitted = split(' ', `$expecter | grep stream`);
|
||||||
|
|
||||||
|
print "syncdownstream.value $insplitted[11]\n";
|
||||||
|
print "syncupstream.value $insplitted[15]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,702 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
# vim: sts=4 sw=4 ts=8
|
|
||||||
|
|
||||||
# Munin markers:
|
|
||||||
#%# family=auto
|
|
||||||
#%# capabilities=autoconf suggest
|
|
||||||
|
|
||||||
# Author: Michael Renner <michael.renner@amd.co.at>
|
|
||||||
|
|
||||||
# Version: 0.0.5, 2009-05-22
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=head1 NAME
|
|
||||||
|
|
||||||
linux_diskstat_ - Munin plugin to monitor various values provided
|
|
||||||
via C</proc/diskstats>
|
|
||||||
|
|
||||||
=head1 APPLICABLE SYSTEMS
|
|
||||||
|
|
||||||
Linux 2.6 systems with extended block device statistics enabled.
|
|
||||||
|
|
||||||
|
|
||||||
=head1 INTERPRETATION
|
|
||||||
|
|
||||||
Among the more self-describing or well-known values like C<throughput>
|
|
||||||
(Bytes per second) there are a few which might need further introduction.
|
|
||||||
|
|
||||||
|
|
||||||
=head2 Device Utilization
|
|
||||||
|
|
||||||
Linux provides a counter which increments in a millisecond-interval for as long
|
|
||||||
as there are outstanding I/O requests. If this counter is close to 1000msec
|
|
||||||
in a given 1 second timeframe the device is nearly 100% saturated. This plugin
|
|
||||||
provides values averaged over a 5 minute time frame per default, so it can't
|
|
||||||
catch short-lived saturations, but it'll give a nice trend for semi-uniform
|
|
||||||
load patterns as they're expected in most server or multi-user environments.
|
|
||||||
|
|
||||||
|
|
||||||
=head2 Device IO Time
|
|
||||||
|
|
||||||
The C<Device IO Time> takes the counter described under C<Device Utilization>
|
|
||||||
and divides it by the number of I/Os that happened in the given time frame,
|
|
||||||
resulting in an average time per I/O on the block-device level.
|
|
||||||
|
|
||||||
This value can give you a good comparison base amongst different controllers,
|
|
||||||
storage subsystems and disks for similiar workloads.
|
|
||||||
|
|
||||||
|
|
||||||
=head2 Syscall Wait Time
|
|
||||||
|
|
||||||
These values describe the average time it takes between an application issuing
|
|
||||||
a syscall resulting in a hit to a blockdevice to the syscall returning to the
|
|
||||||
application.
|
|
||||||
|
|
||||||
The values are bound to be higher (at least for read requests) than the time
|
|
||||||
it takes the device itself to fulfill the requests, since calling overhead,
|
|
||||||
queuing times and probably a dozen other things are included in those times.
|
|
||||||
|
|
||||||
These are the values to watch out for when an user complains that C<the disks
|
|
||||||
are too slow!>.
|
|
||||||
|
|
||||||
|
|
||||||
=head3 What causes a block device hit?
|
|
||||||
|
|
||||||
A non-exhaustive list:
|
|
||||||
|
|
||||||
=over
|
|
||||||
|
|
||||||
=item * Reads from files when the given range is not in the page cache or the O_DIRECT
|
|
||||||
flag is set.
|
|
||||||
|
|
||||||
=item * Writes to files if O_DIRECT or O_SYNC is set or sys.vm.dirty_(background_)ratio
|
|
||||||
is exceeded.
|
|
||||||
|
|
||||||
=item * Filesystem metadata operations (stat(2), getdents(2), file creation,
|
|
||||||
modification of any of the values returned by stat(2), etc.)
|
|
||||||
|
|
||||||
=item * The pdflush daemon writing out dirtied pages
|
|
||||||
|
|
||||||
=item * (f)sync
|
|
||||||
|
|
||||||
=item * Swapping
|
|
||||||
|
|
||||||
=item * raw device I/O (mkfs, dd, etc.)
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=head1 ACKNOWLEDGEMENTS
|
|
||||||
|
|
||||||
The core logic of this script is based on the B<iostat> tool of the B<sysstat>
|
|
||||||
package written and maintained by Sebastien Godard.
|
|
||||||
|
|
||||||
=head1 SEE ALSO
|
|
||||||
|
|
||||||
See C<Documentation/iostats.txt> in your Linux source tree for further information
|
|
||||||
about the C<numbers> involved in this module.
|
|
||||||
|
|
||||||
L<http://www.westnet.com/~gsmith/content/linux-pdflush.htm> has a nice writeup
|
|
||||||
about the pdflush daemon.
|
|
||||||
|
|
||||||
=head1 AUTHOR
|
|
||||||
|
|
||||||
Michael Renner <michael.renner@amd.co.at>
|
|
||||||
|
|
||||||
=head1 LICENSE
|
|
||||||
|
|
||||||
GPLv2
|
|
||||||
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
|
|
||||||
use File::Basename;
|
|
||||||
use Carp;
|
|
||||||
use POSIX;
|
|
||||||
|
|
||||||
# We load our own version of save/restore_state if Munin::Plugin is unavailable.
|
|
||||||
# Don't try this at home
|
|
||||||
eval { require Munin::Plugin; Munin::Plugin->import; };
|
|
||||||
|
|
||||||
if ($@) {
|
|
||||||
fake_munin_plugin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Sanity check to ensure that the script is called the correct name.
|
|
||||||
|
|
||||||
if (basename($0) !~ /^linux_diskstat_/) {
|
|
||||||
die qq(Please ensure that the name of the script and it's symlinks starts with "linux_diskstat_"\n);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
############
|
|
||||||
# autoconf #
|
|
||||||
############
|
|
||||||
|
|
||||||
if ( defined $ARGV[0] && $ARGV[0] eq 'autoconf' ) {
|
|
||||||
my %stats;
|
|
||||||
|
|
||||||
# Capture any croaks on the way
|
|
||||||
eval { %stats = parse_diskstats() };
|
|
||||||
|
|
||||||
if ( !$@ && keys %stats ) {
|
|
||||||
|
|
||||||
print "yes\n";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print "no\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
###########
|
|
||||||
# suggest #
|
|
||||||
###########
|
|
||||||
|
|
||||||
if ( defined $ARGV[0] && $ARGV[0] eq 'suggest' ) {
|
|
||||||
|
|
||||||
my %diskstats = parse_diskstats();
|
|
||||||
|
|
||||||
my %suggested_devices;
|
|
||||||
|
|
||||||
DEVICE:
|
|
||||||
for my $devname ( sort keys %diskstats ) {
|
|
||||||
|
|
||||||
# Skip devices without traffic
|
|
||||||
next
|
|
||||||
if ( $diskstats{$devname}->{'rd_ios'} == 0
|
|
||||||
&& $diskstats{$devname}->{'wr_ios'} == 0 );
|
|
||||||
|
|
||||||
for my $existing_device ( @{ $suggested_devices{'iops'} } ) {
|
|
||||||
|
|
||||||
# Filter out devices (partitions) which are matched by existing ones
|
|
||||||
# e.g. sda1 -> sda, c0d0p1 -> c0d0
|
|
||||||
next DEVICE if ( $devname =~ m/$existing_device/ );
|
|
||||||
}
|
|
||||||
|
|
||||||
push @{ $suggested_devices{'iops'} }, $devname;
|
|
||||||
push @{ $suggested_devices{'throughput'} }, $devname;
|
|
||||||
|
|
||||||
# Only suggest latency graphs if the device supports it
|
|
||||||
if ( $diskstats{$devname}->{'rd_ticks'} > 0
|
|
||||||
|| $diskstats{$devname}->{'wr_ticks'} > 0 )
|
|
||||||
{
|
|
||||||
push @{ $suggested_devices{'latency'} }, $devname;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for my $mode ( keys %suggested_devices ) {
|
|
||||||
for my $device ( sort @{ $suggested_devices{$mode} } ) {
|
|
||||||
|
|
||||||
my $printdev = translate_device_name($device, 'TO_FS');
|
|
||||||
print "${mode}_$printdev\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Reading the scripts invocation name and setting some parameters,
|
|
||||||
# needed from here on
|
|
||||||
|
|
||||||
my $basename = basename($0);
|
|
||||||
my ( $mode, $device ) = $basename =~ m/linux_diskstat_(\w+)_([-+\w]+)$/;
|
|
||||||
|
|
||||||
if ( not defined $device ) {
|
|
||||||
croak "Didn't get a device name. Aborting\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$device = translate_device_name($device, 'FROM_FS');
|
|
||||||
|
|
||||||
##########
|
|
||||||
# config #
|
|
||||||
##########
|
|
||||||
|
|
||||||
if ( defined $ARGV[0] && $ARGV[0] eq 'config' ) {
|
|
||||||
|
|
||||||
my $pretty_device = $device;
|
|
||||||
|
|
||||||
if ($device =~ /^dm-\d+$/) {
|
|
||||||
$pretty_device = translate_devicemapper_name($device);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $mode eq 'latency' ) {
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
graph_title Disk latency for /dev/$pretty_device
|
|
||||||
graph_args --base 1000
|
|
||||||
graph_category disk
|
|
||||||
|
|
||||||
util.label Device utilization (percent)
|
|
||||||
util.type GAUGE
|
|
||||||
util.info Utilization of the device. If the time spent for I/O is close to 1000msec for a given second, the device is nearly 100% saturated.
|
|
||||||
util.min 0
|
|
||||||
svctm.label Average device IO time (ms)
|
|
||||||
svctm.type GAUGE
|
|
||||||
svctm.info Average time an I/O takes on the block device
|
|
||||||
svctm.min 0
|
|
||||||
avgwait.label Average IO Wait time (ms)
|
|
||||||
avgwait.type GAUGE
|
|
||||||
avgwait.info Average wait time for an I/O from request start to finish (includes queue times et al)
|
|
||||||
avgwait.min 0
|
|
||||||
avgrdwait.label Average Read IO Wait time (ms)
|
|
||||||
avgrdwait.type GAUGE
|
|
||||||
avgrdwait.info Average wait time for a read I/O from request start to finish (includes queue times et al)
|
|
||||||
avgrdwait.min 0
|
|
||||||
avgwrwait.label Average Write IO Wait time (ms)
|
|
||||||
avgwrwait.type GAUGE
|
|
||||||
avgwrwait.info Average wait time for a write I/O from request start to finish (includes queue times et al)
|
|
||||||
avgwrwait.min 0
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
}
|
|
||||||
elsif ( $mode eq 'throughput' ) {
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
graph_title Disk throughput for /dev/$pretty_device
|
|
||||||
graph_args --base 1024
|
|
||||||
graph_vlabel Bytes/second
|
|
||||||
graph_category disk
|
|
||||||
|
|
||||||
rdbytes.label Read Bytes
|
|
||||||
rdbytes.type GAUGE
|
|
||||||
rdbytes.min 0
|
|
||||||
wrbytes.label Write Bytes
|
|
||||||
wrbytes.type GAUGE
|
|
||||||
wrbytes.min 0
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
elsif ( $mode eq 'iops' ) {
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
graph_title Disk IOs for /dev/$pretty_device
|
|
||||||
graph_args --base 1000
|
|
||||||
graph_vlabel Units/second
|
|
||||||
graph_category disk
|
|
||||||
|
|
||||||
rdio.label Read IO/sec
|
|
||||||
rdio.type GAUGE
|
|
||||||
rdio.min 0
|
|
||||||
wrio.label Write IO/sec
|
|
||||||
wrio.type GAUGE
|
|
||||||
wrio.min 0
|
|
||||||
avgrqsz.label Average Request Size (KiB)
|
|
||||||
avgrqsz.type GAUGE
|
|
||||||
avgrqsz.min 0
|
|
||||||
avgrdrqsz.label Average Read Request Size (KiB)
|
|
||||||
avgrdrqsz.type GAUGE
|
|
||||||
avgrdrqsz.min 0
|
|
||||||
avgwrrqsz.label Average Write Request Size (KiB)
|
|
||||||
avgwrrqsz.type GAUGE
|
|
||||||
avgwrrqsz.min 0
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
croak "Unknown mode $mode\n";
|
|
||||||
}
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
########
|
|
||||||
# MAIN #
|
|
||||||
########
|
|
||||||
|
|
||||||
|
|
||||||
my %cur_diskstat = fetch_device_counters($device);
|
|
||||||
|
|
||||||
|
|
||||||
my ( $prev_time, %prev_diskstat ) = restore_state();
|
|
||||||
|
|
||||||
save_state( time(), %cur_diskstat );
|
|
||||||
|
|
||||||
# Probably the first run for the given device, we need state to do our job,
|
|
||||||
# so let's wait for the next run.
|
|
||||||
exit if ( not defined $prev_time or not %prev_diskstat );
|
|
||||||
|
|
||||||
calculate_and_print_values( $prev_time, \%prev_diskstat, \%cur_diskstat );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
########
|
|
||||||
# SUBS #
|
|
||||||
########
|
|
||||||
|
|
||||||
sub calculate_and_print_values {
|
|
||||||
my ( $prev_time, $prev_stats, $cur_stats ) = @_;
|
|
||||||
|
|
||||||
my $bytes_per_sector = 512;
|
|
||||||
|
|
||||||
my $interval = time() - $prev_time;
|
|
||||||
|
|
||||||
my $read_ios = $cur_stats->{'rd_ios'} - $prev_stats->{'rd_ios'};
|
|
||||||
my $write_ios = $cur_stats->{'wr_ios'} - $prev_stats->{'wr_ios'};
|
|
||||||
|
|
||||||
my $rd_ticks = $cur_stats->{'rd_ticks'} - $prev_stats->{'rd_ticks'};
|
|
||||||
my $wr_ticks = $cur_stats->{'wr_ticks'} - $prev_stats->{'wr_ticks'};
|
|
||||||
|
|
||||||
my $rd_sectors = $cur_stats->{'rd_sectors'} - $prev_stats->{'rd_sectors'};
|
|
||||||
my $wr_sectors = $cur_stats->{'wr_sectors'} - $prev_stats->{'wr_sectors'};
|
|
||||||
|
|
||||||
my $tot_ticks = $cur_stats->{'tot_ticks'} - $prev_stats->{'tot_ticks'};
|
|
||||||
|
|
||||||
|
|
||||||
my $read_io_per_sec = $read_ios / $interval;
|
|
||||||
my $write_io_per_sec = $write_ios / $interval;
|
|
||||||
|
|
||||||
my $read_bytes_per_sec = $rd_sectors / $interval * $bytes_per_sector;
|
|
||||||
my $write_bytes_per_sec = $wr_sectors / $interval * $bytes_per_sector;
|
|
||||||
|
|
||||||
|
|
||||||
my $total_ios = $read_ios + $write_ios;
|
|
||||||
my $total_ios_per_sec = $total_ios / $interval;
|
|
||||||
|
|
||||||
# Utilization - or "how busy is the device"?
|
|
||||||
# If the time spent for I/O was close to 1000msec for
|
|
||||||
# a given second, the device is nearly 100% saturated.
|
|
||||||
my $utilization = $tot_ticks / $interval;
|
|
||||||
|
|
||||||
# Average time an I/O takes on the block device
|
|
||||||
my $servicetime =
|
|
||||||
$total_ios_per_sec ? $utilization / $total_ios_per_sec : 0;
|
|
||||||
|
|
||||||
# Average wait time for an I/O from start to finish
|
|
||||||
# (includes queue times et al)
|
|
||||||
my $average_wait = $total_ios ? ( $rd_ticks + $wr_ticks ) / $total_ios : 0;
|
|
||||||
my $average_rd_wait = $read_ios ? $rd_ticks / $read_ios : 0;
|
|
||||||
my $average_wr_wait = $write_ios ? $wr_ticks / $write_ios : 0;
|
|
||||||
|
|
||||||
my $average_rq_size_in_kb =
|
|
||||||
$total_ios
|
|
||||||
? ( $rd_sectors + $wr_sectors ) * $bytes_per_sector / 1024 / $total_ios
|
|
||||||
: 0;
|
|
||||||
my $average_rd_rq_size_in_kb =
|
|
||||||
$read_ios ? $rd_sectors * $bytes_per_sector / 1024 / $read_ios : 0;
|
|
||||||
my $average_wr_rq_size_in_kb =
|
|
||||||
$write_ios ? $wr_sectors * $bytes_per_sector / 1024 / $write_ios : 0;
|
|
||||||
|
|
||||||
my $util_print = $utilization / 10;
|
|
||||||
|
|
||||||
|
|
||||||
if ( $mode eq 'latency' ) {
|
|
||||||
print <<EOF;
|
|
||||||
|
|
||||||
util.value $util_print
|
|
||||||
svctm.value $servicetime
|
|
||||||
avgwait.value $average_wait
|
|
||||||
avgrdwait.value $average_rd_wait
|
|
||||||
avgwrwait.value $average_wr_wait
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
elsif ( $mode eq 'throughput' ) {
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
|
|
||||||
rdbytes.value $read_bytes_per_sec
|
|
||||||
wrbytes.value $write_bytes_per_sec
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
elsif ( $mode eq 'iops' ) {
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
|
|
||||||
rdio.value $read_io_per_sec
|
|
||||||
wrio.value $write_io_per_sec
|
|
||||||
avgrqsz.value $average_rq_size_in_kb
|
|
||||||
avgrdrqsz.value $average_rd_rq_size_in_kb
|
|
||||||
avgwrrqsz.value $average_wr_rq_size_in_kb
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
croak "Unknown mode $mode\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
sub read_diskstats {
|
|
||||||
|
|
||||||
open STAT, '< /proc/diskstats'
|
|
||||||
or croak "Failed to open '/proc/diskstats': $!\n";
|
|
||||||
|
|
||||||
my @lines;
|
|
||||||
|
|
||||||
for my $line (<STAT>) {
|
|
||||||
|
|
||||||
# Strip trailing newline and leading whitespace
|
|
||||||
chomp $line;
|
|
||||||
$line =~ s/^\s+//;
|
|
||||||
|
|
||||||
my @elems = split /\s+/, $line;
|
|
||||||
|
|
||||||
# We explicitly don't support old-style diskstats
|
|
||||||
# There are situations where only _some_ lines (e.g.
|
|
||||||
# partitions on older 2.6 kernels) have fewer stats
|
|
||||||
# numbers, therefore we'll skip them silently
|
|
||||||
if ( @elems != 14 ) {
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
push @lines, \@elems;
|
|
||||||
}
|
|
||||||
|
|
||||||
close STAT or croak "Failed to close '/proc/diskstats': $!";
|
|
||||||
return @lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub read_sysfs {
|
|
||||||
|
|
||||||
my ($want_device) = @_;
|
|
||||||
|
|
||||||
my @devices;
|
|
||||||
my @lines;
|
|
||||||
|
|
||||||
if ( defined $want_device ) {
|
|
||||||
|
|
||||||
# sysfs uses '!' as replacement for '/', e.g. cciss!c0d0
|
|
||||||
$want_device =~ tr#/#!#;
|
|
||||||
@devices = $want_device;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
@devices = glob "/sys/block/*/stat";
|
|
||||||
@devices = map { m!/sys/block/([^/]+)/stat! } @devices;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for my $cur_device (@devices) {
|
|
||||||
my $stats_file = "/sys/block/$cur_device/stat";
|
|
||||||
|
|
||||||
open STAT, "< $stats_file"
|
|
||||||
or croak "Failed to open '$stats_file': $!\n";
|
|
||||||
|
|
||||||
my $line = <STAT>;
|
|
||||||
|
|
||||||
# Trimming whitespace
|
|
||||||
$line =~ s/^\s+//;
|
|
||||||
chomp $line;
|
|
||||||
|
|
||||||
my @elems = split /\s+/, $line;
|
|
||||||
|
|
||||||
croak "'$stats_file' doesn't contain exactly 11 values. Aborting"
|
|
||||||
if ( @elems != 11 );
|
|
||||||
|
|
||||||
# Translate the devicename back before storing the information
|
|
||||||
$cur_device =~ tr#!#/#;
|
|
||||||
|
|
||||||
# Faking missing diskstats values
|
|
||||||
unshift @elems, ( '', '', $cur_device );
|
|
||||||
|
|
||||||
push @lines, \@elems;
|
|
||||||
|
|
||||||
close STAT or croak "Failed to close '$stats_file': $!\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
return @lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub parse_diskstats {
|
|
||||||
|
|
||||||
my ($want_device) = @_;
|
|
||||||
|
|
||||||
my @stats;
|
|
||||||
|
|
||||||
if ( glob "/sys/block/*/stat" ) {
|
|
||||||
|
|
||||||
@stats = read_sysfs($want_device);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
@stats = read_diskstats();
|
|
||||||
}
|
|
||||||
|
|
||||||
my %diskstats;
|
|
||||||
|
|
||||||
for my $entry (@stats) {
|
|
||||||
|
|
||||||
my %devstat;
|
|
||||||
|
|
||||||
# Hash-Slicing for fun and profit
|
|
||||||
@devstat{
|
|
||||||
qw(major minor devname
|
|
||||||
rd_ios rd_merges rd_sectors rd_ticks
|
|
||||||
wr_ios wr_merges wr_sectors wr_ticks
|
|
||||||
ios_in_prog tot_ticks rq_ticks)
|
|
||||||
}
|
|
||||||
= @{$entry};
|
|
||||||
|
|
||||||
$diskstats{ $devstat{'devname'} } = \%devstat;
|
|
||||||
}
|
|
||||||
|
|
||||||
return %diskstats;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub fetch_device_counters {
|
|
||||||
|
|
||||||
my ($want_device) = @_;
|
|
||||||
|
|
||||||
my %diskstats = parse_diskstats($want_device);
|
|
||||||
|
|
||||||
for my $devname ( keys %diskstats ) {
|
|
||||||
|
|
||||||
if ( $want_device eq $devname ) {
|
|
||||||
return %{ $diskstats{$devname} };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# We use '+' (and formerly '-') as placeholder for '/' in device-names
|
|
||||||
# used as calling name for the script.
|
|
||||||
sub translate_device_name {
|
|
||||||
|
|
||||||
my ($device, $mode) = @_;
|
|
||||||
|
|
||||||
if ($mode eq 'FROM_FS') {
|
|
||||||
|
|
||||||
# Hackaround to mitigate issues with unwisely chosen former separator
|
|
||||||
if ( not ($device =~ m/dm-\d+/)) {
|
|
||||||
$device =~ tr#-+#//#;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
elsif ($mode eq 'TO_FS') {
|
|
||||||
|
|
||||||
$device =~ tr#/#+#;
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
croak "translate_device_name: Unknown mode\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $device;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub fake_munin_plugin {
|
|
||||||
my $eval_code = <<'EOF';
|
|
||||||
|
|
||||||
use Storable;
|
|
||||||
my $storable_filename = basename($0);
|
|
||||||
$storable_filename = "/tmp/munin-state-$storable_filename";
|
|
||||||
|
|
||||||
sub save_state {
|
|
||||||
my @state = @_;
|
|
||||||
|
|
||||||
if ( not -e $storable_filename or -f $storable_filename ) {
|
|
||||||
store \@state, $storable_filename or croak "Failed to persist state to '$storable_filename': $!\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
croak "$storable_filename is probably not a regular file. Please delete it.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub restore_state {
|
|
||||||
|
|
||||||
if (-f $storable_filename) {
|
|
||||||
my $state = retrieve($storable_filename);
|
|
||||||
return @{$state};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
eval($eval_code);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub translate_devicemapper_name {
|
|
||||||
my ($device) = @_;
|
|
||||||
|
|
||||||
my ($want_minor) = $device =~ m/^dm-(\d+)$/;
|
|
||||||
|
|
||||||
croak "Failed to extract devicemapper id" unless defined ($want_minor);
|
|
||||||
|
|
||||||
my $dm_major = find_devicemapper_major();
|
|
||||||
croak "Failed to get device-mapper major number\n" unless defined $dm_major;
|
|
||||||
|
|
||||||
for my $entry (glob "/dev/mapper/\*") {
|
|
||||||
|
|
||||||
my $rdev = (stat($entry))[6];
|
|
||||||
my $major = floor($rdev / 256);
|
|
||||||
my $minor = $rdev % 256;
|
|
||||||
|
|
||||||
if ($major == $dm_major && $minor == $want_minor) {
|
|
||||||
|
|
||||||
my $pretty_name = translate_lvm_name($entry);
|
|
||||||
|
|
||||||
return defined $pretty_name ? $pretty_name : $entry;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# Return original string if the device can't be found.
|
|
||||||
return $device;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub translate_lvm_name {
|
|
||||||
|
|
||||||
my ($entry) = @_;
|
|
||||||
|
|
||||||
my $device_name = basename($entry);
|
|
||||||
|
|
||||||
# Check for single-dash-occurence to see if this could be a lvm devicemapper device.
|
|
||||||
if ($device_name =~ m/(?<!-)-(?!-)/) {
|
|
||||||
|
|
||||||
# split device name into vg and lv parts
|
|
||||||
my ($vg, $lv) = split /(?<!-)-(?!-)/, $device_name, 2;
|
|
||||||
return undef unless ( defined($vg) && defined($lv) );
|
|
||||||
|
|
||||||
# remove extraneous dashes from vg and lv names
|
|
||||||
$vg =~ s/--/-/g;
|
|
||||||
$lv =~ s/--/-/g;
|
|
||||||
|
|
||||||
$device_name = "$vg/$lv";
|
|
||||||
|
|
||||||
# Sanity check - does the constructed device name exist?
|
|
||||||
if (stat("/dev/$device_name")) {
|
|
||||||
return "$device_name";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub find_devicemapper_major {
|
|
||||||
|
|
||||||
open (FH, '< /proc/devices') or croak "Failed to open '/proc/devices': $!";
|
|
||||||
|
|
||||||
my $dm_major;
|
|
||||||
|
|
||||||
for my $line (<FH>) {
|
|
||||||
chomp $line;
|
|
||||||
|
|
||||||
my ($major, $name) = split /\s+/, $line, 2;
|
|
||||||
|
|
||||||
next unless defined $name;
|
|
||||||
|
|
||||||
if ($name eq 'device-mapper') {
|
|
||||||
$dm_major = $major;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(FH);
|
|
||||||
|
|
||||||
return $dm_major;
|
|
||||||
}
|
|
341
plugins/ipmi/freeipmi_
Executable file → Normal file
@ -1,228 +1,179 @@
|
|||||||
#!/usr/bin/python
|
#!/bin/sh
|
||||||
#
|
# -*- sh -*-
|
||||||
# Copyright (C) 2011,2012 Andreas Thienemann <andreas@bawue.net>
|
|
||||||
#
|
: << =cut
|
||||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
freeipmi_ - Munin plugin to retreive temperature and fan speed measurements
|
freeipmi_ - Plugin to monitor temperature or fan speed using FreeIPMI
|
||||||
from a local machine via IPMI.
|
|
||||||
|
|
||||||
=head1 APPLICABLE SYSTEMS
|
|
||||||
|
|
||||||
All machines with an IPMI capable baseboard management controller.
|
|
||||||
|
|
||||||
=head1 CONFIGURATION
|
=head1 CONFIGURATION
|
||||||
|
|
||||||
On most supported systems this plugin works nearly out of the box as long as
|
=head2 ENVIRONMENT VARIABLES
|
||||||
both Python and the freeipmi binaries in a semi-recent version are installed.
|
|
||||||
|
|
||||||
If the machine works out of the box can be tested by calling bmc-info.
|
When used to monitor a foreign host, this plugins use the variables
|
||||||
If there's text output, a bmc card was detected. If there's an entry for
|
IPMI_USERNAME and IPMI_PASSWORD to log in on the remote system.
|
||||||
"Sensor Device" visible in the "Additional Device Support" entry you're good.
|
|
||||||
|
|
||||||
If you get a "ipmi_cmd_get_device_id: driver timeout" message you have most
|
=head2 WILDCARD PLUGIN
|
||||||
likely no bmc to query.
|
|
||||||
|
|
||||||
In certain cases however bmc-info will just seem to hang for quite some time.
|
You can monitor either the current system (via /dev/ipmi0 and the
|
||||||
In this case, autodetection does not work because the smbios table has
|
like) or a remote system (via the LAN protocols), and for each of the
|
||||||
incorrect information. One system known to experience this problem is the
|
two options you can select your sensors:
|
||||||
HP Proliant Microserver.
|
|
||||||
|
|
||||||
Adding env.freeipmi_args "--no-probing --driver-type=KCS --driver-address=0xca2 --register-spacing=1"
|
- fans;
|
||||||
to the munin plugin configuration will make the plugin work. This is the
|
- temp;
|
||||||
specific line for the HP Proliant Microserver mentioned above. Your mileage
|
- power;
|
||||||
may vary.
|
- current;
|
||||||
|
- voltage.
|
||||||
|
|
||||||
Basic configuration for every system is that the plugin needs to be called as root.
|
When used for the local host, the plugin should be linked as, e.g.,
|
||||||
|
'ipmi_temp', whereas when used to monitor a foreign host it should be,
|
||||||
|
e.g., 'ipmi_192.168.0.253_temp'.
|
||||||
|
|
||||||
Add the following to your /etc/munin/plugin-conf.d/freeipmi:
|
=head1 NOTE
|
||||||
|
|
||||||
[freeipmi_*]
|
|
||||||
user root
|
|
||||||
|
|
||||||
=head1 INTERPRETATION
|
|
||||||
|
|
||||||
The plugin shows the temperature in Celsius or the fanspeed in rotations per minute.
|
|
||||||
|
|
||||||
=head1 MAGIC MARKERS
|
|
||||||
|
|
||||||
#%# family=contrib
|
|
||||||
#%# capabilities=autoconf suggest
|
|
||||||
|
|
||||||
=head1 VERSION
|
|
||||||
|
|
||||||
0.0.1
|
|
||||||
|
|
||||||
=head1 BUGS
|
|
||||||
|
|
||||||
Only local support for now. Remote could be hacked in via freeipmi_args for now.
|
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
Andreas Thienemann <andreas@bawue.net>
|
Rewritten by Diego Elio Pettenò <flameeyes@flameeyes.eu>.
|
||||||
|
Based on the work of Nicolai Langfeldt <janl@linpro.no>, Logilab and
|
||||||
|
Peter Palfrader.
|
||||||
|
|
||||||
=head1 LICENSE
|
=head1 LICENSE
|
||||||
|
|
||||||
GPLv3+
|
GPLv2
|
||||||
|
|
||||||
|
=head1 MAGIC MARKERS
|
||||||
|
|
||||||
|
#%# family=auto
|
||||||
|
#%# capabilities=autoconf suggest
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
"""
|
|
||||||
|
|
||||||
import subprocess
|
#### Parse commandline to determine what the job is
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import pprint
|
|
||||||
|
|
||||||
# Parse some environment variables
|
_ipmisensors() {
|
||||||
if os.getenv("freeipmi_args") is not None:
|
params="--quiet-cache --comma-separated-output --no-header-output --ignore-not-available-sensors"
|
||||||
freeipmi_args = " %s" % (os.getenv("freeipmi_args"))
|
if [ "x${hostname}" != "x" ]; then
|
||||||
else:
|
params="${params} --hostname=${hostname}"
|
||||||
freeipmi_args = ""
|
[ "x${IPMI_USERNAME}" != "x" ] && params="${params} --username=${IPMI_USERNAME}"
|
||||||
|
[ "x${IPMI_PASSWORD}" != "x" ] && params="${params} --password=${IPMI_PASSWORD}"
|
||||||
|
fi
|
||||||
|
|
||||||
# We are a wildcard plugin, figure out whether we are called for temp or fan
|
if ! ipmi-sensors ${params} --output-sensor-thresholds "$@"; then
|
||||||
if sys.argv[0].split("_")[1] == "temp":
|
ipmi-sensors ${params} "$@"
|
||||||
mode = "Temperature"
|
fi
|
||||||
elif sys.argv[0].split("_")[1] == "fan":
|
}
|
||||||
mode = "Fan"
|
|
||||||
else:
|
|
||||||
mode = None
|
|
||||||
|
|
||||||
def whereis(prog):
|
# extract and eventual hostname out of the called name; we
|
||||||
"""Check if prog can be found in the path and if yes, return the full pathname"""
|
# have to check whether it's set to "u" as that's what happens
|
||||||
prog = os.path.basename(prog)
|
# when the compatibility with ipmi_sensor_ is used.
|
||||||
for dir in os.getenv("PATH").split(":"):
|
hostname1=${0#*_}
|
||||||
for root, dirs, files in os.walk(dir):
|
hostname=${hostname1%%_*}
|
||||||
if prog in files:
|
if [ "x${hostname}" = "xu" -o "x${hostname}" = "x${hostname1}" ]; then
|
||||||
return os.path.join(dir, prog)
|
hostname=""
|
||||||
return None
|
fi
|
||||||
|
|
||||||
def normalize_sensor(name):
|
case $0 in
|
||||||
name = name.lower().replace("-","M").replace("+","P")
|
*_temp|*_u_degrees_c)
|
||||||
name = re.sub("[^a-z0-9A-Z]","_", name)
|
title="Temperatures"
|
||||||
return name
|
vlabel="degrees Celsius"
|
||||||
|
type=Temperature
|
||||||
|
unit=C
|
||||||
|
;;
|
||||||
|
*_fans|*_u_rpm)
|
||||||
|
title="Fan speeds"
|
||||||
|
vlabel="Rotations per Minute (RPM)"
|
||||||
|
type=Fan
|
||||||
|
unit=RPM
|
||||||
|
;;
|
||||||
|
*_power|*_u_watts)
|
||||||
|
title="Power consumption"
|
||||||
|
vlabel="Watts"
|
||||||
|
type=Current
|
||||||
|
unit=W
|
||||||
|
;;
|
||||||
|
*_current|*_u_amps)
|
||||||
|
title="Current drain"
|
||||||
|
vlabel="Amperes"
|
||||||
|
type=Current
|
||||||
|
unit=A
|
||||||
|
;;
|
||||||
|
*_voltage|*_u_volts)
|
||||||
|
title="Voltages"
|
||||||
|
vlabel="Volts"
|
||||||
|
type=Voltage
|
||||||
|
unit=V
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ x"$1" != x"autoconf" -a x"$1" != x"suggest" ]; then
|
||||||
|
echo "Please invoke as one of the supported sensors types:" >&2
|
||||||
|
echo freeipmi_{temp,fans,power,current} >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
# Code sniplet from Philipp Keller
|
case $1 in
|
||||||
# http://code.pui.ch/2007/02/19/set-timeout-for-a-shell-command-in-python/
|
autoconf)
|
||||||
def timeout_command(command, timeout):
|
if ! command -v ipmi-sensors >/dev/null 2>&1 ; then
|
||||||
"""call shell-command and either return its output or kill it
|
echo 'no (missing ipmi-sensors command)'
|
||||||
if it doesn't normally exit within timeout seconds and return None"""
|
exit 0
|
||||||
import subprocess, datetime, os, time, signal
|
fi
|
||||||
start = datetime.datetime.now()
|
|
||||||
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
while process.poll() is None:
|
|
||||||
time.sleep(0.1)
|
|
||||||
now = datetime.datetime.now()
|
|
||||||
if (now - start).seconds> timeout:
|
|
||||||
os.kill(process.pid, signal.SIGKILL)
|
|
||||||
os.waitpid(-1, os.WNOHANG)
|
|
||||||
return None
|
|
||||||
return process.stdout.read()
|
|
||||||
|
|
||||||
def bmc_detect():
|
if ! _ipmisensors -t OS_Boot >/dev/null 2>&1 ; then
|
||||||
"""Check whether there's a baseboard management controller we can query."""
|
echo 'no (unable to access IPMI device)'
|
||||||
if whereis("bmc-info") is None:
|
exit 0
|
||||||
print "no (bmc-info not found in path. Please install FreeIPMI.)"
|
fi
|
||||||
sys.exit(0)
|
|
||||||
else:
|
|
||||||
out = timeout_command("bmc-info%s" % (freeipmi_args), 2)
|
|
||||||
if out is not None and "[Sensor Device]" in out:
|
|
||||||
print "yes"
|
|
||||||
sys.exit(0)
|
|
||||||
else:
|
|
||||||
print "no (no supported bmc found)"
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
def read_sensors():
|
echo yes
|
||||||
"""Return all sensor data as a dict"""
|
exit 0
|
||||||
out = timeout_command("ipmi-sensors --verbose%s" % (freeipmi_args), 2)
|
;;
|
||||||
sensors = dict()
|
suggest)
|
||||||
sensor = dict()
|
_ipmisensors | awk -F, '
|
||||||
sensor_id = None
|
$3 == "Temperature" { print "temp"; }
|
||||||
for line in out.split("\n"):
|
$3 == "Fan" { print "fans"; }
|
||||||
if ":" in line:
|
$3 == "Current" && $5 == "W" { print "power"; }
|
||||||
k,v = line.split(": ")
|
$3 == "Current" && $5 == "A" { print "current"; }
|
||||||
if k == "Record ID":
|
$3 == "Voltage" { print "voltage"; }
|
||||||
sensor = dict()
|
'
|
||||||
sensor_id = int(v)
|
exit 0;;
|
||||||
sensor[k] = v
|
config)
|
||||||
else:
|
cat - <<EOF
|
||||||
sensor[k] = v
|
graph_title ${title} based on IPMI sensors
|
||||||
else:
|
graph_vlabel ${vlabel}
|
||||||
sensors[sensor_id] = sensor
|
graph_category Sensors
|
||||||
return sensors
|
EOF
|
||||||
|
|
||||||
def print_config():
|
if [ "x${hostname}" != "x" ]; then
|
||||||
"""Return configuration arguments for munin"""
|
echo "host_name ${hostname}"
|
||||||
print "graph_title FreeIPMI Sensors: %s" % (mode)
|
fi
|
||||||
if mode == "Fan":
|
;;
|
||||||
print "graph_vlabel RPM"
|
esac
|
||||||
print "graph_info This graph shows the RPMs of the fans as reported by IPMI"
|
|
||||||
elif mode == "Temperature":
|
|
||||||
print "graph_vlabel Degrees C"
|
|
||||||
print "graph_info This graph shows the temperatures as reported by IPMI"
|
|
||||||
print "graph_category sensors"
|
|
||||||
sensors = read_sensors()
|
|
||||||
|
|
||||||
for id in sorted(sensors):
|
_ipmisensors -t ${type} | awk -F, -v CONFIG=$1 -v UNIT=$unit '
|
||||||
if sensors[id]["Group Name"] == mode:
|
$5 == UNIT {
|
||||||
label = normalize_sensor(sensors[id]["Sensor Name"])
|
if ( CONFIG != "config" ) {
|
||||||
for n in ["Normal Max.", "Normal Min.", "Sensor Reading", "Lower Critical Threshold", "Upper Critical Threshold", "Lower Non-Critical Threshold", "Upper Non-Critical Threshold"]:
|
printf("ipmi%s.value %s\n", $1, $4);
|
||||||
sensors[id][n] = sensors[id][n].replace("NA","")
|
} else {
|
||||||
sensors[id][n] = sensors[id][n].split('.')[0]
|
printf("ipmi%s.label %s\n", $1, $2);
|
||||||
|
|
||||||
print "%s.label %s" % (label, label)
|
# This can only happen if FreeIPMI is new enough
|
||||||
print "%s.warning %s:%s" % (label, sensors[id]["Lower Non-Critical Threshold"], sensors[id]["Upper Non-Critical Threshold"])
|
if ( NF == 12 ) {
|
||||||
print "%s.critical %s:%s" % (label, sensors[id]["Lower Critical Threshold"], sensors[id]["Upper Critical Threshold"])
|
if ( $8 != "N/A" && $10 != "N/A" )
|
||||||
print "%s.graph_args --base 1000 -l 0" % (label)
|
printf("ipmi%s.warning %s:%s\n", $1, $8, $10);
|
||||||
print "%s.graph_scale no" % (label)
|
else if ( $8 == "N/A" && $10 != "N/A" )
|
||||||
# pprint.pprint(sensors[id])
|
printf("ipmi%s.warning :%s\n", $1, $10);
|
||||||
sys.exit(0)
|
else if ( $8 != "N/A" && $10 == "N/A" )
|
||||||
|
printf("ipmi%s.warning %s:\n", $1, $8);
|
||||||
|
|
||||||
def fetch():
|
if ( $7 != "N/A" && $11 != "N/A" )
|
||||||
sensors = read_sensors()
|
printf("ipmi%s.critical %s:%s\n", $1, $7, $11);
|
||||||
|
else if ( $7 == "N/A" && $11 != "N/A" )
|
||||||
|
printf("ipmi%s.critical :%s\n", $1, $11);
|
||||||
|
else if ( $7 != "N/A" && $11 == "N/A" )
|
||||||
|
printf("ipmi%s.critical %s:\n", $1, $7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
for id in sorted(sensors):
|
# vim: syntax=sh ts=4 et
|
||||||
if sensors[id]["Group Name"] == mode:
|
|
||||||
label = normalize_sensor(sensors[id]["Sensor Name"])
|
|
||||||
print "%s.value %s" % (label, sensors[id]["Sensor Reading"].split(".")[0])
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
if "config" in sys.argv[1:]:
|
|
||||||
print_config()
|
|
||||||
|
|
||||||
elif "autoconf" in sys.argv[1:]:
|
|
||||||
bmc_detect()
|
|
||||||
|
|
||||||
elif "suggest" in sys.argv[1:]:
|
|
||||||
sensors = read_sensors()
|
|
||||||
fan, temperature = [0, 0]
|
|
||||||
for id in sensors:
|
|
||||||
if sensors[id]["Group Name"] == "Fan":
|
|
||||||
fan += 1
|
|
||||||
elif sensors[id]["Group Name"] == "Temperature":
|
|
||||||
temperature += 1
|
|
||||||
if fan > 0:
|
|
||||||
print "fan"
|
|
||||||
if temperature > 0:
|
|
||||||
print "temp"
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
else:
|
|
||||||
fetch()
|
|
||||||
|
@ -1,95 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
from commands import getstatusoutput as gso
|
|
||||||
|
|
||||||
def safe(s):
|
|
||||||
s=s.replace("-", "_")
|
|
||||||
s=s.replace(" ", "_")
|
|
||||||
s=s.replace(".", "_")
|
|
||||||
return s
|
|
||||||
|
|
||||||
def config(data,title):
|
|
||||||
for i in data:
|
|
||||||
print "%s.label %s"%(safe(i[0]), i[0])
|
|
||||||
|
|
||||||
# check for non-critical thresholds
|
|
||||||
if i[6] != 'na':
|
|
||||||
if i[7] != 'na':
|
|
||||||
warning = "%s:%s"%(i[6],i[7])
|
|
||||||
else:
|
|
||||||
warning = "%s:"%i[6]
|
|
||||||
else:
|
|
||||||
if i[7] != 'na':
|
|
||||||
warning = "%s"%i[7]
|
|
||||||
else:
|
|
||||||
warning = ""
|
|
||||||
if warning:
|
|
||||||
print "%s.warning %s"%(safe(i[0]),warning)
|
|
||||||
|
|
||||||
# check for critical thresholds
|
|
||||||
if i[5] == 'na':
|
|
||||||
i[5] == i[4] # N/A, so see if there is a non-recoverable threshold
|
|
||||||
if i[8] == 'na':
|
|
||||||
i[8] == i[9] # N/A, so see if there is a non-recoverable threshold
|
|
||||||
if i[5] != 'na':
|
|
||||||
if i[8] != 'na':
|
|
||||||
critical = "%s:%s"%(i[5],i[8])
|
|
||||||
else:
|
|
||||||
critical = "%s:"%i[5]
|
|
||||||
else:
|
|
||||||
if i[8] != 'na':
|
|
||||||
critical = "%s"%i[8]
|
|
||||||
else:
|
|
||||||
critical = ""
|
|
||||||
if critical:
|
|
||||||
print "%s.critical %s"%(safe(i[0]),critical)
|
|
||||||
|
|
||||||
print "graph_title %s"%title
|
|
||||||
if title == "Voltages":
|
|
||||||
print "graph_args -X 0 --logarithmic -l 1 -u 15"
|
|
||||||
#print "graph_args --base 1000 --logarithmic"
|
|
||||||
else:
|
|
||||||
print "graph_args -l 0"
|
|
||||||
print "graph_vlabel %s"%i[2]
|
|
||||||
print "graph_period minute"
|
|
||||||
print "graph_category IPMI"
|
|
||||||
|
|
||||||
def get_data():
|
|
||||||
import sys
|
|
||||||
category = sys.argv[0].split("_",1)[1]
|
|
||||||
data = []
|
|
||||||
if category =="Fans":
|
|
||||||
ids = ("Fan 1 Tach", "Fan 2 Tach", "Fan 3 Tach",
|
|
||||||
"Fan 4 Tach", "Fan 5 Tach", "Fan 6 Tach",)
|
|
||||||
title = "Fan Speed"
|
|
||||||
elif category == "Temperature":
|
|
||||||
ids = ("Ambient Temp", "Memory Temp",)
|
|
||||||
title = "Temperatures"
|
|
||||||
elif category == "Voltage":
|
|
||||||
ids = ("Planar 1.5V", "Planar 1.8V",
|
|
||||||
"Planar 3.3V", "Planar 5V", "Planar 12V",
|
|
||||||
"Planar VBAT", "CPU 1 VCore", "CPU 2 VCore",)
|
|
||||||
title = "Voltages"
|
|
||||||
|
|
||||||
status, output = gso("ipmitool sensor")
|
|
||||||
for row in output.split("\n"):
|
|
||||||
items = map(str.strip,row.split("|"))
|
|
||||||
field,value,units,status,lower_nonrecoverable,lower_critical,lower_non_critical,upper_non_critical,upper_critical,upper_nonrecoverable=items
|
|
||||||
if field in ids:
|
|
||||||
if value == 'na': continue
|
|
||||||
data.append(items)
|
|
||||||
return data,title
|
|
||||||
|
|
||||||
def sample(data):
|
|
||||||
for i in data:
|
|
||||||
print "%s.value %s"%(safe(i[0]),i[1])
|
|
||||||
|
|
||||||
def main():
|
|
||||||
import sys
|
|
||||||
data,title = get_data()
|
|
||||||
if 'config' in sys.argv:
|
|
||||||
return config(data,title)
|
|
||||||
sample(data)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|
@ -1,114 +0,0 @@
|
|||||||
#! /usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# This plugin will graph the chassis fan speed on a Dell PowerEdge Server
|
|
||||||
# via the ipmi-sensors tool. It has been tested on the following chassis:
|
|
||||||
#
|
|
||||||
# PE1850
|
|
||||||
#
|
|
||||||
# To enable:
|
|
||||||
#
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi-fans /etc/munin/plugins/ipmi-fans
|
|
||||||
#
|
|
||||||
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
|
|
||||||
#
|
|
||||||
# [ipmi_fans]
|
|
||||||
# user - User that has permissions to run the omreport binary
|
|
||||||
# env.omreport - Path to the omreport binary
|
|
||||||
#
|
|
||||||
# Parameters:
|
|
||||||
#
|
|
||||||
# config
|
|
||||||
# autoconf
|
|
||||||
#
|
|
||||||
# Author: Alexx Roche <munin-ipmi-plugin@alexx.net>
|
|
||||||
# Built on the work of Justin Shepherd <galstrom21@gmail.com>
|
|
||||||
# Revision: 2.1 2011/01/10
|
|
||||||
#
|
|
||||||
#%# family=auto
|
|
||||||
#%# capabilities=autoconf
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
my $IPMI;
|
|
||||||
if(-f "/usr/sbin/ipmi-sensors"){ $IPMI='/usr/sbin/ipmi-sensors'; }
|
|
||||||
unless($IPMI){
|
|
||||||
$IPMI = `which ipmi-sensors 2>/dev/null|sed 's/.*no ipmi-sensors//'`;
|
|
||||||
#$IPMI = `echo -n \$(which ipmi-sensors)`;
|
|
||||||
}
|
|
||||||
chomp($IPMI);
|
|
||||||
unless($IPMI){ exit 1; }
|
|
||||||
|
|
||||||
if ($ARGV[0] && $ARGV[0] eq "autoconf"){
|
|
||||||
if (-f $IPMI){
|
|
||||||
print "yes\n";
|
|
||||||
}else{
|
|
||||||
print "no ($IPMI does not exist)\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
my $cmd = "$IPMI --verbose --sensors=\"\$(echo \$($IPMI |grep FAN|sed 's/:.*//'))\"";
|
|
||||||
#if ($ARGV[0] eq 'cmd'){ print $cmd; exit;};
|
|
||||||
my @result = `$cmd`;
|
|
||||||
my (%val, $index);
|
|
||||||
$index=0;
|
|
||||||
my $count=0;
|
|
||||||
#Four of these seem to be unlabled, I'm going to guess that they are the CPU(s) and HDD(s)
|
|
||||||
my @unknown = ('HDD0','HDD1','CPU0','CPU1');
|
|
||||||
foreach my $line (@result) {
|
|
||||||
$line =~ s/\s+/ /g;
|
|
||||||
$line =~ s/\s$//g;
|
|
||||||
if(!$line || $line eq ""){
|
|
||||||
$index++;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
my ($key, $val) = split(/\: /, $line);
|
|
||||||
unless($key){
|
|
||||||
# $index++;
|
|
||||||
# next;
|
|
||||||
}
|
|
||||||
if($key eq 'Sensor Name'){
|
|
||||||
if($val eq 'Temp'){
|
|
||||||
$val = $unknown[$count];
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
#my @data = split / /, $val;
|
|
||||||
#$data[2]=~s/^\(//;
|
|
||||||
#$data[2]=~s/\)$//;
|
|
||||||
#my($warn,$crit) = split/\//, $data[2];
|
|
||||||
$val{$index}{'Probe Name'} = "$val";
|
|
||||||
}elsif($key eq 'Upper Critical Threshold'){
|
|
||||||
$val=~s/ .*$//;
|
|
||||||
next unless $val=~m/^\d+\.\d+$/;
|
|
||||||
$val{$index}{'Critical Threshold'} = "$val";
|
|
||||||
}elsif($key eq 'Normal Max.'){
|
|
||||||
$val=~s/ .*//;
|
|
||||||
$val{$index}{'Warning Threshold'} = $val;
|
|
||||||
}elsif($key eq 'Sensor Reading'){
|
|
||||||
$val=~s/ .*//;
|
|
||||||
$val{$index}{'Reading'} = $val;
|
|
||||||
}elsif($key eq 'Sensor Max. Reading' && !$val{$index}{'Critical Threshold'}){
|
|
||||||
$val=~s/ .*$//;
|
|
||||||
$val{$index}{'Critical Threshold'} = "$val";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ARGV[0] && $ARGV[0] eq "config") {
|
|
||||||
print "graph_title IPMI - Fan Speeds\n";
|
|
||||||
print "graph_args --base 1000 -l 0\n";
|
|
||||||
print "graph_vlabel Speed in RPM\n";
|
|
||||||
print "graph_category Sensors\n";
|
|
||||||
foreach my $j (sort keys %val) {
|
|
||||||
print "probe_$j\.label $val{$j}{'Probe Name'}\n";
|
|
||||||
print "probe_$j\.warning $val{$j}{'Warning Threshold'}\n";
|
|
||||||
print "probe_$j\.critical $val{$j}{'Critical Threshold'}\n";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
foreach my $j (sort keys %val) {
|
|
||||||
if($val{$j}{'Reading'}){
|
|
||||||
print "probe_$j.value $val{$j}{'Reading'}\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit(0);
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# IPMI data gathering for munin.
|
|
||||||
#
|
|
||||||
# Author: 2008 Benjamin Pineau <ben.pineau@gmail.com>
|
|
||||||
# This work is hereby released into the Public Domain.
|
|
||||||
# To view a copy of the public domain dedication, visit
|
|
||||||
# http://creativecommons.org/licenses/publicdomain/
|
|
||||||
#
|
|
||||||
# Requirements :
|
|
||||||
#
|
|
||||||
# - ipmitool command line utility (and kernel drivers)
|
|
||||||
# - access rights to /dev/ipmi0 device (ie, root privileges
|
|
||||||
# can be configured in /etc/munin/plugin-conf.d/munin-node)
|
|
||||||
#
|
|
||||||
# Parameters supported:
|
|
||||||
#
|
|
||||||
# config
|
|
||||||
# autoconf
|
|
||||||
#
|
|
||||||
# Setup :
|
|
||||||
#
|
|
||||||
# ipmitool sdr || echo "please load IPMI kernel modules"
|
|
||||||
# cp ipmi_sdr_ /usr/share/munin/plugins/
|
|
||||||
# chmod +x /usr/share/munin/plugins/ipmi_sdr_
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi_sdr_ /etc/munin/plugins/ipmi_sdr_fan
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi_sdr_ /etc/munin/plugins/ipmi_sdr_current
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi_sdr_ /etc/munin/plugins/ipmi_sdr_voltage
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi_sdr_ /etc/munin/plugins/ipmi_sdr_temperature
|
|
||||||
# echo -e "\n[ipmi_sdr*]\nuser root\ntimeout 15\n" >> /etc/munin/plugin-conf.d/munin-node
|
|
||||||
# /etc/init.d/munin-node restart
|
|
||||||
#
|
|
||||||
# Magic markers
|
|
||||||
#%# family=auto
|
|
||||||
#%# capabilities=autoconf
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
$ENV{'LANG'} = 'C';
|
|
||||||
$ENV{'LC_ALL'} = 'C';
|
|
||||||
|
|
||||||
my $ipmidump = $ENV{'ipmidump'} || '/var/lib/munin/plugin-state/ipmi_sdr';
|
|
||||||
my $ipmitool = $ENV{'ipmitool'} || 'ipmitool';
|
|
||||||
my $drefresh = $ENV{'drefresh'} || 86400;
|
|
||||||
|
|
||||||
my %sensors;
|
|
||||||
|
|
||||||
my $desc = {
|
|
||||||
'fan' => {
|
|
||||||
'graph_title' => 'Fans rotations per minute',
|
|
||||||
'graph_vlabel' => 'RPM',
|
|
||||||
'graph_info' => 'Fans rotations per minute',
|
|
||||||
},
|
|
||||||
'voltage' => {
|
|
||||||
'graph_title' => 'Electrical tensions',
|
|
||||||
'graph_vlabel' => 'Volts',
|
|
||||||
'graph_info' => 'Electrical tensions',
|
|
||||||
},
|
|
||||||
'temperature' => {
|
|
||||||
'graph_title' => 'Hardware temperatures',
|
|
||||||
'graph_vlabel' => 'Degrees Celsius',
|
|
||||||
'graph_info' => 'Hardware temperature sensors output',
|
|
||||||
},
|
|
||||||
'current' => {
|
|
||||||
'graph_title' => 'Hardware power consumption',
|
|
||||||
'graph_vlabel' => 'Watts or Amperes',
|
|
||||||
'graph_info' => 'Hardware power consumption',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
my $stype = $0 =~ /.*ipmi_sdr_(\w+)$/ ? lc($1) : 'temperature';
|
|
||||||
|
|
||||||
if (!defined($desc->{"$stype"})) {
|
|
||||||
printf STDERR "Unknown sensor type : '$stype'. Aborting.\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub strip_spaces($) {
|
|
||||||
(my $s = shift) =~ s/^\s*(.*?)\s*\n?$/$1/;
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub normalize_name($) {
|
|
||||||
(my $l = lc(strip_spaces(shift))) =~ tr/\t ./_/;
|
|
||||||
return $l;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub sdrlist_parse(@) {
|
|
||||||
foreach(@_) {
|
|
||||||
next unless /^([^\|]+)\s*\|\s*(\w+)\s*\|[^\|]+\|[^\|]+\|\s*([\d\.]+)\s+/;
|
|
||||||
$sensors{$_}{"name"} = strip_spaces($1);
|
|
||||||
$sensors{$_}{"value"} = strip_spaces($3);
|
|
||||||
$sensors{$_}{"label"} = normalize_name($1) . normalize_name($2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined $ARGV[0] and $ARGV[0] eq 'autoconf') {
|
|
||||||
`$ipmitool help 2> /dev/null`;
|
|
||||||
if ($?) {
|
|
||||||
print "no ($ipmitool not found)";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
`$ipmitool sdr dump $ipmidump`;
|
|
||||||
if ($?) {
|
|
||||||
printf "no (ipmitool sdr dump returned code %d)\n", $? >> 8;
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
`$ipmitool sdr type $stype -S $ipmidump`;
|
|
||||||
if ($?) {
|
|
||||||
print "no (ipmitool didn't found any sensor of type ";
|
|
||||||
printf "'$stype', returned code %d)\n", $? >> 8;
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "yes\n";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
# "ipmitool dump" dumps speeds up data retreival big time, by avoiding
|
|
||||||
# IPMI sensors autodiscovery. This only caches sensors names/types/ids
|
|
||||||
# (not values/datas), so we can have a very long cache lifetime policy.
|
|
||||||
if (-f $ipmidump) {
|
|
||||||
unlink($ipmidump) if (time - (stat($ipmidump))[9] >= $drefresh);
|
|
||||||
}
|
|
||||||
|
|
||||||
unless (-f $ipmidump) {
|
|
||||||
`$ipmitool sdr dump $ipmidump` || die $!;
|
|
||||||
}
|
|
||||||
|
|
||||||
(my @dt = `$ipmitool sdr type $stype -S $ipmidump`) || die $!;
|
|
||||||
sdrlist_parse(@dt);
|
|
||||||
|
|
||||||
if (defined($ARGV[0]) && $ARGV[0] eq "config") {
|
|
||||||
print "graph_category system\n";
|
|
||||||
print "graph_title " . $desc->{$stype}->{"graph_title"} . "\n";
|
|
||||||
print "graph_vlabel " . $desc->{$stype}->{"graph_vlabel"} . "\n";
|
|
||||||
print "graph_info " . $desc->{$stype}->{"graph_info"} . "\n";
|
|
||||||
|
|
||||||
foreach my $v (values(%sensors)) {
|
|
||||||
print $v->{"label"} . ".label " . $v->{"name"} . "\n";
|
|
||||||
print $v->{"label"} . ".type GAUGE\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $v (values(%sensors)) {
|
|
||||||
print $v->{"label"} . ".value " . $v->{"value"} . "\n";
|
|
||||||
}
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
|||||||
#! /usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# This plugin will graph the chassis temp sensors on a Dell PowerEdge Server
|
|
||||||
# via the ipmi-sensors tool. It has been tested on the following chassis:
|
|
||||||
#
|
|
||||||
# PE1850
|
|
||||||
#
|
|
||||||
# To enable:
|
|
||||||
#
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmi-therm /etc/munin/plugins/ipmi-therm
|
|
||||||
#
|
|
||||||
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
|
|
||||||
#
|
|
||||||
# [ipmi_therm]
|
|
||||||
# user - User that has permissions to run ipmi-sensors
|
|
||||||
# env.category sensors
|
|
||||||
#
|
|
||||||
# Parameters:
|
|
||||||
#
|
|
||||||
# config
|
|
||||||
# autoconf
|
|
||||||
#
|
|
||||||
# Author: Alexx Roche <munin-ipmi-plugin@alexx.net>
|
|
||||||
# Built on the work of Justin Shepherd <galstrom21@gmail.com>
|
|
||||||
# Revision: 1.3 2011/01/10
|
|
||||||
#
|
|
||||||
#%# family=auto
|
|
||||||
#%# capabilities=autoconf
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
my $IPMI;
|
|
||||||
if(-f "/usr/sbin/ipmi-sensors"){ $IPMI='/usr/sbin/ipmi-sensors'; }
|
|
||||||
unless($IPMI){
|
|
||||||
$IPMI = `which ipmi-sensors 2>/dev/null|sed 's/.*no ipmi-sensors//'`;
|
|
||||||
#$IPMI = `echo -n \$(which ipmi-sensors)`;
|
|
||||||
}
|
|
||||||
chomp($IPMI);
|
|
||||||
unless($IPMI){ exit 1; }
|
|
||||||
|
|
||||||
if ($ARGV[0] && $ARGV[0] eq "autoconf"){
|
|
||||||
if (-f $IPMI){
|
|
||||||
print "yes\n";
|
|
||||||
}else{
|
|
||||||
print "no ($IPMI does not exist)\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
my $cmd = "$IPMI|grep Temp";
|
|
||||||
my @result = `$cmd`;
|
|
||||||
my (%val, $index);
|
|
||||||
$index=0;
|
|
||||||
my $count=0;
|
|
||||||
#Four of these seem to be unlabled, I'm going to guess that they are the CPU(s) and HDD(s)
|
|
||||||
my @unknown = ('CPU0','CPU1','HDD0','HDD1');
|
|
||||||
foreach my $line (@result) {
|
|
||||||
$line =~ s/\s+/ /g;
|
|
||||||
$line =~ s/\s$//g;
|
|
||||||
next if ($line eq "");
|
|
||||||
my ($list, $field, $value, $state) = split(/\: /, $line);
|
|
||||||
#print "L: $list F: $field V: $value S: $state\n";
|
|
||||||
if($field=~m/^(Temp|Ambient|Planar|Riser)/) {
|
|
||||||
my $f=$1;
|
|
||||||
if($f eq 'Temp'){
|
|
||||||
$f = $unknown[$count];
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
my @data = split / /, $value;
|
|
||||||
$data[2]=~s/^\(//;
|
|
||||||
$data[2]=~s/\)$//;
|
|
||||||
if($f){
|
|
||||||
my($warn,$crit) = split/\//, $data[2];
|
|
||||||
unless($warn=~m/\d+/){ $warn = 0; }
|
|
||||||
unless($crit=~m/\d+/){ $crit = 200; }
|
|
||||||
$val{$index}{'Probe Name'} = "$f";
|
|
||||||
$val{$index}{'Reading'} = "$data[0]";
|
|
||||||
$val{$index}{'Warning Threshold'} = ($crit - $warn);
|
|
||||||
$val{$index}{'Critical Threshold'} = "$crit";
|
|
||||||
$index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ARGV[0] && $ARGV[0] eq "config") {
|
|
||||||
print "graph_title IPMI sensors - Temperature Probes\n";
|
|
||||||
print "graph_args --base 1000 -l 0\n";
|
|
||||||
print "graph_vlabel Temperature in Celsius\n";
|
|
||||||
print "graph_category Sensors\n";
|
|
||||||
foreach my $j (sort keys %val) {
|
|
||||||
print "probe_$j\.label $val{$j}{'Probe Name'}\n";
|
|
||||||
print "probe_$j\.warning $val{$j}{'Warning Threshold'}\n";
|
|
||||||
print "probe_$j\.critical $val{$j}{'Critical Threshold'}\n";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
foreach my $j (sort keys %val) {
|
|
||||||
if($val{$j}{'Reading'}){
|
|
||||||
print "probe_$j.value $val{$j}{'Reading'}\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit(0);
|
|
||||||
|
|
@ -1,865 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# ipmisens3
|
|
||||||
# Munin plugin to read IPMI sensor data
|
|
||||||
# Zoltan HERPAI (c) 2009 <wigyori@uid0.hu>
|
|
||||||
#
|
|
||||||
# Symlink this script into your /etc/munin/plugins directory in the
|
|
||||||
# following way:
|
|
||||||
#
|
|
||||||
# ipmisens2_[machine]_[sensors]
|
|
||||||
#
|
|
||||||
# Supported machines:
|
|
||||||
# - Asus K8N-LR: asmb2 (temp, volt, fan)
|
|
||||||
# - Dell DCS-XS23: xs23 (temp, volt, fan)
|
|
||||||
# - Dell M610 blade: m610 (temp)
|
|
||||||
# - Dell PowerEdge 2650: pe2650 (temp, volt, fan)
|
|
||||||
# - Fujitsu TX120: tx120 (temp, volt, fan)
|
|
||||||
# - HP Proliant ML350G5: proliantg5 (temp)
|
|
||||||
# - HP Proliant DL380G5: proliantg5 (temp)
|
|
||||||
# - HP Proliant DL385G1: hpasmcli (temp, fan)
|
|
||||||
# - IBM HS21/HS22/Dataplex DX360: ibmhsxx (volt)
|
|
||||||
# - IBM LS20/LS21: ibmlsxx (temp, volt)
|
|
||||||
# - IBM LS41: ibmls4x (temp, volt)
|
|
||||||
# - IBM x3200/x3550: ibmx3xx0 (temp, volt, fan)
|
|
||||||
# - IBM x346: x346 (temp, volt, fan)
|
|
||||||
# - Intel SHG2 mainboard: shg2 (temp, volt, fan)
|
|
||||||
# - Sun x2100/2100m2/2200/2200m2: x2100 (temp, volt, fan)
|
|
||||||
# - Sun x2250: x2250 (temp, volt, fan)
|
|
||||||
# - Sun x2270: x2270 (temp, volt, fan)
|
|
||||||
# - Sun x4100/4100m2/4200/4200m2/4600: x4x00 (temp, volt, fan)
|
|
||||||
# - Sun x4150: x4150 (temp, volt, fan)
|
|
||||||
# - Sun V20z (V40z?): v20z (temp, volt, fan)
|
|
||||||
# - Supermicro X7DB8/X7DCL: aocipmi20e (temp, volt, fan)
|
|
||||||
# - Supermicro X8DT6/X8DTT-F: hermon (temp, volt, fan)
|
|
||||||
# - Verari VB1205XM: vb1205 (temp, volt)
|
|
||||||
#
|
|
||||||
# Supported but not tested:
|
|
||||||
# - HP DL145G2: asmb2 (temp, volt, fan)
|
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# - hpasmcli machtype requires HP's hpasmcli package, and the additional
|
|
||||||
# hpasmcliget script.
|
|
||||||
#
|
|
||||||
# Outputs submitted by:
|
|
||||||
# - Zoltan LAJBER <lajbi@lajli.gau.hu>
|
|
||||||
# - Gergely MADARASZ <gorgo@broadband.hu>
|
|
||||||
# - Louis van Belle <louis@van-belle.nl>
|
|
||||||
# - Andras GOT <andrej@antiszoc.hu>
|
|
||||||
# - Andras KORN <korn@chardonnay.math.bme.hu>
|
|
||||||
# - Tamas TEVESZ <ice@extreme.hu>
|
|
||||||
# - Gergely TOMKA <gergely@tomka.hu>
|
|
||||||
# - Gabor SZOLLOSI <dev@localnet.hu>
|
|
||||||
# - Reka KAROLYI <reka@karolyi.eu>
|
|
||||||
# - Andras HORVATH <Andras.Horvath@cern.ch>
|
|
||||||
#
|
|
||||||
# CHANGELOG
|
|
||||||
#
|
|
||||||
# Revision 3.01 2010/09/23 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Add support for handling non-ipmitool-based machtypes
|
|
||||||
# * Add support for HP Proliant DL385G1
|
|
||||||
#
|
|
||||||
# Revision 3.00 2010/05/25 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Add support for Supermicro X7DB8 via AOC IPMI20-E (aocipmi20e)
|
|
||||||
# * Add support for Supermicro X7DCL via AOC IPMI20-E (aocipmi20e)
|
|
||||||
# * Add support for Supermicro X8DT6 via Winbond Hermon BMC (hermon)
|
|
||||||
# * Add support for Supermicro X8DTT-F via Winbond Hermon BMC (hermon)
|
|
||||||
# * Add support for Dell M610 (m610)
|
|
||||||
# * Add support for HP DL380G5 (proliantg5)
|
|
||||||
# * Add support for HP ML350G5 (proliantg5)
|
|
||||||
# * Re-add support for Asus K8N-LR via ASMB2 (asmb2)
|
|
||||||
# * Add to-be-tested support for HP DL145G2 as per Paulo@muninexchange (asmb2)
|
|
||||||
#
|
|
||||||
# Revision 3.00early4 2010/01/09 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Add support for IBM HS22 (ibmhsxx)
|
|
||||||
# * Add support for IBM iDataplex DX360 (ibmhsxx)
|
|
||||||
# * Add support for Dell DCS XS23-sc (xs23)
|
|
||||||
#
|
|
||||||
# Revision 3.00early3 2009/12/30 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Support for easier debugging ($debug)
|
|
||||||
# * Add support for IBM LS41 (ibmls4x)
|
|
||||||
# * Add complete support for Sun x2270 (x2270)
|
|
||||||
# * Add support for Sun x4500 (x4x00)
|
|
||||||
# * Add support for Fujitsu-Siemens TX120 (tx120)
|
|
||||||
#
|
|
||||||
# Revision 3.00early2 2009/09/09 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Minor bugfix due to munin brain damage
|
|
||||||
#
|
|
||||||
# Revision 3.00early 2009/09/01 Zoltan HERPAI <wigyori@uid0.hu>
|
|
||||||
# * Complete rewrite in perl.
|
|
||||||
# * Sun x2100, x2100M2 and x2200 are now supported in 'x2100' machtype
|
|
||||||
# * Bunch of new machtypes are supported
|
|
||||||
#
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use POSIX;
|
|
||||||
use FindBin qw($Script);
|
|
||||||
|
|
||||||
my $IPMITOOL = '/usr/bin/ipmitool';
|
|
||||||
my $curtime = time();
|
|
||||||
my $TEMPFILE = "/var/lib/munin/plugin-state/ipmisens3";
|
|
||||||
# set the ipmidump expiration to 1 day
|
|
||||||
my $TEMPREFRESH = 86400;
|
|
||||||
my $debug = 0;
|
|
||||||
my $devel = 0;
|
|
||||||
|
|
||||||
##############
|
|
||||||
# You should not need to edit anything below here
|
|
||||||
#
|
|
||||||
$ENV{PATH} = '/bin:/usr/bin:/usr/sbin';
|
|
||||||
$ENV{IFS} = "\n";
|
|
||||||
|
|
||||||
$0 =~ /.*_(.*)_(.*)/;
|
|
||||||
my $machine = $1;
|
|
||||||
my $sensor = $2;
|
|
||||||
|
|
||||||
# Test if ipmitool is available
|
|
||||||
if ( !$devel )
|
|
||||||
{
|
|
||||||
if ( $machine ne 'hpasmcli' ) {
|
|
||||||
`$IPMITOOL help 2> /dev/null`;
|
|
||||||
if ($?)
|
|
||||||
{
|
|
||||||
print "no ($IPMITOOL not found)";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print "Machine: $machine , sensor: $sensor\n" if ($debug);
|
|
||||||
|
|
||||||
# check expiration time of the dumpfile
|
|
||||||
if ( !$devel )
|
|
||||||
{
|
|
||||||
if ( $machine ne 'hpasmcli' ) {
|
|
||||||
if ( -f $TEMPFILE && $curtime - (stat($TEMPFILE))[9] >= $TEMPREFRESH )
|
|
||||||
{
|
|
||||||
print "Unlinking $TEMPFILE...\n" if ($debug);
|
|
||||||
unlink ($TEMPFILE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !$devel )
|
|
||||||
{
|
|
||||||
if ( $machine ne 'hpasmcli' ) {
|
|
||||||
if ( ! -f $TEMPFILE )
|
|
||||||
{
|
|
||||||
print "Writing dumpfile $TEMPFILE...\n" if ($debug);
|
|
||||||
`$IPMITOOL sdr dump $TEMPFILE` || die $!;
|
|
||||||
if ($?)
|
|
||||||
{
|
|
||||||
print "no (retcode $?)\n";
|
|
||||||
exit 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
my @ipmioutput;
|
|
||||||
|
|
||||||
# Read the sensors
|
|
||||||
if ( $machine ne 'hpasmcli' ) {
|
|
||||||
@ipmioutput = `$IPMITOOL sdr -S $TEMPFILE`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
@ipmioutput = `cat /tmp/ipmi-sensors`;
|
|
||||||
}
|
|
||||||
#my @ipmioutput = `cat ~wigyori/ipmisens2/outputs/hp_ml350g5`;
|
|
||||||
|
|
||||||
if ($?)
|
|
||||||
{
|
|
||||||
print "no (retcode $?)\n";
|
|
||||||
exit 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $arg;
|
|
||||||
if ( defined($ARGV[0]) && $ARGV[0] ne "" )
|
|
||||||
{
|
|
||||||
print "argv: ".$ARGV[0]."\n" if ($debug);
|
|
||||||
if ( $ARGV[0] eq 'config' ) { $arg = 'config'; }
|
|
||||||
if ( $ARGV[0] eq 'autoconf' ) { $arg = 'autoconf'; }
|
|
||||||
|
|
||||||
if ( $arg eq 'autoconf' ) { print "no\n"; exit 0; }
|
|
||||||
|
|
||||||
my %cnf;
|
|
||||||
if ( $arg eq 'config' )
|
|
||||||
{
|
|
||||||
# Base sensor config
|
|
||||||
if ( $sensor eq 'temp' )
|
|
||||||
{
|
|
||||||
%cnf = (
|
|
||||||
'graph_title' => 'Temperature',
|
|
||||||
'graph_vlabel' => 'C',
|
|
||||||
'graph_category' => 'sensors',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'volt' )
|
|
||||||
{
|
|
||||||
%cnf = (
|
|
||||||
'graph_title' => 'Voltages',
|
|
||||||
'graph_vlabel' => 'Volts',
|
|
||||||
'graph_category' => 'sensors',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'fan' )
|
|
||||||
{
|
|
||||||
if ( $machine ne 'hpasmcli' ) {
|
|
||||||
%cnf = (
|
|
||||||
'graph_title' => 'Fan speeds',
|
|
||||||
'graph_vlabel' => 'RPM',
|
|
||||||
'graph_category' => 'sensors',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
%cnf = (
|
|
||||||
'graph_title' => 'Fan speeds',
|
|
||||||
'graph_vlabel' => '%',
|
|
||||||
'graph_category' => 'sensors',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Static descriptors
|
|
||||||
my %base;
|
|
||||||
|
|
||||||
# Sun x4100
|
|
||||||
$base{'x4x00'}->{'mbt_amb'} = 'Mainboard';
|
|
||||||
$base{'x4x00'}->{'fpt_amb'} = 'FP';
|
|
||||||
$base{'x4x00'}->{'pdbt_amb'} = 'PSU';
|
|
||||||
$base{'x4x00'}->{'iot_amb'} = 'Disks';
|
|
||||||
$base{'x4x00'}->{'p0t_core'} = 'CPU0';
|
|
||||||
$base{'x4x00'}->{'p1t_core'} = 'CPU1';
|
|
||||||
$base{'x4x00'}->{'ft0fm0f0'} = 'ft0.fm0.f0';
|
|
||||||
$base{'x4x00'}->{'ft0fm1f0'} = 'ft0.fm1.f0';
|
|
||||||
$base{'x4x00'}->{'ft0fm2f0'} = 'ft0.fm2.f0';
|
|
||||||
$base{'x4x00'}->{'ft0fm0f1'} = 'ft0.fm0.f1';
|
|
||||||
$base{'x4x00'}->{'ft0fm1f1'} = 'ft0.fm1.f1';
|
|
||||||
$base{'x4x00'}->{'ft0fm2f1'} = 'ft0.fm2.f1';
|
|
||||||
$base{'x4x00'}->{'ft1fm0f0'} = 'ft1.fm0.f0';
|
|
||||||
$base{'x4x00'}->{'ft1fm1f0'} = 'ft1.fm1.f0';
|
|
||||||
$base{'x4x00'}->{'ft1fm2f0'} = 'ft1.fm2.f0';
|
|
||||||
$base{'x4x00'}->{'ft1fm0f1'} = 'ft1.fm0.f1';
|
|
||||||
$base{'x4x00'}->{'ft1fm1f1'} = 'ft1.fm1.f1';
|
|
||||||
$base{'x4x00'}->{'ft1fm2f1'} = 'ft1.fm2.f1';
|
|
||||||
$base{'x4x00'}->{'mbv_bat'} = 'BAT';
|
|
||||||
$base{'x4x00'}->{'mbv_3v3stby'} = '3.3VSTBY';
|
|
||||||
$base{'x4x00'}->{'mbv_3v3'} = '3.3V';
|
|
||||||
$base{'x4x00'}->{'mbv_5v'} = '5V';
|
|
||||||
$base{'x4x00'}->{'mbv_12v'} = '+12V';
|
|
||||||
$base{'x4x00'}->{'mbv_dash12v'} = '-12V';
|
|
||||||
$base{'x4x00'}->{'mbv_2v5core'} = 'MB 2.5V';
|
|
||||||
$base{'x4x00'}->{'mbv_1v8core'} = 'MB 1.8V';
|
|
||||||
$base{'x4x00'}->{'mbv_1v2core'} = 'MB 1.2V';
|
|
||||||
$base{'x4x00'}->{'p0v_1v5'} = 'CPU0 1.5V';
|
|
||||||
$base{'x4x00'}->{'p0v_2v5core'} = 'CPU0 2.5V';
|
|
||||||
$base{'x4x00'}->{'p0v_1v25core'} = 'CPU0 1.25V';
|
|
||||||
$base{'x4x00'}->{'p1v_1v5'} = 'CPU1 1.5V';
|
|
||||||
$base{'x4x00'}->{'p1v_2v5core'} = 'CPU1 2.5V';
|
|
||||||
$base{'x4x00'}->{'p1v_1v25core'} = 'CPU1 1.25V';
|
|
||||||
# Sun x4100m2 extents
|
|
||||||
$base{'x4x00'}->{'mbv_1v5core'} = 'MB 1.5V';
|
|
||||||
$base{'x4x00'}->{'p0v_vddio'} = 'CPU0 VDDIO';
|
|
||||||
$base{'x4x00'}->{'p0v_vdd'} = 'CPU0 VDD';
|
|
||||||
$base{'x4x00'}->{'p0v_vtt'} = 'CPU0 VTT';
|
|
||||||
$base{'x4x00'}->{'p1v_vddio'} = 'CPU1 VDDIO';
|
|
||||||
$base{'x4x00'}->{'p1v_vdd'} = 'CPU1 VDD';
|
|
||||||
$base{'x4x00'}->{'p1v_vtt'} = 'CPU1 VTT';
|
|
||||||
# Sun x4600 voltage extents
|
|
||||||
$base{'x4x00'}->{'mbv_1v2'} = 'MB +1.2V';
|
|
||||||
$base{'x4x00'}->{'mbv_1v5'} = 'MB +1.5V';
|
|
||||||
$base{'x4x00'}->{'mbv_2v5'} = 'MB +2.5V';
|
|
||||||
$base{'x4x00'}->{'mbv_3v3aux_r'} = 'MB +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p0v_12v'} = 'CPU0 module +12V';
|
|
||||||
$base{'x4x00'}->{'p1v_12v'} = 'CPU1 module +12V';
|
|
||||||
$base{'x4x00'}->{'p2v_12v'} = 'CPU2 module +12V';
|
|
||||||
$base{'x4x00'}->{'p3v_12v'} = 'CPU3 module +12V';
|
|
||||||
$base{'x4x00'}->{'p4v_12v'} = 'CPU4 module +12V';
|
|
||||||
$base{'x4x00'}->{'p5v_12v'} = 'CPU5 module +12V';
|
|
||||||
$base{'x4x00'}->{'p6v_12v'} = 'CPU6 module +12V';
|
|
||||||
$base{'x4x00'}->{'p7v_12v'} = 'CPU7 module +12V';
|
|
||||||
$base{'x4x00'}->{'p0v_2v5'} = 'CPU0 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p1v_2v5'} = 'CPU1 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p2v_2v5'} = 'CPU2 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p3v_2v5'} = 'CPU3 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p4v_2v5'} = 'CPU4 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p5v_2v5'} = 'CPU5 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p6v_2v5'} = 'CPU6 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p7v_2v5'} = 'CPU7 module +2.5V';
|
|
||||||
$base{'x4x00'}->{'p0v_1v2'} = 'CPU0 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p1v_1v2'} = 'CPU1 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p2v_1v2'} = 'CPU2 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p3v_1v2'} = 'CPU3 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p4v_1v2'} = 'CPU4 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p5v_1v2'} = 'CPU5 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p6v_1v2'} = 'CPU6 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p7v_1v2'} = 'CPU7 module +1.2V';
|
|
||||||
$base{'x4x00'}->{'p0v_3v3aux_r'} = 'CPU0 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p1v_3v3aux_r'} = 'CPU1 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p2v_3v3aux_r'} = 'CPU2 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p3v_3v3aux_r'} = 'CPU3 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p4v_3v3aux_r'} = 'CPU4 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p5v_3v3aux_r'} = 'CPU5 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p6v_3v3aux_r'} = 'CPU6 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p7v_3v3aux_r'} = 'CPU7 module +3.3VAUX';
|
|
||||||
$base{'x4x00'}->{'p0v_3v3led'} = 'CPU0 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p1v_3v3led'} = 'CPU1 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p2v_3v3led'} = 'CPU2 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p3v_3v3led'} = 'CPU3 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p4v_3v3led'} = 'CPU4 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p5v_3v3led'} = 'CPU5 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p6v_3v3led'} = 'CPU6 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p7v_3v3led'} = 'CPU7 module +3.3V LED';
|
|
||||||
$base{'x4x00'}->{'p2v_1v25core'} = 'CPU2 1.25V';
|
|
||||||
$base{'x4x00'}->{'p3v_1v25core'} = 'CPU3 1.25V';
|
|
||||||
$base{'x4x00'}->{'p4v_1v25core'} = 'CPU4 1.25V';
|
|
||||||
$base{'x4x00'}->{'p5v_1v25core'} = 'CPU5 1.25V';
|
|
||||||
$base{'x4x00'}->{'p6v_1v25core'} = 'CPU6 1.25V';
|
|
||||||
$base{'x4x00'}->{'p7v_1v25core'} = 'CPU7 1.25V';
|
|
||||||
$base{'x4x00'}->{'p0v_core'} = 'CPU0 Vcore';
|
|
||||||
$base{'x4x00'}->{'p1v_core'} = 'CPU1 Vcore';
|
|
||||||
$base{'x4x00'}->{'p2v_core'} = 'CPU2 Vcore';
|
|
||||||
$base{'x4x00'}->{'p3v_core'} = 'CPU3 Vcore';
|
|
||||||
$base{'x4x00'}->{'p4v_core'} = 'CPU4 Vcore';
|
|
||||||
$base{'x4x00'}->{'p5v_core'} = 'CPU5 Vcore';
|
|
||||||
$base{'x4x00'}->{'p6v_core'} = 'CPU6 Vcore';
|
|
||||||
$base{'x4x00'}->{'p7v_core'} = 'CPU7 Vcore';
|
|
||||||
# Sun x4600 temp extents
|
|
||||||
$base{'x4x00'}->{'p2t_core'} = 'CPU2';
|
|
||||||
$base{'x4x00'}->{'p3t_core'} = 'CPU3';
|
|
||||||
$base{'x4x00'}->{'p4t_core'} = 'CPU4';
|
|
||||||
$base{'x4x00'}->{'p5t_core'} = 'CPU5';
|
|
||||||
$base{'x4x00'}->{'p6t_core'} = 'CPU6';
|
|
||||||
$base{'x4x00'}->{'p7t_core'} = 'CPU7';
|
|
||||||
$base{'x4x00'}->{'p0t_amb'} = 'CPU0 module';
|
|
||||||
$base{'x4x00'}->{'p1t_amb'} = 'CPU1 module';
|
|
||||||
$base{'x4x00'}->{'p2t_amb'} = 'CPU2 module';
|
|
||||||
$base{'x4x00'}->{'p3t_amb'} = 'CPU3 module';
|
|
||||||
$base{'x4x00'}->{'p4t_amb'} = 'CPU4 module';
|
|
||||||
$base{'x4x00'}->{'p5t_amb'} = 'CPU5 module';
|
|
||||||
$base{'x4x00'}->{'p6t_amb'} = 'CPU6 module';
|
|
||||||
$base{'x4x00'}->{'p7t_amb'} = 'CPU7 module';
|
|
||||||
$base{'x4x00'}->{'mbt_amb0'} = 'System board 0';
|
|
||||||
$base{'x4x00'}->{'mbt_amb1'} = 'System board 1';
|
|
||||||
$base{'x4x00'}->{'mbt_amb2'} = 'System board 2';
|
|
||||||
# Sun x4500 voltage extents
|
|
||||||
$base{'x4x00'}->{'procp0v_1v25'} = 'CPU0 1.25V';
|
|
||||||
$base{'x4x00'}->{'procp1v_1v25'} = 'CPU1 1.25V';
|
|
||||||
$base{'x4x00'}->{'procp0v_1v5'} = 'CPU0 1.5V';
|
|
||||||
$base{'x4x00'}->{'procp1v_1v5'} = 'CPU1 1.5V';
|
|
||||||
$base{'x4x00'}->{'procp0v_2v5'} = 'CPU0 2.5V';
|
|
||||||
$base{'x4x00'}->{'procp1v_2v5'} = 'CPU1 2.5V';
|
|
||||||
$base{'x4x00'}->{'procv_1v8'} = 'CPU 1.8V';
|
|
||||||
$base{'x4x00'}->{'iov_1v5'} = 'IO 1.5V';
|
|
||||||
$base{'x4x00'}->{'iov_2v5'} = 'IO 2.5V';
|
|
||||||
$base{'x4x00'}->{'iov_5v_disk'} = 'IO 5V disk';
|
|
||||||
$base{'x4x00'}->{'iov_dash12v'} = 'IO -12V';
|
|
||||||
# Sun x4500 temp extents
|
|
||||||
$base{'x4x00'}->{'iofrontt_amb'} = 'IO front';
|
|
||||||
$base{'x4x00'}->{'ioreart_amb'} = 'IO rear';
|
|
||||||
$base{'x4x00'}->{'procfrontt_amb'} = 'CPU front';
|
|
||||||
$base{'x4x00'}->{'procreart_amb'} = 'CPU rear';
|
|
||||||
$base{'x4x00'}->{'procp0t_core'} = 'CPU0 temp';
|
|
||||||
$base{'x4x00'}->{'procp1t_core'} = 'CPU1 temp';
|
|
||||||
$base{'x4x00'}->{'dbpt_amb'} = 'DBP';
|
|
||||||
|
|
||||||
# Sun V20z (V40z?)
|
|
||||||
$base{'v20z'}->{'ambient'} = 'System';
|
|
||||||
$base{'v20z'}->{'cpu0die'} = 'CPU0 die';
|
|
||||||
$base{'v20z'}->{'cpu0mem'} = 'CPU0 mem';
|
|
||||||
$base{'v20z'}->{'cpu1die'} = 'CPU1 die';
|
|
||||||
$base{'v20z'}->{'cpu1mem'} = 'CPU1 mem';
|
|
||||||
$base{'v20z'}->{'gbeth'} = 'GBNIC';
|
|
||||||
$base{'v20z'}->{'hddbp'} = 'HDD backplane';
|
|
||||||
$base{'v20z'}->{'sp'} = 'Service CPU';
|
|
||||||
|
|
||||||
# Sun x2100
|
|
||||||
$base{'x2100'}->{'cpucorevoltage'} = 'CPU core';
|
|
||||||
$base{'x2100'}->{'batteryvolt'} = 'VBAT';
|
|
||||||
$base{'x2100'}->{'ddr26v'} = 'DDR 2.6V';
|
|
||||||
$base{'x2100'}->{'vcc33v'} = '+3.3V';
|
|
||||||
$base{'x2100'}->{'vcc5v'} = '+5V';
|
|
||||||
$base{'x2100'}->{'vcc12v'} = '+12V';
|
|
||||||
$base{'x2100'}->{'cputemp'} = 'CPU';
|
|
||||||
$base{'x2100'}->{'system'} = 'System';
|
|
||||||
# Sun x2100M2 extents
|
|
||||||
$base{'x2100'}->{'ddrp118v'} = 'DDR P1 1.8V';
|
|
||||||
$base{'x2100'}->{'vcc33vstb'} = '+3.3VSTBY';
|
|
||||||
$base{'x2100'}->{'ambienttemp'} = 'System';
|
|
||||||
# Sun x2200 extents
|
|
||||||
$base{'x2100'}->{'ddrp018v'} = 'DDR P0 1.8V';
|
|
||||||
$base{'x2100'}->{'ambienttemp0'} = 'System temp 0';
|
|
||||||
$base{'x2100'}->{'ambienttemp1'} = 'System temp 1';
|
|
||||||
$base{'x2100'}->{'cpu0temp'} = 'CPU0 temp';
|
|
||||||
$base{'x2100'}->{'cpu1temp'} = 'CPU1 temp';
|
|
||||||
|
|
||||||
# Intel SHG2
|
|
||||||
$base{'shg2'}->{'baseboard12v'} = 'MB 12V';
|
|
||||||
$base{'shg2'}->{'baseboard15v'} = 'MB 1.5V';
|
|
||||||
$base{'shg2'}->{'baseboard25v'} = 'MB 2.5V';
|
|
||||||
$base{'shg2'}->{'baseboard33v'} = 'MB 3.3V';
|
|
||||||
$base{'shg2'}->{'baseboard33vsb'} = '3.3VSTBY';
|
|
||||||
$base{'shg2'}->{'baseboard5v'} = 'MB 5V';
|
|
||||||
$base{'shg2'}->{'baseboarddash12v'} = 'MB -12V';
|
|
||||||
$base{'shg2'}->{'batteryvoltage'} = 'VBAT';
|
|
||||||
$base{'shg2'}->{'processorvrm'} = 'VRM';
|
|
||||||
|
|
||||||
# IBM x346
|
|
||||||
$base{'x346'}->{'125vsense'} = '+1.25V';
|
|
||||||
$base{'x346'}->{'12vasense'} = '+12V A';
|
|
||||||
$base{'x346'}->{'12vbsense'} = '+12V B';
|
|
||||||
$base{'x346'}->{'12vcsense'} = '+12V C';
|
|
||||||
$base{'x346'}->{'13vsense'} = '+1.3V';
|
|
||||||
$base{'x346'}->{'15vsense'} = '+1.5V';
|
|
||||||
$base{'x346'}->{'18vsense'} = '+1.8V';
|
|
||||||
$base{'x346'}->{'25vsense'} = '+2.5V';
|
|
||||||
$base{'x346'}->{'5vsense'} = '+5V';
|
|
||||||
$base{'x346'}->{'cpu1vcore'} = 'CPU1 Vcore';
|
|
||||||
$base{'x346'}->{'cpu2vcore'} = 'CPU2 Vcore';
|
|
||||||
$base{'x346'}->{'cpuvtt'} = 'CPU VTT';
|
|
||||||
$base{'x346'}->{'dash12vsense'} = '-12V';
|
|
||||||
$base{'x346'}->{'vbat'} = 'VBAT';
|
|
||||||
$base{'x346'}->{'cpu1'} = 'CPU1';
|
|
||||||
$base{'x346'}->{'cpu2'} = 'CPU2';
|
|
||||||
$base{'x346'}->{'dasd'} = 'DASD';
|
|
||||||
$base{'x346'}->{'ambient'} = 'System';
|
|
||||||
|
|
||||||
# Sun x2250
|
|
||||||
$base{'x2250'}->{'3v3_stby'} = '3.3VSTBY';
|
|
||||||
$base{'x2250'}->{'3v3'} = '+3.3V';
|
|
||||||
$base{'x2250'}->{'5v'} = '+5V';
|
|
||||||
$base{'x2250'}->{'12v'} = '+12V';
|
|
||||||
$base{'x2250'}->{'1v5'} = '+1.5V';
|
|
||||||
$base{'x2250'}->{'1v8'} = '+1.8V';
|
|
||||||
$base{'x2250'}->{'0v9'} = '+0.9V';
|
|
||||||
$base{'x2250'}->{'vtt'} = 'VTT';
|
|
||||||
$base{'x2250'}->{'1v5_esb'} = 'ESB +1.5V';
|
|
||||||
$base{'x2250'}->{'1v2_nic'} = 'NIC +1.2V';
|
|
||||||
$base{'x2250'}->{'1v8_nic'} = 'NIC +1.8V';
|
|
||||||
$base{'x2250'}->{'1v5_fbd'} = 'FBDIMM +1.5V';
|
|
||||||
|
|
||||||
# Sun x2270
|
|
||||||
$base{'x2270'}->{'3v3_stby'} = '3.3VSTBY';
|
|
||||||
$base{'x2270'}->{'3v3'} = '+3.3V';
|
|
||||||
$base{'x2270'}->{'5v'} = '+5V';
|
|
||||||
$base{'x2270'}->{'12v'} = '+12V';
|
|
||||||
$base{'x2270'}->{'3v3_vbat'} = '3.3VBAT';
|
|
||||||
$base{'x2270'}->{'1v5'} = '+1.5V';
|
|
||||||
$base{'x2270'}->{'p0_1v5_ddr'} = 'DDR P0 +1.5V';
|
|
||||||
$base{'x2270'}->{'p1_1v5_ddr'} = 'DDR P1 +1.5V';
|
|
||||||
$base{'x2270'}->{'p0_1v8'} = 'P0 +1.8V';
|
|
||||||
$base{'x2270'}->{'p1_1v8'} = 'P1 +1.8V';
|
|
||||||
$base{'x2270'}->{'p0_vtt'} = 'P0 VTT';
|
|
||||||
$base{'x2270'}->{'p1_vtt'} = 'P1 VTT';
|
|
||||||
$base{'x2270'}->{'p0_vccp'} = 'P0 VCCp';
|
|
||||||
$base{'x2270'}->{'p1_vccp'} = 'P1 VCCp';
|
|
||||||
|
|
||||||
# Sun x4150
|
|
||||||
$base{'x4150'}->{'mb_t_amb0'} = 'MB Sensor 0';
|
|
||||||
$base{'x4150'}->{'mb_t_amb1'} = 'MB Sensor 1';
|
|
||||||
$base{'x4150'}->{'mb_t_amb2'} = 'MB Sensor 2';
|
|
||||||
$base{'x4150'}->{'mb_t_amb3'} = 'MB Sensor 3';
|
|
||||||
$base{'x4150'}->{'ps0_t_amb'} = 'PS 1 temp';
|
|
||||||
$base{'x4150'}->{'ps1_t_amb'} = 'PS 2 temp';
|
|
||||||
$base{'x4150'}->{'t_amb'} = 'System';
|
|
||||||
$base{'x4150'}->{'ps0_f0'} = 'PS 1 fan';
|
|
||||||
$base{'x4150'}->{'ps1_f0'} = 'PS 2 fan';
|
|
||||||
$base{'x4150'}->{'mb_p0_v_vcc'} = 'CPU0 VCC';
|
|
||||||
$base{'x4150'}->{'mb_p1_v_vcc'} = 'CPU1 VCC';
|
|
||||||
$base{'x4150'}->{'mb_v_12v'} = '+12V';
|
|
||||||
$base{'x4150'}->{'mb_v_1v5'} = '+1.5V';
|
|
||||||
$base{'x4150'}->{'mb_v_1v8'} = '+1.8V';
|
|
||||||
$base{'x4150'}->{'mb_v_2v5stby'} = '+2.5VSTBY';
|
|
||||||
$base{'x4150'}->{'mb_v_3v3'} = '+3.3V';
|
|
||||||
$base{'x4150'}->{'mb_v_3v3stby'} = '+3.3VSTBY';
|
|
||||||
$base{'x4150'}->{'mb_v_5v'} = '+5V';
|
|
||||||
$base{'x4150'}->{'mb_v_nic'} = 'NIC';
|
|
||||||
$base{'x4150'}->{'mb_v_vtt'} = 'VTT';
|
|
||||||
$base{'x4150'}->{'ps0_v_in'} = 'PS 1 voltage in';
|
|
||||||
$base{'x4150'}->{'ps0_v_out'} = 'PS 1 voltage out';
|
|
||||||
$base{'x4150'}->{'ps1_v_in'} = 'PS 2 voltage in';
|
|
||||||
$base{'x4150'}->{'ps1_v_out'} = 'PS 2 voltage out';
|
|
||||||
|
|
||||||
# Verari VB1205XM
|
|
||||||
$base{'vb1205'}->{'12v'} = '+12V';
|
|
||||||
$base{'vb1205'}->{'1_2v'} = '+1.2V';
|
|
||||||
$base{'vb1205'}->{'1_5v'} = '+1.5V';
|
|
||||||
$base{'vb1205'}->{'3_3v'} = '+3.3V';
|
|
||||||
$base{'vb1205'}->{'5v'} = '+5V';
|
|
||||||
$base{'vb1205'}->{'5vsb'} = '+5VSTBY';
|
|
||||||
$base{'vb1205'}->{'cpu1vcore'} = 'CPU1 Vcore';
|
|
||||||
$base{'vb1205'}->{'cpu2vcore'} = 'CPU2 Vcore';
|
|
||||||
$base{'vb1205'}->{'dash12v'} = '-12V';
|
|
||||||
$base{'vb1205'}->{'vbat'} = 'VBAT';
|
|
||||||
$base{'vb1205'}->{'cputemp1'} = 'CPU 1 temp';
|
|
||||||
$base{'vb1205'}->{'cputemp2'} = 'CPU 2 temp';
|
|
||||||
$base{'vb1205'}->{'systemp'} = 'System';
|
|
||||||
|
|
||||||
# Dell PowerEdge 2650
|
|
||||||
$base{'pe2650'}->{'esmmbfan1'} = 'Fan 1';
|
|
||||||
$base{'pe2650'}->{'esmmbfan2'} = 'Fan 2';
|
|
||||||
$base{'pe2650'}->{'esmmbfan3'} = 'Fan 3';
|
|
||||||
$base{'pe2650'}->{'esmmbfan4'} = 'Fan 4';
|
|
||||||
$base{'pe2650'}->{'esmmbfan5'} = 'Fan 5';
|
|
||||||
$base{'pe2650'}->{'esmmbfan6'} = 'Fan 6';
|
|
||||||
$base{'pe2650'}->{'esmmbfan7'} = 'Fan 7';
|
|
||||||
$base{'pe2650'}->{'esmmb12'} = 'MB +12V';
|
|
||||||
$base{'pe2650'}->{'esmmb25'} = 'MB +2.5V';
|
|
||||||
$base{'pe2650'}->{'esmmb33'} = 'MB +3.3V';
|
|
||||||
$base{'pe2650'}->{'esmmb5'} = 'MB +5V';
|
|
||||||
$base{'pe2650'}->{'esmmbbat'} = 'VBAT';
|
|
||||||
$base{'pe2650'}->{'esmmbdash12'} = 'MB -12V';
|
|
||||||
$base{'pe2650'}->{'esmrombpk'} = 'ROMB PK';
|
|
||||||
$base{'pe2650'}->{'esmvtt'} = 'VTT';
|
|
||||||
$base{'pe2650'}->{'esmcpu'} = 'CPU';
|
|
||||||
$base{'pe2650'}->{'esm5aux'} = '5V AUX';
|
|
||||||
$base{'pe2650'}->{'esmcpu1'} = 'CPU1';
|
|
||||||
$base{'pe2650'}->{'esmcpu2'} = 'CPU2';
|
|
||||||
$base{'pe2650'}->{'esmfrti_o'} = 'Front I/O';
|
|
||||||
$base{'pe2650'}->{'esmriser'} = 'Riser';
|
|
||||||
|
|
||||||
# IBM x3200
|
|
||||||
$base{'ibmx3xx0'}->{'planar12v'} = '+12V';
|
|
||||||
$base{'ibmx3xx0'}->{'planar15v'} = '+1.5V';
|
|
||||||
$base{'ibmx3xx0'}->{'planar18v'} = '+1.8V';
|
|
||||||
$base{'ibmx3xx0'}->{'planar33v'} = '+3.3V';
|
|
||||||
$base{'ibmx3xx0'}->{'planar5v'} = '+5V';
|
|
||||||
$base{'ibmx3xx0'}->{'cpuvcore'} = 'CPU Vcore';
|
|
||||||
$base{'ibmx3xx0'}->{'cpuvtt'} = 'VTT';
|
|
||||||
$base{'ibmx3xx0'}->{'ambient'} = 'System';
|
|
||||||
$base{'ibmx3xx0'}->{'cpu'} = 'CPU';
|
|
||||||
# IBM x3550 extents
|
|
||||||
$base{'ibmx3xx0'}->{'planarvbat'} = 'VBAT';
|
|
||||||
|
|
||||||
# IBM LS41
|
|
||||||
$base{'ibmlsxx'}->{'12vsense'} = '+12V';
|
|
||||||
$base{'ibmlsxx'}->{'3_3vsense'} = '+3.3V';
|
|
||||||
$base{'ibmlsxx'}->{'5vsense'} = '+5V';
|
|
||||||
$base{'ibmlsxx'}->{'planarvbat'} = 'VBAT';
|
|
||||||
# IBM LS20 extents
|
|
||||||
$base{'ibmlsxx'}->{'1_8vsense'} = '+1.8V';
|
|
||||||
$base{'ibmlsxx'}->{'1_8vsbsense'} = '+1.8VSB';
|
|
||||||
$base{'ibmlsxx'}->{'12vsbsense'} = '+12VSB';
|
|
||||||
$base{'ibmlsxx'}->{'12v_isense'} = '+12V_I';
|
|
||||||
|
|
||||||
# IBM HS21
|
|
||||||
$base{'ibmhsxx'}->{'planar0_9v'} = '+0.9V';
|
|
||||||
$base{'ibmhsxx'}->{'planar12v'} = '+12V';
|
|
||||||
$base{'ibmhsxx'}->{'planar3_3v'} = '+3.3V';
|
|
||||||
$base{'ibmhsxx'}->{'planar5v'} = '+5V';
|
|
||||||
$base{'ibmhsxx'}->{'planarvbat'} = 'VBAT';
|
|
||||||
# IBM iDataplex DX320 extents
|
|
||||||
$base{'ibmhsxx'}->{'cpu1vcore'} = 'CPU1 Vcore';
|
|
||||||
$base{'ibmhsxx'}->{'cpu2vcore'} = 'CPU2 Vcore';
|
|
||||||
|
|
||||||
# Fujitsu-Siemens TX120
|
|
||||||
$base{'tx120'}->{'12v'} = '12V';
|
|
||||||
$base{'tx120'}->{'15v'} = '1.5V';
|
|
||||||
$base{'tx120'}->{'18v'} = '1.8V';
|
|
||||||
$base{'tx120'}->{'33v'} = '3.3V';
|
|
||||||
$base{'tx120'}->{'5v'} = '5V';
|
|
||||||
$base{'tx120'}->{'dash12v'} = '-12V';
|
|
||||||
$base{'tx120'}->{'stdby33v'} = '3.3VSTBY';
|
|
||||||
$base{'tx120'}->{'vtt'} = 'VTT';
|
|
||||||
$base{'tx120'}->{'battery3v'} = '3VBAT';
|
|
||||||
$base{'tx120'}->{'fanpsu'} = 'Fan PSU';
|
|
||||||
$base{'tx120'}->{'fan1sys'} = 'Fan Sys 1';
|
|
||||||
$base{'tx120'}->{'fan2sys'} = 'Fan Sys 2';
|
|
||||||
$base{'tx120'}->{'fancpu'} = 'Fan CPU';
|
|
||||||
$base{'tx120'}->{'ambient'} = 'Ambient';
|
|
||||||
$base{'tx120'}->{'systemboard'} = 'System board';
|
|
||||||
$base{'tx120'}->{'cpu'} = 'CPU';
|
|
||||||
|
|
||||||
# Dell DCS XS23-sc
|
|
||||||
$base{'xs23'}->{'systemfan'} = 'System fan';
|
|
||||||
$base{'xs23'}->{'cpu0'} = 'CPU 0';
|
|
||||||
$base{'xs23'}->{'cpu1'} = 'CPU 1';
|
|
||||||
$base{'xs23'}->{'midplane'} = 'Midplane';
|
|
||||||
$base{'xs23'}->{'p12v'} = 'Planar 12V';
|
|
||||||
$base{'xs23'}->{'p15v'} = 'Planar 1.5V';
|
|
||||||
$base{'xs23'}->{'p18v'} = 'Planar 1.8V';
|
|
||||||
$base{'xs23'}->{'p33v'} = 'Planar 3.3V';
|
|
||||||
$base{'xs23'}->{'p5v'} = 'Planar 5V';
|
|
||||||
$base{'xs23'}->{'vtt'} = 'Vtt';
|
|
||||||
$base{'xs23'}->{'vcc33vaux'} = 'Vcc 3.3V AUX';
|
|
||||||
|
|
||||||
# Supermicro X8DT6 / X8DTT-F via Winbond Hermon BMC
|
|
||||||
$base{'hermon'}->{'fan1'} = 'Fan 1';
|
|
||||||
$base{'hermon'}->{'fan2'} = 'Fan 2';
|
|
||||||
$base{'hermon'}->{'fan3'} = 'Fan 3';
|
|
||||||
$base{'hermon'}->{'fan4'} = 'Fan 4';
|
|
||||||
$base{'hermon'}->{'fan5'} = 'Fan 5';
|
|
||||||
$base{'hermon'}->{'fan6'} = 'Fan 6';
|
|
||||||
$base{'hermon'}->{'fan7'} = 'Fan 7';
|
|
||||||
$base{'hermon'}->{'fan8'} = 'Fan 8';
|
|
||||||
$base{'hermon'}->{'system'} = 'System';
|
|
||||||
$base{'hermon'}->{'cpu1temp'} = 'CPU1 temp';
|
|
||||||
$base{'hermon'}->{'cpu2temp'} = 'CPU2 temp';
|
|
||||||
$base{'hermon'}->{'12v'} = '+12V';
|
|
||||||
$base{'hermon'}->{'15v'} = '+1.5V';
|
|
||||||
$base{'hermon'}->{'33v'} = '+3.3V';
|
|
||||||
$base{'hermon'}->{'33vsb'} = '+3.3VSB';
|
|
||||||
$base{'hermon'}->{'5v'} = '+5V';
|
|
||||||
$base{'hermon'}->{'vbat'} = 'VBAT';
|
|
||||||
$base{'hermon'}->{'cpu1dimm'} = 'CPU1 DIMM';
|
|
||||||
$base{'hermon'}->{'cpu2dimm'} = 'CPU2 DIMM';
|
|
||||||
$base{'hermon'}->{'cpu1vcore'} = 'CPU1 Vcore';
|
|
||||||
$base{'hermon'}->{'cpu2vcore'} = 'CPU2 Vcore';
|
|
||||||
|
|
||||||
# Most of these are similar on the Supermicro X* boards
|
|
||||||
$base{'aocipmi20e'} = $base{'hermon'};
|
|
||||||
$base{'aocipmi20e'}->{'dash12v'} = '-12V';
|
|
||||||
$base{'aocipmi20e'}->{'5vsb'} = '+5VSB';
|
|
||||||
$base{'aocipmi20e'}->{'fan7_cpu1'} = 'Fan7 / CPU1';
|
|
||||||
$base{'aocipmi20e'}->{'fan8_cpu2'} = 'Fan8 / CPU2';
|
|
||||||
$base{'aocipmi20e'}->{'sys'} = 'System';
|
|
||||||
|
|
||||||
# Asus K8N-LR / HP DL145G2
|
|
||||||
$base{'asmb2'}->{'cpufan1'} = 'CPU Fan 1';
|
|
||||||
$base{'asmb2'}->{'cpufan2'} = 'CPU Fan 2';
|
|
||||||
$base{'asmb2'}->{'frontfan1'} = 'Front Fan 1';
|
|
||||||
$base{'asmb2'}->{'frontfan2'} = 'Front Fan 2';
|
|
||||||
$base{'asmb2'}->{'rearfan1'} = 'Rear Fan 1';
|
|
||||||
$base{'asmb2'}->{'rearfan2'} = 'Rear Fan 2';
|
|
||||||
$base{'asmb2'}->{'cpu1thermal'} = 'CPU1';
|
|
||||||
$base{'asmb2'}->{'systemthermal'} = 'System';
|
|
||||||
$base{'asmb2'}->{'25vor18v'} = '+2.5V / +1.8V';
|
|
||||||
$base{'asmb2'}->{'bat_cmos'} = 'VBAT';
|
|
||||||
$base{'asmb2'}->{'cpuvcore1'} = 'CPU1 Vcore';
|
|
||||||
$base{'asmb2'}->{'system12v'} = '+12V';
|
|
||||||
$base{'asmb2'}->{'system15v'} = '+1.5V';
|
|
||||||
$base{'asmb2'}->{'system5v'} = '+5V';
|
|
||||||
$base{'asmb2'}->{'system3v'} = '+3V';
|
|
||||||
$base{'asmb2'}->{'system5vsb'} = '+5VSTBY';
|
|
||||||
|
|
||||||
# Dell M610 blade
|
|
||||||
$base{'m610'}->{'ambienttemp'} = 'Ambient temp';
|
|
||||||
$base{'m610'}->{'temp'} = 'Blade temp';
|
|
||||||
|
|
||||||
# hpasmcli / Proliant DL385G1
|
|
||||||
$base{'hpasmcli'}->{'cpu-1'} = 'CPU 1';
|
|
||||||
$base{'hpasmcli'}->{'cpu-2'} = 'CPU 2';
|
|
||||||
$base{'hpasmcli'}->{'i_o_zone'} = 'I/O zone';
|
|
||||||
$base{'hpasmcli'}->{'power_supply_bay'} = 'PSU bay';
|
|
||||||
$base{'hpasmcli'}->{'processor_zone'} = 'CPU zone';
|
|
||||||
|
|
||||||
# Machine config, run through the file/output
|
|
||||||
my $label; my $tmp;
|
|
||||||
foreach my $line ( @ipmioutput )
|
|
||||||
{
|
|
||||||
$line =~ s/\s+/ /g;
|
|
||||||
if ( $sensor eq 'fan' && $line =~ /.*RPM.*ok/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\.speed.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)\.tach.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2100') { $line =~ s/(.*)\s+\|.*RPM.*/\L$1/; $label = $line; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*) Tach.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ s/(.*)\s+\|.*RPM.*\|\s+ok/$1/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) RPM\s+\|.*RPM.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Tach.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
|
|
||||||
|
|
||||||
}
|
|
||||||
elsif ( $sensor eq 'fan' && $line =~ /\#\d+\s+\S+\s+Yes.*\%/ ) {
|
|
||||||
if ( $machine eq 'hpasmcli' ) { $line =~ /\#(\d+)\s+(.*)\s+Yes.*\%.*/; $label = "$2_$1"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'temp' && $line =~ /.*degree.*ok/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\ \|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)temp.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2100') { $line =~ s/(.*)\s+\|.*deg.*/\L$1/; $label = $line; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*) Temp.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmls4x' ) { $line =~ /(.*) TEMP.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /MB\/T\_(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /MB\/T\_(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) Temp.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Temp.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*) TEMP.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'm610' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'proliantg5' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
|
|
||||||
}
|
|
||||||
elsif ( $sensor eq 'temp' && $line =~ /\d+C\/\d+F/ ) {
|
|
||||||
if ( $machine eq 'hpasmcli' ) { $line =~ /.*\s+(.*)\s+\d+C\/\d+F\s+\d+C\/\d+F/; $label = $1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'volt' && $line =~ /.*Volts.*/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\ \|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)\ \|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2100') { $line =~ s/(.*)\s+\|.*Volts.*/\L$1/; $label = $line; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmls4x' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /MB\/V\_(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /MB\/(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) Volt\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'ibmhsxx' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $label )
|
|
||||||
{
|
|
||||||
$label =~ s/\.//g;
|
|
||||||
$label =~ s/\-/dash/g;
|
|
||||||
$label =~ s/\+//;
|
|
||||||
$label =~ s/\s+//g;
|
|
||||||
$label =~ s/(.*)/\L$1/;
|
|
||||||
$label =~ s/\//_/g;
|
|
||||||
$label =~ s/\#/_/g;
|
|
||||||
|
|
||||||
# Random fixups
|
|
||||||
if ( $machine eq 'x2270' ) { $label =~ s/v_//; }
|
|
||||||
if ( $machine eq 'x4x00' ) { $label =~ s/^sysv\_/mbv\_/; }
|
|
||||||
if ( $machine eq 'tx120' ) { $label =~ s/main//; }
|
|
||||||
|
|
||||||
if ( $base{$machine}->{$label} )
|
|
||||||
{
|
|
||||||
$cnf{ $label. '.label' } = $base{$machine}->{$label};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cnf{ $label. '.label' } = $label;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
undef ($label);
|
|
||||||
}
|
|
||||||
foreach my $key ( sort(keys(%cnf)) )
|
|
||||||
{
|
|
||||||
print "$key $cnf{$key}\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
my %res; my $label; my $value;
|
|
||||||
foreach my $line ( @ipmioutput )
|
|
||||||
{
|
|
||||||
$line =~ s/\s+/ /g;
|
|
||||||
if ( $sensor eq 'fan' && $line =~ /.*RPM.*ok/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\.speed\s+\|\s+(\d+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)\.tach\s+\|\s+(\d+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2100' ) { $line =~ s/(.*)\s+\|\s+(\S+) RPM.*/\L$1/; $label = $line; $value = $2; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*) Tach\s+\| (\d+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|.*ok/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /(.*)\/TACH\s+\|\s+(.*) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /(.*)\/TACH\s+\|\s+(.*) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\/TACH\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) RPM\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Tach\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
|
|
||||||
}
|
|
||||||
elsif ( $sensor eq 'fan' && $line =~ /\#\d+\s+\S+\s+Yes.*\%/ ) {
|
|
||||||
if ( $machine eq 'hpasmcli' ) { $line =~ /\#(\d+)\s+(.*)\s+Yes\s+\w+\s+(\d+)\%.*/; $label = "$2_$1"; $value = $3; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'temp' && $line =~ /.*degree.*ok/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2100' ) { $line =~ s/(.*)\s+\|\s+(\d+) deg.*/\L$1/; $label = $line; $value = $2; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*) Temp\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmls4x' ) { $line =~ /(.*) TEMP\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /MB\/T\_(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /MB\/T\_(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) Temp\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Temp\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*) TEMP\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'm610' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'proliantg5' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
|
|
||||||
}
|
|
||||||
elsif ( $sensor eq 'temp' && $line =~ /\d+C\/\d+F/ ) {
|
|
||||||
if ( $machine eq 'hpasmcli' ) { $line =~ /.*\s+(.*)\s+(\d+)C\/\d+F\s+\d+C\/\d+F/; $label = $1; $value = $2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $sensor eq 'volt' && $line =~ /.*Volt.*ok/ )
|
|
||||||
{
|
|
||||||
if ( $machine eq 'x4x00' ) { $line =~ /(.*)\ \|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'v20z' ) { $line =~ /(.*)\s+\|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2100' ) { $line =~ s/(.*)\s+\|\s+(\S+)\ Volt.*/\L$1/; $label = $line; $value = $2; }
|
|
||||||
if ( $machine eq 'x346' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmls4x' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2250' ) { $line =~ /MB\/V\_(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x2270' ) { $line =~ /MB\/(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'pe2650' ) { $line =~ /(.*) Volt\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'ibmhsxx' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
|
|
||||||
if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'xs23' ) { $line =~ /(.*)\ \|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $label )
|
|
||||||
{
|
|
||||||
$label =~ s/\.//g;
|
|
||||||
$label =~ s/\-/dash/g;
|
|
||||||
$label =~ s/\+//;
|
|
||||||
$label =~ s/\s+//g;
|
|
||||||
$label =~ s/(.*)/\L$1/;
|
|
||||||
$label =~ s/\//_/g;
|
|
||||||
$label =~ s/\#/_/g;
|
|
||||||
|
|
||||||
# Random fixups
|
|
||||||
if ( $machine eq 'x2270' ) { $label =~ s/v_//; }
|
|
||||||
if ( $machine eq 'x4x00' ) { $label =~ s/^sysv\_/mbv\_/; }
|
|
||||||
if ( $machine eq 'tx120' ) { $label =~ s/main//; }
|
|
||||||
|
|
||||||
|
|
||||||
$res{$label} = $value;
|
|
||||||
}
|
|
||||||
undef ($label);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $key;
|
|
||||||
foreach $key ( sort(keys(%res)) )
|
|
||||||
{
|
|
||||||
print "$key.value ".$res{$key}."\n";
|
|
||||||
}
|
|
||||||
|
|
@ -1,461 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# Wildcard plugin to monitor sensor by using ipmitool sensor program.
|
|
||||||
#
|
|
||||||
# Contributed by Jun Futagawa
|
|
||||||
# This script is based on sensors_ plugin.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmitool_sensor_ /etc/munin/plugins/ipmitool_sensor_fan
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmitool_sensor_ /etc/munin/plugins/ipmitool_sensor_temp
|
|
||||||
# ln -s /usr/share/munin/plugins/ipmitool_sensor_ /etc/munin/plugins/ipmitool_sensor_volt
|
|
||||||
#
|
|
||||||
# Requirements:
|
|
||||||
# - OpenIPMI tool (ipmitool command)
|
|
||||||
#
|
|
||||||
# Note:
|
|
||||||
# - Sensor names are read from the output of the ipmitool sensor program.
|
|
||||||
#
|
|
||||||
# Add the following to your /etc/munin/plugin-conf.d/munin-node:
|
|
||||||
#
|
|
||||||
# [ipmitool_sensor*]
|
|
||||||
# user root
|
|
||||||
# timeout 20
|
|
||||||
#
|
|
||||||
# If you want to use "ipmitool sdr", add the following:
|
|
||||||
# Note: When you use this, the threshold provided by the sensor board is not used.
|
|
||||||
#
|
|
||||||
# [ipmitool_sensor*]
|
|
||||||
# user root
|
|
||||||
# timeout 20
|
|
||||||
# env.ipmitool_options sdr
|
|
||||||
#
|
|
||||||
# Parameters supported:
|
|
||||||
#
|
|
||||||
# config
|
|
||||||
# autoconf
|
|
||||||
# suggest
|
|
||||||
#
|
|
||||||
# Configurable variables
|
|
||||||
#
|
|
||||||
# ipmitool - ipmitool command (default: ipmitool)
|
|
||||||
# ipmitool_options - ipmitool command options (default: sensor)
|
|
||||||
# sdr: you can use 'sdr' instead of sensor.
|
|
||||||
# cache_file - cache file
|
|
||||||
# (default: /var/lib/munin/plugin-state/plugin-ipmitool_sensor.cache)
|
|
||||||
# cache_expires - cache expires (default: 275)
|
|
||||||
#
|
|
||||||
# fan_type_regex - Regular expression for unit of fan (default: RPM)
|
|
||||||
# temp_type_regex - Regular expression for unit of temp (default: degrees C)
|
|
||||||
# volt_type_regex - Regular expression for unit of volt (default: (Volts|Watts|Amps))
|
|
||||||
#
|
|
||||||
# fan_warn_percent - Percentage over mininum for warning (default: 5)
|
|
||||||
# fan_lower_critical - Preferred lower critical value for fan
|
|
||||||
# fan_upper_critical - Preferred upper critical value for fan
|
|
||||||
# temp_lower_critical - Preferred lower critical value for temp
|
|
||||||
# temp_lower_warning - Preferred lower warining value for temp
|
|
||||||
# temp_upper_warning - Preferred upper warning value for temp
|
|
||||||
# temp_upper_critical - Preferred upper critical value for temp
|
|
||||||
# volt_warn_percent - Percentage over mininum/under maximum for warning
|
|
||||||
# Narrow the voltage bracket by this. (default: 20)
|
|
||||||
#
|
|
||||||
# $Log$
|
|
||||||
# Revision 1.6 2011/02/07 12:50:00 jfut
|
|
||||||
# Bug fix: Check temp_upper_warning and temp_upper_critical was not working again.
|
|
||||||
#
|
|
||||||
# Revision 1.5 2011/01/28 00:39:00 jfut
|
|
||||||
# Bug fix: Check temp_upper_warning and temp_upper_critical was not working.
|
|
||||||
#
|
|
||||||
# Revision 1.4 2009/02/08 23:51:00 jfut
|
|
||||||
# Support "ipmitool sdr".
|
|
||||||
# Add Watts and Amp as voltage unit.
|
|
||||||
# Add fan_type_regex/temp_type_regex/volt_type_regex as option of sensor type.
|
|
||||||
#
|
|
||||||
# Revision 1.3 2008/11/11 13:55:00 jfut
|
|
||||||
# Add infinity value check for HP ProLiant DL160.
|
|
||||||
# Add preferred value option for fan and temp.
|
|
||||||
#
|
|
||||||
# Revision 1.2 2008/10/28 19:21:22 jfut
|
|
||||||
# Add file check.
|
|
||||||
#
|
|
||||||
# Revision 1.1 2008/10/27 18:52:31 jfut
|
|
||||||
# Add cache mechanism.
|
|
||||||
#
|
|
||||||
# Revision 1.0 2008/10/27 14:25:12 jfut
|
|
||||||
# Initial release.
|
|
||||||
#
|
|
||||||
# Magic markers:
|
|
||||||
#%# family=manual
|
|
||||||
#%# capabilities=autoconf suggest
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
$ENV{'LANG'} = "C"; # Force parseable output from sensors.
|
|
||||||
$ENV{'LC_ALL'} = "C"; # Force parseable output from sensors.
|
|
||||||
my $IPMITOOL = $ENV{'ipmitool'} || 'ipmitool';
|
|
||||||
my @IPMITOOL_OPTS = exists $ENV{'ipmitool_options'} ? split(/\s+/, $ENV{'ipmitool_options'}) : ('sensor');
|
|
||||||
|
|
||||||
my $CACHE_DIR = "/var/lib/munin/plugin-state";
|
|
||||||
my $CACHE_FILE = $ENV{'cache_file'} || "$CACHE_DIR/plugin-ipmitool_sensor.cache";
|
|
||||||
my $CACHE_EXPIRES = $ENV{'cache_expires'} || 275;
|
|
||||||
|
|
||||||
my %config = (
|
|
||||||
fan => {
|
|
||||||
regex => exists $ENV{'fan_type_regex'} ? qr/$ENV{'fan_type_regex'}/im : qr/RPM/im,
|
|
||||||
title => 'IPMITool Sensor: Fans',
|
|
||||||
vtitle => 'RPM',
|
|
||||||
print_threshold => \&fan_threshold,
|
|
||||||
graph_args => '--base 1000 -l 0'
|
|
||||||
},
|
|
||||||
temp => {
|
|
||||||
regex => exists $ENV{'temp_type_regex'} ? qr/$ENV{'temp_type_regex'}/im : qr/degrees C/im,
|
|
||||||
title => 'IPMITool Sensor: Temperatures',
|
|
||||||
vtitle => 'Celsius',
|
|
||||||
print_threshold => \&temp_threshold,
|
|
||||||
graph_args => '--base 1000 -l 0'
|
|
||||||
},
|
|
||||||
volt => {
|
|
||||||
regex => exists $ENV{'volt_type_regex'} ? qr/$ENV{'volt_type_regex'}/im : qr/(Volts|Watts|Amps)/im,
|
|
||||||
title => 'IPMITool Sensor: Voltages',
|
|
||||||
vtitle => '_AUTO_DETECT_FAILED_',
|
|
||||||
print_threshold => \&volt_threshold,
|
|
||||||
graph_args => '--base 1000'
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
if (defined $ARGV[0] and $ARGV[0] eq 'autoconf') {
|
|
||||||
close(STDERR);
|
|
||||||
my $ret = system($IPMITOOL);
|
|
||||||
open (STDERR, ">&STDOUT");
|
|
||||||
if ($ret == 0 || $ret == 256) {
|
|
||||||
print "yes\n";
|
|
||||||
exit 0;
|
|
||||||
} else {
|
|
||||||
print "no (program $IPMITOOL not found)\n";
|
|
||||||
}
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined $ARGV[0] and $ARGV[0] eq 'suggest') {
|
|
||||||
my $text = get_sensor_data();
|
|
||||||
my $alltext = join('\n', @{$text});
|
|
||||||
foreach my $func (keys %config) {
|
|
||||||
print $func, "\n" if $alltext =~ $config{$func}->{regex};
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$0 =~ /ipmitool_sensor_(.+)*$/;
|
|
||||||
my $func = $1;
|
|
||||||
exit 2 unless defined $func;
|
|
||||||
|
|
||||||
my $text = get_sensor_data();
|
|
||||||
my $sensor = 1;
|
|
||||||
|
|
||||||
if (defined $ARGV[0] and $ARGV[0] eq 'config') {
|
|
||||||
# detect the unit of volt
|
|
||||||
if ($func eq 'volt') {
|
|
||||||
foreach my $line (@{$text}) {
|
|
||||||
if ($line =~ /$config{$func}->{regex}/) {
|
|
||||||
my ($label, $value, $unit, $lcr, $lnc, $unc, $ucr) = &get_sensor_items($line, $config{$func}->{regex});
|
|
||||||
$config{$func}->{vtitle} = $unit;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$text = get_sensor_data();
|
|
||||||
}
|
|
||||||
|
|
||||||
# print header
|
|
||||||
print "graph_title $config{$func}->{title}\n";
|
|
||||||
print "graph_vtitle $config{$func}->{vtitle}\n";
|
|
||||||
print "graph_args $config{$func}->{graph_args}\n";
|
|
||||||
print "graph_category sensors\n";
|
|
||||||
|
|
||||||
# print data
|
|
||||||
foreach my $line (@{$text}) {
|
|
||||||
if ($line =~ /$config{$func}->{regex}/) {
|
|
||||||
my ($label, $value, $unit, $lcr, $lnc, $unc, $ucr) = &get_sensor_items($line, $config{$func}->{regex});
|
|
||||||
if (&is_valid_value($value)) {
|
|
||||||
print "$func$sensor.label $label\n";
|
|
||||||
$config{$func}->{print_threshold}->($func.$sensor, $lcr, $lnc, $unc, $ucr);
|
|
||||||
print "$func$sensor.graph no\n" if exists $ENV{"ignore_$func$sensor"};
|
|
||||||
$sensor++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $line (@{$text}) {
|
|
||||||
if ($line =~ /$config{$func}->{regex}/) {
|
|
||||||
my ($label, $value, $unit, $lcr, $lnc, $unc, $ucr) = &get_sensor_items($line, $config{$func}->{regex});
|
|
||||||
# for debug
|
|
||||||
# print "$func$sensor.value [$label] [$value] [$lcr] [$lnc] [$unc] [$ucr]\n";
|
|
||||||
if (&is_valid_value($value)) {
|
|
||||||
print "$func$sensor.value $value\n";
|
|
||||||
$sensor++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_sensor_data {
|
|
||||||
my $text = undef;
|
|
||||||
if (-f $CACHE_FILE) {
|
|
||||||
my $cache_timestamp = (stat($CACHE_FILE))[9];
|
|
||||||
if ($CACHE_EXPIRES == -1 || time - $cache_timestamp <= $CACHE_EXPIRES) {
|
|
||||||
open(IN, "<", $CACHE_FILE) or die "Could not open \"$CACHE_FILE\" for reading\n";
|
|
||||||
while (<IN>) {
|
|
||||||
push (@{$text}, $_);
|
|
||||||
}
|
|
||||||
close(IN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! defined $text) {
|
|
||||||
my $pid = open(EXE, '-|');
|
|
||||||
if ($pid == 0) {
|
|
||||||
exec($IPMITOOL, @IPMITOOL_OPTS);
|
|
||||||
} elsif (defined $pid) {
|
|
||||||
while(<EXE>) {
|
|
||||||
push (@{$text}, $_);
|
|
||||||
}
|
|
||||||
close(EXE);
|
|
||||||
} else {
|
|
||||||
die "fork failed: $!";
|
|
||||||
}
|
|
||||||
if (-w $CACHE_DIR) {
|
|
||||||
open(OUT, ">", $CACHE_FILE) or die "Could not open \"$CACHE_FILE\" for writing\n";
|
|
||||||
foreach my $line (@{$text}) {
|
|
||||||
print OUT "$line";
|
|
||||||
}
|
|
||||||
close OUT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_sensor_items {
|
|
||||||
my ($line, $regex) = @_;
|
|
||||||
my @items = split(/\s*\|\s*/, $line);
|
|
||||||
my ($label, $value, $unit, $lcr, $lnc, $unc, $ucr)
|
|
||||||
= (trim($items[0]), trim($items[1]), trim($items[2]), trim($items[5]), trim($items[6]), trim($items[7]), trim($items[8]));
|
|
||||||
if ($#items == 9) {
|
|
||||||
# ipmitool sensor
|
|
||||||
} elsif ($#items == 2) {
|
|
||||||
# ipmitool sdr
|
|
||||||
if ($value =~ /$regex/) {
|
|
||||||
$value = trim($`);
|
|
||||||
$unit = trim($1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# some boards show data in incorrect order.
|
|
||||||
# - HP ProLiant ML110 G5
|
|
||||||
# CPU FAN | 1434.309 | RPM | ok | 5537.099 | 4960.317 | 4859.086 | na | 937.383 | na
|
|
||||||
# SYSTEM FAN | 1506.932 | RPM | ok | 5952.381 | 5668.934 | 5411.255 | na | 937.383 | na
|
|
||||||
# - HP ProLiant DL160
|
|
||||||
# FAN1 ROTOR1 | 7680.492 | RPM | ok | na | inf | na | na | 1000.400 | na
|
|
||||||
if (&is_valid_value($lcr) && &is_valid_value($ucr) && $lcr > $ucr || $lcr eq 'inf') {
|
|
||||||
($lcr, $lnc, $unc, $ucr) = ($ucr, $unc, $lnc, $lcr);
|
|
||||||
}
|
|
||||||
if (&is_valid_value($lnc) && &is_valid_value($unc) && $lnc > $unc || $lnc eq 'inf') {
|
|
||||||
($lcr, $lnc, $unc, $ucr) = ($ucr, $unc, $lnc, $lcr);
|
|
||||||
}
|
|
||||||
return ($label, $value, $unit, $lcr, $lnc, $unc, $ucr);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub fan_threshold {
|
|
||||||
my ($name, $lcr, $lnc, $unc, $ucr) = @_;
|
|
||||||
my $warn_percent = exists $ENV{fan_warn_percent} ? $ENV{fan_warn_percent} : 5;
|
|
||||||
|
|
||||||
# lcr: lower critical
|
|
||||||
if (exists $ENV{fan_lower_critical}) {
|
|
||||||
$lcr = $ENV{fan_lower_critical};
|
|
||||||
} elsif (! &is_valid_value($lcr)) {
|
|
||||||
if ($lcr eq 'inf') { $lcr = ''; }
|
|
||||||
else { $lcr = '50'; }
|
|
||||||
}
|
|
||||||
# lnc: lower warning
|
|
||||||
if (! &is_valid_value($lnc)) {
|
|
||||||
if ($lnc eq 'inf') { $lnc = ''; }
|
|
||||||
else { $lnc = ($lcr eq '') ? '' : $lcr * (100 + $warn_percent) / 100; }
|
|
||||||
}
|
|
||||||
# ucr: upper critical
|
|
||||||
if (exists $ENV{fan_upper_critical}) {
|
|
||||||
$ucr = $ENV{fan_upper_critical};
|
|
||||||
} elsif (! &is_valid_value($ucr)) {
|
|
||||||
if ($ucr eq 'inf') { $ucr = ''; }
|
|
||||||
else { $ucr = '6000'; }
|
|
||||||
}
|
|
||||||
# unc: upper warning
|
|
||||||
if (! &is_valid_value($unc)) {
|
|
||||||
if ($unc eq 'inf') { $unc = ''; }
|
|
||||||
else { $unc = ($ucr eq '') ? '' : $ucr * (100 - $warn_percent) / 100; }
|
|
||||||
}
|
|
||||||
|
|
||||||
return unless ($lcr ne '' || $lnc ne '' || $unc ne '' || $ucr ne '');
|
|
||||||
|
|
||||||
printf "$name.warning $lnc:$unc\n";
|
|
||||||
printf "$name.critical $lcr:$ucr\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub temp_threshold {
|
|
||||||
my ($name, $lcr, $lnc, $unc, $ucr) = @_;
|
|
||||||
|
|
||||||
# lcr: lower critical
|
|
||||||
if (exists $ENV{temp_lower_critical}) {
|
|
||||||
$lcr = $ENV{temp_lower_critical};
|
|
||||||
} elsif (! &is_valid_value($lcr)) {
|
|
||||||
if ($lcr eq 'inf') { $lcr = ''; }
|
|
||||||
else { $lcr = 5; }
|
|
||||||
}
|
|
||||||
# lnc: lower warning
|
|
||||||
if (exists $ENV{temp_lower_warning}) {
|
|
||||||
$lnc = $ENV{temp_lower_warning};
|
|
||||||
} elsif (! &is_valid_value($lnc)) {
|
|
||||||
if ($lnc eq 'inf') { $lnc = ''; }
|
|
||||||
else { $lnc = 10; }
|
|
||||||
}
|
|
||||||
# unc: upper warning
|
|
||||||
if (exists $ENV{temp_upper_warning}) {
|
|
||||||
$unc = $ENV{temp_upper_warning};
|
|
||||||
} elsif (! &is_valid_value($unc)) {
|
|
||||||
if ($unc eq 'inf') { $unc = ''; }
|
|
||||||
else { $unc = '65'; }
|
|
||||||
}
|
|
||||||
# ucr: upper critical
|
|
||||||
if (exists $ENV{temp_upper_critical}) {
|
|
||||||
$ucr = $ENV{temp_upper_critical};
|
|
||||||
} elsif (! &is_valid_value($ucr)) {
|
|
||||||
if ($ucr eq 'inf') { $ucr = ''; }
|
|
||||||
else { $ucr = '70'; }
|
|
||||||
}
|
|
||||||
|
|
||||||
return unless ($lcr ne '' || $lnc ne '' || $unc ne '' || $ucr ne '');
|
|
||||||
|
|
||||||
printf "$name.warning $lnc:$unc\n";
|
|
||||||
printf "$name.critical $lcr:$ucr\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub volt_threshold {
|
|
||||||
my ($name, $lcr, $lnc, $unc, $ucr) = @_;
|
|
||||||
my $warn_percent = exists $ENV{volt_warn_percent} ? $ENV{volt_warn_percent} : 20;
|
|
||||||
|
|
||||||
if (! &is_valid_value($lcr)) { $lcr = ''; }
|
|
||||||
if (! &is_valid_value($lnc)) { $lnc = ($lcr eq '') ? '' : $lcr * (100 + $warn_percent) / 100; }
|
|
||||||
if (! &is_valid_value($ucr)) { $ucr = ''; }
|
|
||||||
if (! &is_valid_value($unc)) { $unc = ($ucr eq '') ? '' : $ucr * (100 - $warn_percent) / 100; }
|
|
||||||
|
|
||||||
return unless ($lcr ne '' || $lnc ne '' || $unc ne '' || $ucr ne '');
|
|
||||||
|
|
||||||
printf "$name.warning $lnc:$unc\n";
|
|
||||||
printf "$name.critical $lcr:$ucr\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub trim {
|
|
||||||
my $value = shift;
|
|
||||||
if (defined $value) {
|
|
||||||
$value =~ s/^\s*(.*?)\s*$/$1/;
|
|
||||||
} else {
|
|
||||||
$value = 'na'
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub is_valid_value() {
|
|
||||||
my $value = shift;
|
|
||||||
if ($value eq 'na' || $value eq 'inf' || $value eq '') {
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
########################################
|
|
||||||
|
|
||||||
=head1 How to test
|
|
||||||
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_volt
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_volt config
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_volt suggest
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_volt autoconf
|
|
||||||
fan_warn_percent=50 fan_lower_critical=100 fan_upper_critical=1000 cache_file=ipmitool_sensor_ \
|
|
||||||
cache_expires=-1 ./ipmitool_sensor_fan config
|
|
||||||
temp_lower_warning=1 temp_lower_critical=2 temp_upper_critical=71 temp_upper_warning=72 \
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_temp config
|
|
||||||
volt_warn_percent=50 \
|
|
||||||
cache_file=ipmitool_sensor_ cache_expires=-1 ./ipmitool_sensor_volt config
|
|
||||||
|
|
||||||
=head1 Test Data
|
|
||||||
|
|
||||||
unr Upper Non-Recoverable
|
|
||||||
ucr Upper Critical
|
|
||||||
unc Upper Non-Critical
|
|
||||||
lnc Lower Non-Critical
|
|
||||||
lcr Lower Critical
|
|
||||||
lnr Lower Non-Recoverable
|
|
||||||
|
|
||||||
=head2 ipmitool sensor
|
|
||||||
|
|
||||||
# HP ProLiant ML110 G5
|
|
||||||
CPU FAN | 1434.309 | RPM | ok | 5537.099 | 4960.317 | 4859.086 | na | 937.383 | na
|
|
||||||
SYSTEM FAN | 1497.454 | RPM | ok | 5952.381 | 5668.934 | 5411.255 | na | 937.383 | na
|
|
||||||
System 12V | 12.152 | Volts | ok | na | na | na | na | na | na
|
|
||||||
System 5V | 5.078 | Volts | ok | na | na | na | na | na | na
|
|
||||||
System 3.3V | 3.271 | Volts | ok | na | na | na | na | na | na
|
|
||||||
CPU0 Vcore | 1.127 | Volts | ok | na | na | na | na | na | na
|
|
||||||
System 1.25V | 1.254 | Volts | ok | na | na | na | na | na | na
|
|
||||||
System 1.8V | 1.842 | Volts | ok | na | na | na | na | na | na
|
|
||||||
System 1.2V | 1.107 | Volts | ok | na | na | na | na | na | na
|
|
||||||
CPU0 Diode | na | degrees C | na | na | 20.000 | 25.000 | 85.000 | 90.000 | 95.000
|
|
||||||
CPU0 Dmn 0 Temp | 24.500 | degrees C | ok | na | 0.000 | 0.000 | 97.000 | 100.000 | 100.500
|
|
||||||
CPU0 Dmn 1 Temp | 29.000 | degrees C | ok | na | 0.000 | 0.000 | 97.000 | 100.000 | 100.500
|
|
||||||
# HP ProLiant DL160
|
|
||||||
FAN1 ROTOR1 | 7680.492 | RPM | ok | na | inf | na | na | 1000.400 | na
|
|
||||||
# HP ProLiant DL360 G5
|
|
||||||
Fan Block 1 | 34.888 | unspecified | nc | na | na | 75.264 | na | na | na
|
|
||||||
Fan Block 2 | 29.792 | unspecified | nc | na | na | 75.264 | na | na | na
|
|
||||||
Fan Block 3 | 37.240 | unspecified | nc | na | na | 75.264 | na | na | na
|
|
||||||
Fan Blocks | 0.000 | unspecified | nc | na | na | 0.000 | na | na | na
|
|
||||||
Temp 1 | 40.000 | degrees C | ok | na | na | -64.000 | na | na | na
|
|
||||||
Temp 2 | 21.000 | degrees C | ok | na | na | -64.000 | na | na | na
|
|
||||||
Temp 3 | 30.000 | degrees C | ok | na | na | -64.000 | na | na | na
|
|
||||||
Temp 4 | 30.000 | degrees C | ok | na | na | -64.000 | na | na | na
|
|
||||||
Temp 5 | 28.000 | degrees C | ok | na | na | -64.000 | na | na | na
|
|
||||||
Temp 6 | na | degrees C | na | na | na | 32.000 | na | na | na
|
|
||||||
Temp 7 | na | degrees C | na | na | na | 32.000 | na | na | na
|
|
||||||
Power Meter | 214.000 | Watts | cr | na | na | 384.000 | na | na | na
|
|
||||||
Power Meter 2 | 220.000 | watts | cr | na | na | 384.000 | na | na | na
|
|
||||||
|
|
||||||
=head2 ipmitool sdr
|
|
||||||
|
|
||||||
# HP ProLiant ML110 G5
|
|
||||||
CPU FAN | 1434.31 RPM | ok
|
|
||||||
SYSTEM FAN | 1497.45 RPM | ok
|
|
||||||
System 12V | 12.10 Volts | ok
|
|
||||||
System 5V | 5.08 Volts | ok
|
|
||||||
System 3.3V | 3.27 Volts | ok
|
|
||||||
CPU0 Vcore | 1.14 Volts | ok
|
|
||||||
System 1.25V | 1.25 Volts | ok
|
|
||||||
System 1.8V | 1.84 Volts | ok
|
|
||||||
System 1.2V | 1.11 Volts | ok
|
|
||||||
CPU0 Diode | disabled | ns
|
|
||||||
CPU0 Dmn 0 Temp | 23.50 degrees C | ok
|
|
||||||
CPU0 Dmn 1 Temp | 29 degrees C | ok
|
|
||||||
# HP ProLiant DL360 G5
|
|
||||||
Fan Block 1 | 34.89 unspecifi | nc
|
|
||||||
Fan Block 2 | 29.79 unspecifi | nc
|
|
||||||
Fan Block 3 | 37.24 unspecifi | nc
|
|
||||||
Fan Blocks | 0 unspecified | nc
|
|
||||||
Temp 1 | 41 degrees C | ok
|
|
||||||
Temp 2 | 19 degrees C | ok
|
|
||||||
Temp 3 | 30 degrees C | ok
|
|
||||||
Temp 4 | 30 degrees C | ok
|
|
||||||
Temp 5 | 26 degrees C | ok
|
|
||||||
Temp 6 | disabled | ns
|
|
||||||
Temp 7 | disabled | ns
|
|
||||||
Power Meter | 208 Watts | cr
|
|
||||||
Power Meter 2 | 210 watts | cr
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
# vim:syntax=perl
|
|
@ -1,2 +0,0 @@
|
|||||||
Check http://aouyar.github.com/PyMunin/
|
|
||||||
to get the most recent versionof the PyMunin Multi graph Munin Plugins and documentation.
|
|
@ -1,106 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
#
|
|
||||||
# Plugin to monitor BGP table summary statistics on a cisco router.
|
|
||||||
#
|
|
||||||
# Original Author: Peter Holzleitner
|
|
||||||
#
|
|
||||||
# Revision 1.1 2010/10/14 19:19
|
|
||||||
#
|
|
||||||
# Configuration variables:
|
|
||||||
#
|
|
||||||
# iosuser - username (default "")
|
|
||||||
# iospass - password (default "")
|
|
||||||
#
|
|
||||||
# Parameters:
|
|
||||||
#
|
|
||||||
# config (required)
|
|
||||||
#
|
|
||||||
# Magic markers (optional - only used by munin-config and some
|
|
||||||
# installation scripts):
|
|
||||||
#%# family=auto
|
|
||||||
|
|
||||||
|
|
||||||
use Net::Telnet::Cisco;
|
|
||||||
use Sys::Syslog;
|
|
||||||
|
|
||||||
|
|
||||||
if ($0 =~ /^(?:|.*\/)cisco_bgp_([^_]+)$/) {
|
|
||||||
$host = $1;
|
|
||||||
}
|
|
||||||
|
|
||||||
($^O eq "linux" || $^O eq "openbsd") && Sys::Syslog::setlogsock('unix');
|
|
||||||
openlog('munin.bgp', 'cons,pid', 'daemon');
|
|
||||||
|
|
||||||
|
|
||||||
my @BGP_nbr;
|
|
||||||
my @BGP_pfx;
|
|
||||||
my $tot_pfx;
|
|
||||||
my $iosuser = $ENV{iosuser} || "";
|
|
||||||
my $iospass = $ENV{iospass} || "";
|
|
||||||
|
|
||||||
&fetch_bgpstats($host, $iosuser, $iospass);
|
|
||||||
|
|
||||||
|
|
||||||
if ($ARGV[0] and $ARGV[0] eq "config") {
|
|
||||||
print "host_name $host\n";
|
|
||||||
print "graph_args --base 1024 -l 0 --vertical-label Prefixes\n";
|
|
||||||
print "graph_title BGP Neighbour Statistics\n";
|
|
||||||
print "graph_category network\n";
|
|
||||||
print "graph_info This graph shows the number of BGP prefixes received by neighbour.\n";
|
|
||||||
|
|
||||||
my($n, $i); $n = scalar @BGP_nbr; $i = 0;
|
|
||||||
while($n--) {
|
|
||||||
my $neigh = $BGP_nbr[$i++];
|
|
||||||
print "n$i.label $neigh\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
# print "total.label Total\n";
|
|
||||||
# print "total.info Total number of prefixes in the BGP table\n";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
my($n, $i); $n = scalar @BGP_nbr; $i = 0;
|
|
||||||
while($n--) {
|
|
||||||
my $pfx = $BGP_pfx[$i++];
|
|
||||||
print "n$i.value $pfx\n";
|
|
||||||
}
|
|
||||||
# print "total.value $tot_pfx\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub fetch_bgpstats
|
|
||||||
{
|
|
||||||
my $hostname = shift;
|
|
||||||
my $username = shift;
|
|
||||||
my $password = shift;
|
|
||||||
my $session = Net::Telnet::Cisco->new(Host => $host);
|
|
||||||
|
|
||||||
$session->login($username, $password);
|
|
||||||
$session->cmd('terminal length 200');
|
|
||||||
$session->cmd('terminal width 200');
|
|
||||||
my @output = $session->cmd('show ip bgp summary');
|
|
||||||
|
|
||||||
# example output of router
|
|
||||||
# ------------------------
|
|
||||||
# [...]
|
|
||||||
# Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
|
|
||||||
# 11.111.11.111 4 98765 12403694 509571 308911893 0 0 1d23h 329193
|
|
||||||
# 122.122.122.122 4 1234 13242856 383827 308911879 0 0 00:08:22 330761
|
|
||||||
|
|
||||||
foreach(@output) {
|
|
||||||
chomp; s/\r//g;
|
|
||||||
$tot_pfx = $1 if /^BGP activity (\d+)\/(\d+) prefixes/;
|
|
||||||
syslog('debug', "$hostname: $_\n");
|
|
||||||
|
|
||||||
next unless /^(\d+\.\d+\.\d+\.\d+)\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+[0-9a-z:]+\s+(\d+)/;
|
|
||||||
my ($neigh, $as, $pfx) = ($1, $2, $3);
|
|
||||||
syslog('debug', "$neigh (AS $as)");
|
|
||||||
push @BGP_nbr, "$neigh (AS $as)";
|
|
||||||
push @BGP_pfx, $pfx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# vim:syntax=perl:ts=8
|
|
@ -1,378 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
#
|
|
||||||
=head1 OPENTRACKER PLUGIN
|
|
||||||
|
|
||||||
A Plugin to monitor OpenTracker Servers and their Performance
|
|
||||||
|
|
||||||
=head1 MUNIN CONFIGURATION
|
|
||||||
|
|
||||||
[opentracker*]
|
|
||||||
env.host 127.0.0.1 *default*
|
|
||||||
env.port 6969 *default*
|
|
||||||
env.uri /stats *default*
|
|
||||||
|
|
||||||
=head2 MUNIN ENVIRONMENT CONFIGURATION EXPLANATION
|
|
||||||
|
|
||||||
host = opentracker host to connect to
|
|
||||||
port = opentracker http port to connect to
|
|
||||||
uri = stats uri for appending requests for data
|
|
||||||
|
|
||||||
I need this information so I can later build the full url which normally
|
|
||||||
looks like the following example when put together:
|
|
||||||
http://127.0.0.1:6969/stats?mode=conn
|
|
||||||
|
|
||||||
=head1 AUTHOR
|
|
||||||
|
|
||||||
Matt West < https://github.com/mhwest13/OpenTracker-Munin-Plugin >
|
|
||||||
|
|
||||||
=head1 LICENSE
|
|
||||||
|
|
||||||
GPLv2
|
|
||||||
|
|
||||||
=head1 MAGIC MARKERS
|
|
||||||
|
|
||||||
#%# family=auto
|
|
||||||
#%# capabilities=autoconf suggest
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
use File::Basename;
|
|
||||||
use LWP::UserAgent;
|
|
||||||
|
|
||||||
if (basename($0) !~ /^opentracker_/) {
|
|
||||||
print "This script needs to be named opentracker_ and have symlinks which start the same.\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $host = $ENV{host} || '127.0.0.1';
|
|
||||||
my $port = $ENV{port} || 6969;
|
|
||||||
my $uri = $ENV{uri} || '/stats';
|
|
||||||
|
|
||||||
=head1 Graph Declarations
|
|
||||||
|
|
||||||
This block of code builds up all of the graph info for all root / sub graphs.
|
|
||||||
|
|
||||||
%graphs is a container for all of the graph definition information. In here is where you'll
|
|
||||||
find the configuration information for munin's graphing procedure.
|
|
||||||
Format:
|
|
||||||
|
|
||||||
$graph{graph_name} => {
|
|
||||||
config => {
|
|
||||||
{ key => value }, You'll find the main graph config stored here.
|
|
||||||
{ ... },
|
|
||||||
},
|
|
||||||
keys => [ 'Name', 'Name', 'Name', ... ], Used for building results set.
|
|
||||||
datasrc => [
|
|
||||||
# Name: name given to data value
|
|
||||||
# Attr: Attribute for given value, attribute must be valid plugin argument
|
|
||||||
{ name => 'Name', info => 'info about graph' },
|
|
||||||
{ ... },
|
|
||||||
],
|
|
||||||
results => {
|
|
||||||
{ key => value }, You'll find the results info from fetch_stats call stored here.
|
|
||||||
{ ... },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
my %graphs;
|
|
||||||
|
|
||||||
# graph for connections
|
|
||||||
$graphs{conn} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'Connections',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'Current Connections',
|
|
||||||
info => 'Current Connections to OpenTracker',
|
|
||||||
},
|
|
||||||
keys => [ 'Requests', 'Announces' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Requests', label => 'Requests', min => '0', type => 'COUNTER', info => 'number of Requests', draw => 'AREA' },
|
|
||||||
{ name => 'Announces', label => 'Announces', min => '0', type => 'COUNTER', info => 'number of Announces', draw => 'LINE2' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for peers
|
|
||||||
$graphs{peer} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'Peers',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'Peers and Seeders',
|
|
||||||
info => 'Current Peer and Seeder Connections',
|
|
||||||
},
|
|
||||||
keys => [ 'Peers', 'Seeders' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Peers', label => 'Peers', min => '0', type => 'GAUGE', info => 'current number of leechers & seeders (peers)', draw => 'AREA' },
|
|
||||||
{ name => 'Seeders', label => 'Seeders', min => '0', type => 'GAUGE', info => 'current number of seeders', draw => 'LINE2' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for scrapes
|
|
||||||
$graphs{scrp} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'Scrapes',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'Scrapes',
|
|
||||||
info => 'Number of Scrapes (TCP/UDP)',
|
|
||||||
},
|
|
||||||
keys => [ 'TCP', 'UDP' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'TCP', label => 'TCP Requests', min => '0', type => 'COUNTER', info => 'number of scrapes requested via tcp', draw => 'AREASTACK' },
|
|
||||||
{ name => 'UDP', label => 'UDP Requests', min => '0', type => 'COUNTER', info => 'number of scrapes requested via udp', draw => 'AREA' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for livesyncs
|
|
||||||
$graphs{syncs} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'Syncs',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'LiveSyncs',
|
|
||||||
info => 'OpenTracker LiveSync Requests',
|
|
||||||
},
|
|
||||||
keys => [ 'Incoming', 'Outgoing' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Incoming', label => 'Incoming Syncs', min => '0', type => 'COUNTER', info => 'number of Incoming Syncs', draw => 'AREA' },
|
|
||||||
{ name => 'Outgoing', label => 'Outgoing Syncs', min => '0', type => 'COUNTER', info => 'number of Outgoing Syncs', draw => 'LINE2' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for tcp4 connections
|
|
||||||
$graphs{tcp4} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'TCP4 Requests',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'TCP4 Requests',
|
|
||||||
info => 'Current TCP4 Requests / Announces',
|
|
||||||
},
|
|
||||||
keys => [ 'Requests', 'Announces' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Requests', label => 'Requests', min => '0', type => 'COUNTER', info => 'number of tcp4 Requests', draw => 'AREA' },
|
|
||||||
{ name => 'Announces', label => 'Announces', min => '0', type => 'COUNTER', info => 'number of tcp4 Announces', draw => 'LINE2' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for torrents
|
|
||||||
$graphs{torr} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => '# of Torrents',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'Torrents',
|
|
||||||
info => 'Current number of Torrents',
|
|
||||||
},
|
|
||||||
keys => [ 'Torrents' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Torrents', label => 'Torrents', min => '0', type => 'GAUGE', info => 'number of torrents', draw => 'AREA' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
# graph for udp4 connections
|
|
||||||
$graphs{udp4} = {
|
|
||||||
config => {
|
|
||||||
args => '--lower-limit 0',
|
|
||||||
vlabel => 'UDP4 Requests',
|
|
||||||
category => 'opentracker',
|
|
||||||
title => 'UDP4 Requests',
|
|
||||||
info => 'Current UDP4 Requests / Announces',
|
|
||||||
},
|
|
||||||
keys => [ 'Requests', 'Announces' ],
|
|
||||||
datasrc => [
|
|
||||||
{ name => 'Requests', label => 'Requests', min => '0', type => 'COUNTER', info => 'number of udp4 Requests', draw => 'AREA' },
|
|
||||||
{ name => 'Announces', label => 'Announces', min => '0', type => 'COUNTER', info => 'number of udp4 Announces', draw => 'LINE2' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
=head1 Munin Checks
|
|
||||||
|
|
||||||
These checks look for config / autoconf / suggest params
|
|
||||||
|
|
||||||
=head2 Config Check
|
|
||||||
|
|
||||||
This block of code looks at the argument that is possibly supplied,
|
|
||||||
should it be config, it then checks to make sure the plugin
|
|
||||||
specified exists, assuming it does, it will run the do_config
|
|
||||||
subroutine for the plugin specified, otherwise it dies complaining
|
|
||||||
about an unknown plugin.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
if (defined $ARGV[0] && $ARGV[0] eq 'config') {
|
|
||||||
# Lets take the plugin from the execution name.
|
|
||||||
$0 =~ /opentracker_(.+)*/;
|
|
||||||
my $plugin = $1;
|
|
||||||
# And lets make sure we have a plugin called that.
|
|
||||||
die 'Unknown Plugin Specified: ' . ($plugin ? $plugin : '') unless $graphs{$plugin};
|
|
||||||
# Now lets go ahead and print out our config.
|
|
||||||
print_config($plugin);
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
=head2 Autoconf Check
|
|
||||||
|
|
||||||
This block of code looks at the argument that is possibly supplied,
|
|
||||||
should it be autoconf, we are going to print yes at this point since
|
|
||||||
we've already tested for our binary to exist and be executable, the
|
|
||||||
process will then exit.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
if (defined $ARGV[0] && $ARGV[0] eq 'autoconf') {
|
|
||||||
# well we can execute the binary, so lets make sure we can curl opentracker
|
|
||||||
my $url = "http://".$host.":".$port.$uri."\?mode=version";
|
|
||||||
my $ua = LWP::UserAgent->new;
|
|
||||||
$ua->timeout(15);
|
|
||||||
my $response = $ua->get($url);
|
|
||||||
if ($response->is_success) {
|
|
||||||
print "yes\n";
|
|
||||||
exit 0;
|
|
||||||
} else {
|
|
||||||
print "no: unable to connect to url: $url\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
=head2 Suggest Check
|
|
||||||
|
|
||||||
This block of code looks at the argument that is possibly supplied,
|
|
||||||
should it be suggest, we are going to print the possible plugins
|
|
||||||
which can be specified.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
if (defined $ARGV[0] && $ARGV[0] eq 'suggest') {
|
|
||||||
# well we can execute the binary, so print possible plugin names
|
|
||||||
my @rootplugins = ('conn','peer','scrp','syncs','tcp4','torr','udp4');
|
|
||||||
foreach my $plugin (@rootplugins) {
|
|
||||||
print "$plugin\n";
|
|
||||||
}
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
=head1 Subroutines
|
|
||||||
|
|
||||||
Begin Subroutine calls to output data / config information
|
|
||||||
|
|
||||||
=head2 fetch_output
|
|
||||||
|
|
||||||
This subroutine is the main call for printing data for the plugin.
|
|
||||||
No parameters are taken as this is the default call if no arguments
|
|
||||||
are supplied from the command line.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
fetch_output();
|
|
||||||
|
|
||||||
sub fetch_output {
|
|
||||||
# Lets figure out what plugin they want to run, and check that it exists
|
|
||||||
$0 =~ /opentracker_(.+)*/;
|
|
||||||
my $plugin = $1;
|
|
||||||
die 'Unknown Plugin Specified: ' . ($plugin ? $plugin : '') unless $graphs{$plugin};
|
|
||||||
# Lets print out the data for our plugin
|
|
||||||
print_output($plugin);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
=head2 print_output
|
|
||||||
|
|
||||||
This block of code prints out the return values for our graphs. It takes
|
|
||||||
one parameter $plugin. Returns when completed
|
|
||||||
|
|
||||||
$plugin; graph we are calling up to print data values for
|
|
||||||
|
|
||||||
Example: print_output($plugin);
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub print_output {
|
|
||||||
# Lets get our plugin, set our graph information, and print for Munin to process
|
|
||||||
my ($plugin) = (@_);
|
|
||||||
my $graph = $graphs{$plugin};
|
|
||||||
print "graph opentracker_$plugin\n";
|
|
||||||
# Getting keys to pass to fetch_stats for data retrieval
|
|
||||||
# call up fetch_stats with the keys we just got.
|
|
||||||
my @keys = @{$graph->{keys}};
|
|
||||||
fetch_stats($plugin,@keys);
|
|
||||||
# print the results for the keys with the name for Munin to process
|
|
||||||
foreach my $dsrc (@{$graph->{datasrc}}) {
|
|
||||||
my $output = 0;
|
|
||||||
my %datasrc = %$dsrc;
|
|
||||||
while ( my ($key, $value) = each(%datasrc)) {
|
|
||||||
next if ($key ne 'name');
|
|
||||||
print "$dsrc->{name}.value $graph->{results}->{$value}\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
=head2 print_config
|
|
||||||
|
|
||||||
This subroutine prints out the main config information for all of the graphs.
|
|
||||||
It takes one parameters, $plugin
|
|
||||||
|
|
||||||
$plugin; graph being called up to print config for
|
|
||||||
|
|
||||||
Example: print_config($plugin);
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub print_config {
|
|
||||||
# Lets get our plugin and graph, after that print for Munin to process it.
|
|
||||||
my ($plugin) = (@_);
|
|
||||||
my $graph = $graphs{$plugin};
|
|
||||||
print "graph opentracker_$plugin\n";
|
|
||||||
# Lets print out graph's main config info.
|
|
||||||
my %graphconf = %{$graph->{config}};
|
|
||||||
while ( my ($key, $value) = each(%graphconf)) {
|
|
||||||
print "graph_$key $value\n";
|
|
||||||
}
|
|
||||||
# Lets print our graphs per graph config info.
|
|
||||||
foreach my $dsrc (@{$graph->{datasrc}}) {
|
|
||||||
my %datasrc = %$dsrc;
|
|
||||||
while ( my ($key, $value) = each(%datasrc)) {
|
|
||||||
next if ($key eq 'name');
|
|
||||||
print "$dsrc->{name}.$key $value\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
=head2 fetch_stats
|
|
||||||
|
|
||||||
This subroutine actually fetches data from opentracker with the plugin specified
|
|
||||||
It will then parse the data using the keys assigned in an array.
|
|
||||||
Two parameters are passed, $plugin and @keys, and it will return when complete.
|
|
||||||
|
|
||||||
$plugin; graph we are calling up, we use this to store the results in the hash
|
|
||||||
for easy recall later.
|
|
||||||
@keys; keys we want the values for from opentracker stats url.
|
|
||||||
|
|
||||||
Example: fetch_stats($plugin,@keys);
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub fetch_stats {
|
|
||||||
# Lets get our current plugin and list of keys we want info for, as well as reference our graph
|
|
||||||
my ($plugin,@keys) = (@_);
|
|
||||||
my $graph = $graphs{$plugin};
|
|
||||||
# Lets create our url to fetch
|
|
||||||
my $url = "http://".$host.":".$port.$uri."\?mode=".$plugin;
|
|
||||||
my $ua = LWP::UserAgent->new;
|
|
||||||
$ua->timeout(15);
|
|
||||||
my $response = $ua->get($url);
|
|
||||||
# Lets print some info since we got back some info
|
|
||||||
if ($response->is_success) {
|
|
||||||
my @tmparray = split("\n",$response->content);
|
|
||||||
foreach my $key (@keys) {
|
|
||||||
my $value = shift(@tmparray);
|
|
||||||
$graph->{results}->{$key} = $value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print "Unable to Fetch data from URL: $url\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
This plugin is obsolete. Instead, please use apcupsd_pct plugin:
|
|
||||||
|
|
||||||
apcupsd_pct plugin
|
|
||||||
http://exchange.munin-monitoring.org/plugins/apcupsd_pct/details
|
|
||||||
|
|
||||||
thanks.
|
|
@ -1,2 +0,0 @@
|
|||||||
Check http://aouyar.github.com/PyMunin/ to get the most recent versionof the
|
|
||||||
PyMunin Multi graph Munin Plugins and documentation.
|
|
@ -1,2 +0,0 @@
|
|||||||
Check http://aouyar.github.com/PyMunin/
|
|
||||||
to get the most recent versionof the PyMunin Multi graph Munin Plugins and documentation.
|
|
16
plugins/other/transmission/tr_ratios
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
user=''
|
||||||
|
pass=''
|
||||||
|
|
||||||
|
if [ "$1" = "config" ]; then
|
||||||
|
echo "graph_title Transmission seed ratios"
|
||||||
|
echo "graph_vlabel Seed ratio %"
|
||||||
|
echo "graph_category Transmission"
|
||||||
|
echo "graph_info This plugin shows your transmission ratios per torrent"
|
||||||
|
transmission-remote -n $user:$pass -l | gawk -f /usr/share/munin/plugins/tr_ratios_labels
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
transmission-remote -n $user:$pass -l | gawk -f /usr/share/munin/plugins/tr_ratios_data
|
||||||
|
|
10
plugins/other/transmission/tr_ratios_data
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||||
|
NR > 1 {
|
||||||
|
split($1,torrentid," ")
|
||||||
|
if(torrentid[1] != "Sum:") {
|
||||||
|
split($7,ratio," ")
|
||||||
|
ratio[1] = ratio[1] * 100
|
||||||
|
print "ID" torrentid[1] ".value " ratio[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
8
plugins/other/transmission/tr_ratios_labels
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||||
|
NR > 1 {
|
||||||
|
split($1,torrentid," ")
|
||||||
|
if(torrentid[1] != "Sum:") {
|
||||||
|
print "ID" torrentid[1] ".label " $9
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/perl -w
|
|
||||||
#
|
|
||||||
|
|
||||||
require LWP::UserAgent;
|
|
||||||
|
|
||||||
########################################################################################
|
|
||||||
#
|
|
||||||
# Installation / Configuration
|
|
||||||
#
|
|
||||||
# - place munin_xcache.php in a directory on your webserver
|
|
||||||
# - add the url config to plugin-conf.d/munin-node
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# for more info see http://www.ohardt.net/dev/munin/
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
chomp(my $fqdn=`hostname -f`);
|
|
||||||
|
|
||||||
|
|
||||||
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://user:pwd\@$fqdn/munin_xcache_new.php";
|
|
||||||
|
|
||||||
$URL = $URL . "?what=mem";
|
|
||||||
|
|
||||||
my $ua = LWP::UserAgent->new(timeout => 30);
|
|
||||||
|
|
||||||
|
|
||||||
if ( exists $ARGV[0] and $ARGV[0] eq "config" )
|
|
||||||
{
|
|
||||||
|
|
||||||
$URL = $URL . '&config';
|
|
||||||
|
|
||||||
my $response = $ua->request(HTTP::Request->new('GET',$URL . '&config' ));
|
|
||||||
|
|
||||||
print $response->content;
|
|
||||||
|
|
||||||
|
|
||||||
exit( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
my $response = $ua->request(HTTP::Request->new('GET',$URL));
|
|
||||||
|
|
||||||
|
|
||||||
print $response->content;
|
|
||||||
|
|
||||||
|
|
||||||
exit( 0 );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
|||||||
Check http://aouyar.github.com/PyMunin/ to get the most recent versionof the
|
|
||||||
PyMunin Multi graph Munin Plugins and documentation.
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# toshiba_5520c_print_ munin grabber script
|
|
||||||
# 2009.01 by steve@kosada.com
|
|
||||||
|
|
||||||
destination=`basename $0 | sed 's/^toshiba_5520c_print_//g'`
|
|
||||||
|
|
||||||
if [ "$1" = "config" ]; then
|
|
||||||
echo "graph_title Toshiba 5520C: Pages Printed"
|
|
||||||
echo 'graph_vlabel Pages'
|
|
||||||
echo 'graph_args --lower-limit 0'
|
|
||||||
echo 'graph_category printer'
|
|
||||||
|
|
||||||
echo "printBlack.label Black"
|
|
||||||
echo "printBlack.draw AREA"
|
|
||||||
|
|
||||||
echo "printFullColor.label Full Color"
|
|
||||||
echo "printFullColor.draw STACK"
|
|
||||||
|
|
||||||
echo "printTwinColor.label Twin Color"
|
|
||||||
echo "printTwinColor.draw STACK"
|
|
||||||
else
|
|
||||||
infopage=`wget -q -O - http://$destination:8080/TopAccess/Counter/TotalCount/List.htm | dos2unix | perl -p -e 's/\n/ /m'`
|
|
||||||
|
|
||||||
echo printFullColor.value `echo $infopage | perl -p -e 's/^.+\<B\>Print Counter\<\/B\>.+?\{Full\ Color[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
||||||
echo printTwinColor.value `echo $infopage | perl -p -e 's/^.+\<B\>Print Counter\<\/B\>.+?\{Twin\ Color[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
||||||
echo printBlack.value `echo $infopage | perl -p -e 's/^.+\<B\>Print Counter\<\/B\>.+?\{Black[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
||||||
fi
|
|
@ -1,59 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
HOST=${host:-"127.0.0.1"}
|
|
||||||
|
|
||||||
: << =cut
|
|
||||||
|
|
||||||
=head1 NAME
|
|
||||||
|
|
||||||
snmp_HPLJ2015 - Consumables level on HP LaserJet 2015n reported over SNMP
|
|
||||||
|
|
||||||
=head1 CONFIGURATION
|
|
||||||
|
|
||||||
HOST
|
|
||||||
|
|
||||||
=head1 AUTHOR
|
|
||||||
|
|
||||||
Oleksiy Kochkin
|
|
||||||
|
|
||||||
=head1 LICENSE
|
|
||||||
|
|
||||||
As is.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=head1 MAGIC MARKERS
|
|
||||||
|
|
||||||
#%# family=contrib
|
|
||||||
#%# capabilities=autoconf
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
config)
|
|
||||||
|
|
||||||
echo "graph_title Consumables level @ $HOST"
|
|
||||||
echo 'graph_args --upper-limit 100 -l 0'
|
|
||||||
echo 'graph_vlabel %'
|
|
||||||
echo 'graph_category printers'
|
|
||||||
echo 'graph_scale no'
|
|
||||||
echo 'black.label Black toner level'
|
|
||||||
echo 'black.draw LINE2'
|
|
||||||
echo 'black.type GAUGE'
|
|
||||||
echo 'black.colour 000000'
|
|
||||||
echo 'black.warning 5:'
|
|
||||||
echo 'black.critical 1:'
|
|
||||||
echo 'black.min 0'
|
|
||||||
echo 'black.max 100'
|
|
||||||
exit 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
BLACK_MAX_OID=".1.3.6.1.2.1.43.11.1.1.8.1.1"
|
|
||||||
BLACK_LVL_OID=".1.3.6.1.2.1.43.11.1.1.9.1.1"
|
|
||||||
|
|
||||||
BLACK_MAX=`snmpget -v 1 -c public -Ov -Oq $HOST $BLACK_MAX_OID`
|
|
||||||
BLACK_LVL=`snmpget -v 1 -c public -Ov -Oq $HOST $BLACK_LVL_OID`
|
|
||||||
BLACK_LVL_PERCENTS=$(($BLACK_LVL*100/$BLACK_MAX))
|
|
||||||
|
|
||||||
echo -n "black.value "
|
|
||||||
echo $BLACK_LVL_PERCENTS
|
|
104
plugins/snmp/snmp__apc
Executable file
@ -0,0 +1,104 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
# -*- perl -*-
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
snmp__apc - SNMP plugin to monitor APC metered and managed PDUs.
|
||||||
|
|
||||||
|
=head1 APPLICABLE SYSTEMS
|
||||||
|
|
||||||
|
This has been tested with AP7830 metered PDUs, but should work with
|
||||||
|
most other PDUs that follow the PowerNet-MIB published by APC.
|
||||||
|
|
||||||
|
=head1 CONFIGURATION
|
||||||
|
|
||||||
|
Most likely you want to use SNMP version 3 to connect to the PDUs, as
|
||||||
|
they don't support version 2 (only 1 or 3). This can be achieved by
|
||||||
|
using:
|
||||||
|
|
||||||
|
[snmp_*_apc]
|
||||||
|
env.version 3
|
||||||
|
|
||||||
|
Please see 'perldoc Munin::Plugin::SNMP' for further configuration
|
||||||
|
information.
|
||||||
|
|
||||||
|
=head1 MIB INFORMATION
|
||||||
|
|
||||||
|
This plugin requires the PowerNet-MIB from APC.
|
||||||
|
|
||||||
|
=head1 MAGIC MARKERS
|
||||||
|
|
||||||
|
#%# family=snmpauto
|
||||||
|
#%# capabilities=snmpconf
|
||||||
|
|
||||||
|
=head1 BUGS
|
||||||
|
|
||||||
|
None known.
|
||||||
|
|
||||||
|
=head1 AUTHOR
|
||||||
|
|
||||||
|
Copyright (C) 2012 Diego Elio Pettenò.
|
||||||
|
|
||||||
|
=head1 LICENSE
|
||||||
|
|
||||||
|
GPLv2
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Munin::Plugin;
|
||||||
|
use Munin::Plugin::SNMP;
|
||||||
|
|
||||||
|
# This is the data we care about:
|
||||||
|
# PowerNet-MIB::rPDUIdentModelNumber.0 -> .1.3.6.1.4.1.318.1.1.12.1.5.0
|
||||||
|
# PowerNet-MIB::rPDUIdentSerialNumber.0 -> .1.3.6.1.4.1.318.1.1.12.1.6.0
|
||||||
|
# PowerNet-MIB::rPDULoadDevNumPhases.0 -> .1.3.6.1.4.1.318.1.1.12.2.1.2.0
|
||||||
|
# PowerNet-MIB::rPDULoadPhaseConfigNearOverloadThreshold.phase1 -> .1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.1
|
||||||
|
# PowerNet-MIB::rPDULoadPhaseConfigOverloadThreshold.phase1 -> .1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.1
|
||||||
|
# PowerNet-MIB::rPDULoadStatusLoad.1 -> .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1
|
||||||
|
|
||||||
|
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") {
|
||||||
|
print "index 1.3.6.1.4.1.318.1.1.12.2.2.1.1.1.\n";
|
||||||
|
print "require 1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.[1-9]"; # Load
|
||||||
|
}
|
||||||
|
|
||||||
|
my $oidModelNo = '1.3.6.1.4.1.318.1.1.12.1.5.0';
|
||||||
|
my $oidSerialNo = '1.3.6.1.4.1.318.1.1.12.1.6.0';
|
||||||
|
my $oidNumPhases = '1.3.6.1.4.1.318.1.1.12.2.1.2.0';
|
||||||
|
my $oidNearOverloadThreshold = '1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.';
|
||||||
|
my $oidOverloadThreshold = '1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.';
|
||||||
|
my $oidPhaseLoad = '1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.';
|
||||||
|
|
||||||
|
# SNMP needed for both config and fetch.
|
||||||
|
my $session = Munin::Plugin::SNMP->session();
|
||||||
|
my $numPhases = $session->get_single($oidNumPhases);
|
||||||
|
|
||||||
|
if ($ARGV[0] and $ARGV[0] eq "config") {
|
||||||
|
my ($host,undef,$version) = Munin::Plugin::SNMP->config_session();
|
||||||
|
|
||||||
|
print "host_name $host\n" unless $host eq 'localhost';
|
||||||
|
|
||||||
|
my $modelNo = $session->get_single($oidModelNo);
|
||||||
|
my $serialNo = $session->get_single($oidSerialNo);
|
||||||
|
|
||||||
|
print "graph_title PDU $modelNo ($serialNo)\n";
|
||||||
|
print "graph_vlabel Current drained (A)\n";
|
||||||
|
print "graph_category Sensors\n";
|
||||||
|
|
||||||
|
for( my $phaseIndex = 1; $phaseIndex <= $numPhases; $phaseIndex++ ) {
|
||||||
|
my $nearOverloadThreshold = $session->get_single($oidNearOverloadThreshold . $phaseIndex);
|
||||||
|
my $overloadThreshold = $session->get_single($oidOverloadThreshold . $phaseIndex);
|
||||||
|
print "phase$phaseIndex.label Phase $phaseIndex load\n";
|
||||||
|
print "phase$phaseIndex.warning $nearOverloadThreshold\n";
|
||||||
|
print "phase$phaseIndex.critical $overloadThreshold\n";
|
||||||
|
print "phase$phaseIndex.min 0\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( my $phaseIndex = 1; $phaseIndex <= $numPhases; $phaseIndex++ ) {
|
||||||
|
# the phaseLoad value is defined in dA — we might as well convert to full Amperes
|
||||||
|
my $phaseLoad = $session->get_single($oidPhaseLoad . $phaseIndex) / 10.0;
|
||||||
|
print "phase$phaseIndex.value $phaseLoad\n";
|
||||||
|
}
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |