1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Category Tree: Reduce number of categories

sphinx -> search
unicorn -> webserver
moved some plugins to other dirs to get better seconde level heading
This commit is contained in:
dipohl 2017-02-23 02:22:08 +01:00
parent 444c7939de
commit e08a6448ce
20 changed files with 11 additions and 11 deletions

View file

@ -0,0 +1,114 @@
#! /usr/bin/perl -w
#
# Copyright (C) 2008 Rackspace US, Inc. <http://www.rackspace.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
#
#
# This plugin will graph the chassis fan sensors on a Dell PowerEdge Server
# via the omreport tool. It has been tested on the following chassis:
#
# PE2650/6650
# PE2850/6850
# PE2950
#
# To enable, link omreport_fan_speed to this file. E.g.
#
# ln -s /usr/share/node/node/plugins/omreport_fan_speed /etc/munin/plugins/omreport_fan_speed
#
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
#
# [omreport_*]
# user - User that has permissions to run the omreport binary
# env.omreport - Path to the omreport binary
#
# Parameters:
#
# config
# autoconf
#
# Author: Justin Shepherd <galstrom21@gmail.com>
# Revision: 1.5 2008/10/22
#
#%# family=auto
#%# capabilities=autoconf
use strict;
my $omreport = $ENV{"omreport"} || "/usr/bin/omreport";
if ($ARGV[0] && $ARGV[0] eq "autoconf") {
if (-f $omreport) {
print "yes\n";
}
else {
print "no ($omreport does not exist)\n";
exit(1);
}
} # end if
else {
my $cmd = "$omreport chassis fans";
my @result = `$cmd`;
my (%val, $index);
foreach my $line (@result) {
$line =~ s/\s+/ /g;
$line =~ s/\s$//g;
next if ($line eq "");
my ($field, $value) = split(/ \: /, $line);
if ($field eq "Index") {
$val{$value} = {};
$index = $value;
}
elsif ($field eq "Probe Name") {
$value =~ s/ RPM//g;
$val{$index}{$field} = "$value";
}
elsif ($field eq "Reading") {
$value =~ s/ RPM//g;
$val{$index}{"$field"} = "$value";
}
elsif ($field eq "Maximum Warning Threshold") {
$value =~ s/ RPM//g;
$val{$index}{"Warning Threshold"} = "$value";
}
elsif ($field eq "Maximum Failure Threshold") {
$value =~ s/ RPM//g;
$val{$index}{"Critical Threshold"} = "$value";
}
}
if ($ARGV[0] && $ARGV[0] eq "config") {
print "graph_title OpenManage - Fan Probes\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel Speed in RPMs\n";
print "graph_category Sensors\n";
foreach my $j (sort keys %val) {
print "fan_$j.label $val{$j}{\"Probe Name\"}\n";
if ($val{$j}{"Warning Threshold"} !~ m/\[N\/A\]/i) {
print "fan_$j.warning " .
"$val{$j}{\"Warning Threshold\"}\n";
}
if ($val{$j}{"Critical Threshold"} !~ m/\[N\/A\]/i) {
print "fan_$j.critical " .
"$val{$j}{\"Critical Threshold\"}\n";
}
}
}
else {
foreach my $j (sort keys %val) {
print "fan_$j.value $val{$j}{\"Reading\"}\n";
}
}
}
exit(0);

View file

@ -0,0 +1,105 @@
#!/usr/bin/perl
#
# Copyright (C) 2009 Andrew Chadwick, University of Oxford <andrew.chadwick@ceu.ox.ac.uk>
# Based on work by Rackspace US, Inc. <http://www.rackspace.com>, (C) 2008.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
#
#
# This plugin will graph the per-PSU current draw of a Dell PowerEdge Server
# via the omreport tool. It has been tested on the following chassis:
#
# PowerEdge R905
#
# To enable, create a link in your plugins directory to wherever you
# installed this file, e.g.:
#
# cd /etc/munin/plugins
# ln -s /usr/share/munin/plugins/omreport_pwrmon_current
#
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
#
# [omreport_*]
# user - User that has permissions to run the omreport binary
# env.omreport - Path to the omreport binary
#
# Parameters:
#
# config
# autoconf
#
# Author: Andrew Chadwick <andrew.chadwick@ceu.ox.ac.uk>
# Revision: 0.1 2008-01-28
#
#%# family=auto
#%# capabilities=autoconf
use strict;
my $omreport = $ENV{"omreport"} || "/usr/bin/omreport";
if ($ARGV[0] && $ARGV[0] eq "autoconf") {
if (-f $omreport) {
print "yes\n";
}
else {
print "no ($omreport does not exist)\n";
exit(1);
}
}
else {
my @cmd = ($omreport, qw{chassis pwrmonitoring});
my ($index, %val);
my $pid = open(my $cmd_out, '-|', @cmd) or die "@cmd: $!\n";
defined $pid or die "fork() failed: $!\n";
my $amperage_idx = 0;
while (<$cmd_out>) {
s/\s+/\040/g;
s/\s+$//;
s/^\s+//;
/^Amperage\b/ .. /^Power\s+Tracking\b/ or next;
my ($field, $value) = split(/\s+\:\s+/, $_);
if ($field eq 'Location') {
$index = "current_${amperage_idx}";
++$amperage_idx;
$val{$index} = {
label => $value,
};
}
elsif ($field eq 'Reading') {
$value =~ s{\s+A$}{};
$value =~ s{\[N/A\]}{}g;
$val{$index}{value} = $value;
}
}
close $cmd_out;
if ($ARGV[0] && $ARGV[0] eq "config") {
print "graph_title OpenManage - Power Monitoring - Current\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel Amps\n";
print "graph_category Sensors\n";
foreach my $j (sort keys %val) {
print "$j.label $val{$j}{label}\n";
}
}
else {
foreach my $j (sort keys %val) {
print "$j.value $val{$j}{value}\n";
}
}
}
exit(0);

View file

@ -0,0 +1,121 @@
#!/usr/bin/perl
#
# Copyright (C) 2009 Andrew Chadwick, University of Oxford <andrew.chadwick@ceu.ox.ac.uk>
# Based on work by Rackspace US, Inc. <http://www.rackspace.com>, (C) 2008.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
#
#
# This plugin will graph the power consumption of a Dell PowerEdge Server
# via the omreport tool. It has been tested on the following chassis:
#
# PowerEdge R905
#
# To enable, create a link in your plugins directory to wherever you
# installed this file, e.g.:
#
# cd /etc/munin/plugins
# ln -s /usr/share/munin/plugins/omreport_pwrmon_power
#
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
#
# [omreport_*]
# user - User that has permissions to run the omreport binary
# env.omreport - Path to the omreport binary
#
# Parameters:
#
# config
# autoconf
#
# Author: Andrew Chadwick <andrew.chadwick@ceu.ox.ac.uk>
# Revision: 0.1 2008-01-28
#
#%# family=auto
#%# capabilities=autoconf
use strict;
my $omreport = $ENV{"omreport"} || "/usr/bin/omreport";
if ($ARGV[0] && $ARGV[0] eq "autoconf") {
if (-f $omreport) {
print "yes\n";
}
else {
print "no ($omreport does not exist)\n";
exit(1);
}
}
else {
my @cmd = ($omreport, qw{chassis pwrmonitoring});
my ($index, %val);
my $pid = open(my $cmd_out, '-|', @cmd) or die "@cmd: $!\n";
defined $pid or die "fork() failed: $!\n";
my $amperage_idx = 0;
while (<$cmd_out>) {
s/\s+/\040/g;
s/\s+$//;
s/^\s+//;
/^Power\s+Consumption\b/ .. /^Amperage\b/ or next;
my ($field, $value) = split(/\s+\:\s+/, $_);
if ($field eq 'Index') {
$index = "power_${value}";
$val{$index} = {};
}
elsif ($field eq 'Probe Name') {
$val{$index}{label} = $value;
}
elsif ($field eq 'Reading') {
$value =~ s{\s+W$}{};
$value =~ s{\[N/A\]}{}g;
$val{$index}{value} = $value;
}
elsif ($field eq 'Warning Threshold') {
$value =~ s{\s+W$}{};
$value =~ s{\[N/A\]}{}g;
$val{$index}{warning} = $value;
}
elsif ($field eq 'Failure Threshold') {
$value =~ s{\s+W$}{};
$value =~ s{\[N/A\]}{}g;
$val{$index}{critical} = $value;
}
}
close $cmd_out;
if ($ARGV[0] && $ARGV[0] eq "config") {
print "graph_title OpenManage - Power Monitoring - Power\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel Watts\n";
print "graph_category Sensors\n";
foreach my $j (sort keys %val) {
print "$j.label $val{$j}{label}\n";
if ($val{$j}{warning}) {
print "$j.warning $val{$j}{warning}\n";
}
if ($val{$j}{critical}) {
print "$j.critical $val{$j}{critical}\n";
}
}
}
else {
foreach my $j (sort keys %val) {
print "$j.value $val{$j}{value}\n";
}
}
}
exit(0);

View file

@ -0,0 +1,195 @@
#!/usr/bin/perl
#
# Copyright (C) 2009 Andrew Chadwick, University of Oxford <andrew.chadwick@ceu.ox.ac.uk>
# Based on work by Rackspace US, Inc. <http://www.rackspace.com>, (C) 2008.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
#
#
# This plugin will graph all available temperature probes in the storage
# array enclosures of a Dell PowerEdge Server via the omreport tool. It has
# been tested on the following combinations:
#
# PowerEdge R905 + PERC 6/E + MD1120
#
# To enable, create a link in your plugins directory to wherever you
# installed this file, e.g.:
#
# cd /etc/munin/plugins
# ln -s /usr/share/munin/plugins/omreport_storage_temp
#
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
#
# [omreport_*]
# user - User that has permissions to run the omreport binary
# env.omreport - Path to the omreport binary
#
# Parameters:
#
# config
# autoconf
#
# Author: Andrew Chadwick <andrew.chadwick@ceu.ox.ac.uk>
# Revision: 0.1 2008-01-28
#
#%# family=auto
#%# capabilities=autoconf
sub get_controllers {
my $omreport = shift;
my %ctrlrs;
my @cmd = ($omreport, 'storage', 'controller');
my $pid = open(my $cmd_out, '-|', @cmd) or die "@cmd: $!\n";
defined $pid or die "fork() failed: $!\n";
my $id;
while (<$cmd_out>) {
s/\s+/\040/g;
s/\s+$//;
s/^\s+//;
my ($field, $value) = split(/\s+\:\s+/, $_);
defined $value or next;
if ($field eq 'ID') {
$id = $value;
}
elsif ($field eq 'Name') {
defined $id or next;
$ctrlrs{$id} = $value;
}
}
close $cmd_out;
return %ctrlrs;
}
sub get_controller_enclosures {
my ($omreport, $ctrlr) = @_;
my %encs;
my @cmd = ($omreport, 'storage', 'enclosure', "controller=$ctrlr");
my $pid = open(my $cmd_out, '-|', @cmd) or die "@cmd: $!\n";
defined $pid or die "fork() failed: $!\n";
my $id;
while (<$cmd_out>) {
s/\s+/\040/g;
s/\s+$//;
s/^\s+//;
my ($field, $value) = split(/\s+\:\s+/, $_);
defined $value or next;
if ($field eq 'ID') {
$id = $value;
}
elsif ($field eq 'Name') {
defined $id or next;
$encs{$id} = $value;
}
}
close $cmd_out;
return %encs;
}
sub get_enclosure_temps {
my ($omreport, $ctrlr, $enc) = @_;
my %temp_hashes;
my @cmd = ($omreport, 'storage', 'enclosure', "controller=$ctrlr",
"enclosure=$enc", "info=temps");
my $pid = open(my $cmd_out, '-|', @cmd) or die "@cmd: $!\n";
defined $pid or die "fork() failed: $!\n";
my $idx;
while (<$cmd_out>) {
s/\s+/\040/g;
s/\s+$//;
s/^\s+//;
my ($field, $value) = split(/\s+\:\s+/, $_);
defined $value or next;
if ($field eq 'ID') {
$idx = $value;
$temp_hashes{$idx} = {
id => $value,
};
}
elsif ($field eq 'Name') {
defined $idx or next;
$temp_hashes{$idx}{name} = $value;
}
elsif ($field eq 'Reading') {
defined $idx or next;
$value =~ s{\s+C$}{};
$temp_hashes{$idx}{value} = $value;
}
elsif ($field eq 'Maximum Warning Threshold') {
defined $idx or next;
$value =~ s{\s+C$}{};
$temp_hashes{$idx}{warning} = $value;
}
elsif ($field eq 'Maximum Failure Threshold') {
defined $idx or next;
$value =~ s{\s+C$}{};
$temp_hashes{$idx}{critical} = $value;
}
}
close $cmd_out;
return %temp_hashes;
}
use strict;
my $omreport = $ENV{"omreport"} || "/usr/bin/omreport";
if ($ARGV[0] && $ARGV[0] eq "autoconf") {
if (-f $omreport) {
print "yes\n";
}
else {
print "no ($omreport does not exist)\n";
exit(1);
}
}
else {
my %ctrlrs = get_controllers($omreport);
my $is_config_pass = $ARGV[0] && $ARGV[0] eq "config";
if ($is_config_pass) {
print "graph_title OpenManage - Storage - Temperatures\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel Temp in Degrees Celsius\n";
print "graph_category Sensors\n";
print "graph_info Temperature sensors within storage enclosures on the system, typically external ones managed via PERC 6/E adapters.\n";
}
foreach my $c (sort keys %ctrlrs) {
my $c_name = $ctrlrs{$c};
my %encs = get_controller_enclosures($omreport, $c);
foreach my $e (sort keys %encs) {
my $e_name = $encs{$e};
my %temp_hashes = get_enclosure_temps($omreport, $c, $e);
foreach my $t (sort keys %temp_hashes) {
my $t_hash = $temp_hashes{$t};
my ($t_name, $val, $warn, $crit) = @$t_hash{qw(
name value warning critical
)};
$c =~ s{\W+}{_}g;
$e =~ s{\W+}{_}g;
$t =~ s{\W+}{_}g;
my $g = "ctrlr${c}_enc${e}_temp${t}";
if ($is_config_pass) {
print "$g.label $c_name\: $e_name\: $t_name\n";
print "$g.warning $warn\n";
print "$g.critical $crit\n";
}
else {
print "$g.value $val\n";
}
}
}
}
}
exit(0);

109
plugins/omreport/omreport_temp Executable file
View file

@ -0,0 +1,109 @@
#! /usr/bin/perl -w
#
# Copyright (C) 2008 Rackspace US, Inc. <http://www.rackspace.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
#
#
# This plugin will graph the chassis temp sensors on a Dell PowerEdge Server
# via the omreport tool. It has been tested on the following chassis:
#
# PE2650/6650
# PE2850/6850
# PE2950
#
# To enable, link omreport_temps to this file. E.g.
#
# ln -s /usr/share/node/node/plugins/omreport_temps /etc/munin/plugins/omreport_temps
#
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
#
# [omreport_*]
# user - User that has permissions to run the omreport binary
# env.omreport - Path to the omreport binary
#
# Parameters:
#
# config
# autoconf
#
# Author: Justin Shepherd <galstrom21@gmail.com>
# Revision: 1.5 2008/10/22
#
#%# family=auto
#%# capabilities=autoconf
use strict;
my $omreport = $ENV{"omreport"} || "/usr/bin/omreport";
if ($ARGV[0] && $ARGV[0] eq "autoconf") {
if (-f $omreport) {
print "yes\n";
} # end if
else {
print "no ($omreport does not exist)\n";
exit(1);
} # end else
} # end if
else {
my $cmd = "$omreport chassis temps";
my @result = `$cmd`;
my (%val, $index);
foreach my $line (@result) {
$line =~ s/\s+/ /g;
$line =~ s/\s$//g;
next if ($line eq "");
my ($field, $value) = split(/ \: /, $line);
if ($field eq "Index") {
$val{$value} = {};
$index = $value;
} # end if
elsif ($field eq "Probe Name") {
$value =~ s/ Temp//g;
$val{$index}{$field} = "$value";
} # end elsif
elsif ($field eq "Reading") {
$value =~ s/ C//g;
$val{$index}{"$field"} = "$value";
} # end elsif
elsif ($field eq "Maximum Warning Threshold") {
$value =~ s/ C//g;
$val{$index}{"Warning Threshold"} = "$value";
} # end elsif
elsif ($field eq "Maximum Failure Threshold") {
$value =~ s/ C//g;
$val{$index}{"Critical Threshold"} = "$value";
} # end elsif
} # end foreach
if ($ARGV[0] && $ARGV[0] eq "config") {
print "graph_title OpenManage - 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";
} # end foreach
} # end if
else {
foreach my $j (sort keys %val) {
print "probe_$j.value $val{$j}{\"Reading\"}\n";
} # end foreach
} # end else
} # end else
exit(0);