mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-11-25 19:47:02 +00:00
Added handling of parameter 190 (Airflow_Temperature), Seagate hard drives the next generation.
This commit is contained in:
parent
37c8fd9a77
commit
6dbfc42550
1 changed files with 249 additions and 247 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/local/bin/perl -w
|
#!/usr/local/bin/perl -w
|
||||||
# -*- perl -*-
|
# -*- perl -*-
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
@ -14,7 +14,7 @@ the harddrive devices.
|
||||||
The following environment variables are used
|
The following environment variables are used
|
||||||
|
|
||||||
smartctl - path to smartctl executable
|
smartctl - path to smartctl executable
|
||||||
drives - List drives to monitor. E.g. "env.drives hda hdc".
|
drives - List drives to monitor. E.g. "env.drives hda hdc".
|
||||||
type_$dev - device type for one drive, e.g. "env.type_sda 3ware,0"
|
type_$dev - device type for one drive, e.g. "env.type_sda 3ware,0"
|
||||||
or more typically "env.type_sda ata" if sda is a SATA disk.
|
or more typically "env.type_sda ata" if sda is a SATA disk.
|
||||||
args_$dev - additional arguments to smartctl for one drive,
|
args_$dev - additional arguments to smartctl for one drive,
|
||||||
|
|
@ -104,9 +104,9 @@ if (!$smartctl) {
|
||||||
push (@dirs, qw(/usr/bin /usr/sbin /usr/local/bin /usr/local/sbin) );
|
push (@dirs, qw(/usr/bin /usr/sbin /usr/local/bin /usr/local/sbin) );
|
||||||
|
|
||||||
until ($smartctl or @dirs == 0) {
|
until ($smartctl or @dirs == 0) {
|
||||||
my $dir = shift @dirs;
|
my $dir = shift @dirs;
|
||||||
my $path = $dir.'/smartctl';
|
my $path = $dir.'/smartctl';
|
||||||
$smartctl = $path if -x $path;
|
$smartctl = $path if -x $path;
|
||||||
}
|
}
|
||||||
} elsif (! -x $smartctl) {
|
} elsif (! -x $smartctl) {
|
||||||
# If it is set, verify it
|
# If it is set, verify it
|
||||||
|
|
@ -139,7 +139,7 @@ if ($^O eq 'linux') {
|
||||||
# without probing them.
|
# without probing them.
|
||||||
} elsif ($^O eq 'freebsd') {
|
} elsif ($^O eq 'freebsd') {
|
||||||
opendir(DEV, '/dev');
|
opendir(DEV, '/dev');
|
||||||
@drives = grep /^ada*[0-9]+$/, readdir DEV;
|
@drives = grep /^ad[0-9]+$/, readdir DEV;
|
||||||
closedir(DEV);
|
closedir(DEV);
|
||||||
} elsif ($^O eq 'solaris') {
|
} elsif ($^O eq 'solaris') {
|
||||||
@drives = map { s@.*/@@ ; $_ } glob '/dev/rdsk/c*t*d*s2';
|
@drives = map { s@.*/@@ ; $_ } glob '/dev/rdsk/c*t*d*s2';
|
||||||
|
|
@ -175,7 +175,7 @@ if (defined $ARGV[0]) {
|
||||||
} elsif ($ARGV[0] eq 'config') {
|
} elsif ($ARGV[0] eq 'config') {
|
||||||
print "graph_title HDD temperature\n";
|
print "graph_title HDD temperature\n";
|
||||||
print "graph_args --base 1000 -l 0\n";
|
print "graph_args --base 1000 -l 0\n";
|
||||||
print "graph_vlabel temp in °C\n";
|
print "graph_vlabel temp in ╟C\n";
|
||||||
print "graph_category sensors\n";
|
print "graph_category sensors\n";
|
||||||
print "graph_info This graph shows the temperature in degrees Celsius of the hard drives in the machine.\n";
|
print "graph_info This graph shows the temperature in degrees Celsius of the hard drives in the machine.\n";
|
||||||
print "$_.label $_\n" foreach @drives;
|
print "$_.label $_\n" foreach @drives;
|
||||||
|
|
@ -191,9 +191,9 @@ foreach my $drive (@drives) {
|
||||||
# isn't supported (hdparm isn't available on all platforms).
|
# isn't supported (hdparm isn't available on all platforms).
|
||||||
if (!$use_nocheck && $hdparm && $fulldev =~ /\/dev\/[sh]d?/) {
|
if (!$use_nocheck && $hdparm && $fulldev =~ /\/dev\/[sh]d?/) {
|
||||||
if (`$hdparm -C $fulldev 2>/dev/null` =~ /standby/) {
|
if (`$hdparm -C $fulldev 2>/dev/null` =~ /standby/) {
|
||||||
warn "[DEBUG] Drive $fulldev is in standby mode, not checking\n"
|
warn "[DEBUG] Drive $fulldev is in standby mode, not checking\n"
|
||||||
if $DEBUG;
|
if $DEBUG;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,6 +215,9 @@ foreach my $drive (@drives) {
|
||||||
} elsif ($output =~ /^(231 Temperature_Celsius.*)/m) {
|
} elsif ($output =~ /^(231 Temperature_Celsius.*)/m) {
|
||||||
my @F = split ' ', $1;
|
my @F = split ' ', $1;
|
||||||
print "$drive.value $F[9]\n";
|
print "$drive.value $F[9]\n";
|
||||||
|
} elsif ($output =~ /^(190 Airflow_Temperature_Cel.*)/m) {
|
||||||
|
my @F = split ' ', $1;
|
||||||
|
print "$drive.value $F[9]\n";
|
||||||
} else {
|
} else {
|
||||||
print "$drive.value U\n";
|
print "$drive.value U\n";
|
||||||
print "$drive.extinfo Temperature not detected in smartctl output\n";
|
print "$drive.extinfo Temperature not detected in smartctl output\n";
|
||||||
|
|
@ -244,4 +247,3 @@ sub command_for_drive_device {
|
||||||
$cmd .= $fulldev;
|
$cmd .= $fulldev;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue