[Nagiosplug-devel] Websensor plugin for http://www.eesensors.com sensors
Ben Clewett
ben at clewett.org.uk
Thu May 12 05:17:31 CEST 2005
Dear nagiosplug-devel and Esensors,
For the environment sensors advertised on the Nagios web site from
http://www.eesensors.com.
There is an error in the plugin: it fails if the plugin reports Celcius
instead of the default Fahrenheit. The plugin also fails to report
performance data.
As this plugin is not part of the standard plugin distribution, I have
included a patch in this email for the nagiosplugin group, and the hope
that Esensors may fix their published plugin.
PS, the Esensors 'Webserver Configuration' 'Read/Verify' and polling
programs also all fail for the same reason.
Hoping of some use...
Regards, Ben.
Patch:
--- check_em01.pl.old Fri Dec 12 20:57:14 2003
+++ check_em01.pl Thu May 12 11:53:39 2005
@@ -64,10 +64,11 @@
$response = $ua->request($request);
if ($response->is_success) {
$resp = $response->content;
- if ($resp =~
/E01.*TF\D*([0123456789.]+)\D*HU\D*([0123456789.]+)\D*IL\D*([0123456789.]+)/g)
{
- $temperature=$1;
- $humidity=$2;
- $illumination=$3;
+ if ($resp =~
/E01.*T([CF])\D*([0123456789.]+)\D*HU\D*([0123456789.]+)\D*IL\D*([0123456789.]+)/g)
{
+ $unit=$1;
+ $temperature=$2;
+ $humidity=$3;
+ $illumination=$4;
}
}
} until (($i >= 3) || (defined($temperature)));
@@ -83,7 +84,8 @@
$humidity = sprintf("%.1f", $humidity); # format
$illumination = sprintf("%.1f", $illumination); # format
$humidity =~ s/[_%]//g;
-$check_result = "temp: $temperature F, humidity: $humidity\%,
illumination: $illumination";
+$check_result = "temp: $temperature $unit, humidity: $humidity\%,
illumination: $illumination";
+$check_result = "$check_result | temp=$temperature$unit
humidity=$humidity\% illimination=$illumination";
$have_critical=0;
More information about the Devel
mailing list