version 1.23, 2007/01/22 02:38:35 |
version 1.25, 2008/03/10 17:21:53 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: check_hw_sensors,v 1.22 2007/01/06 03:16:41 andrew Exp $ |
# $RedRiver: check_hw_sensors,v 1.24 2007/02/14 21:59:10 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_hw_sensors *** A nagios check for OpenBSD hw.sensors |
# check_hw_sensors *** A nagios check for OpenBSD hw.sensors |
# |
# |
|
|
######################################################################## |
######################################################################## |
# TODO: |
# TODO: |
# Really need real documentation. |
# Really need real documentation. |
|
# allow checking of hw.sensors on a remote host with ssh somehow |
######################################################################## |
######################################################################## |
use strict; |
use strict; |
use warnings; |
use warnings; |
|
|
%ENV = (); |
%ENV = (); |
|
|
use constant NAGIOS_OUTPUT => 0; |
use constant NAGIOS_OUTPUT => 1; |
|
|
use POSIX; |
use POSIX; |
use Config; |
use Config; |
|
|
$source = $o[0]; |
$source = $o[0]; |
$descr = $o[1]; |
$descr = $o[1]; |
|
|
if (@s == 4) { # XXX This mebbe needs to end up $OSVer >= 4.1 |
if ($OSVer >= 4.1) { |
$data = $o[0]; |
$data = $o[0]; |
if ($data =~ s/\s+\((.*)\).*$//) { |
if ($data =~ s/\s+\((.*)\).*$//) { |
$descr = $1; |
$descr = $1; |
} |
} |
$status = $o[1]; |
$status = $o[1]; |
($source, $type) = $id =~ /([^\.]+)\.([^\.]+)\d+$/; |
($source, $type) = $id =~ /([^\.]+)\.([^\.]+?)\d+$/; |
} elsif ($OSVer >= 4.0) { |
} elsif ($OSVer >= 4.0) { |
$data = $o[2]; |
$data = $o[2]; |
$status = $o[3]; |
$status = $o[3]; |