[mrtg] Re: Environmental monitor suggestions?

Daniel J McDonald dan.mcdonald at austinenergy.com
Fri Jun 10 13:48:51 MEST 2005


On Fri, 2005-06-10 at 07:17 -0400, PAUL WILLIAMSON wrote:
> > >>> "Wixted, Joe" <JWixted at osv.com> 06/10/05 7:07 AM >>>
> > Hello!
> >  
> > I'm looking to add environmental monitoring (Temp, RH, water 
> > sensor) to my MRTG config.  Thought I'd ask the list for 
> > recommendations on equipment to do that.  I've been looking at 
> > the APC AP9319 
> >http://www.apc.com/products/family/index.cfm?id=47.  Any 
> > other suggestions?  I may be interested in buying one if someone 
> > has a working unit they'd like to part with...
> 
> We are using Uptime devices. 

We've got a lot of those, too.  But now we are rolling out Weathergoose
from ITwatchdogs.  The uptimedevices probes tend to get stuck and report
a constant temperature, or just die for no apparent reason.  And we got
a case of them that just didn't work for beans.  So, when we find a dead
uptime, we replace it with a weathergoose.

I have about 80 locations with monitors, mainly to spot dead air
conditioners in the tin shacks we have dotted around the city.


My mrtg template for either sort:

[mcdonalddj at ldap cfg]$ cat probe.template
$head_lines .= <<ECHO
#.....................................................................
ECHO
;

my ($target_name, $tid, $hid);
my ($hostoid) = snmpget($router_connect,'sysObjectID');
if ($hostoid eq "1.3.6.1.4.1.3854.1.2.2.1.1") {
        snmpMIB_to_OID("/usr/share/snmp/mibs/sa.mib");
        my (@temp) =
snmpwalk($router_connect,'hhmsSensorArrayTempOnline');
        foreach my $tempi (@temp) {
                if ($tempi =~ /(\d):1/) {
                        $tid = $1;
                        $target_name=$router_name.".temp.".$tid;
$target_lines .= <<TEMP
Target[$target_name]:
hhmsSensorArrayTempDegree.$tid&hhmsSensorArrayTempDegree.$tid:
$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: temp
bb*yellow[$target_name]: 83
bb*red[$target_name]: 88
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 185
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe temperature gauge
YLegend[$target_name]: degrees F
ShortLegend[$target_name]: F
PageTop[$target_name]: <H1>Temperature</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
TEMP
;
                }
        }
        my (@hum) =
snmpwalk($router_connect,'hhmsSensorArrayHumidityOnline');
        foreach my $humi (@hum) {
                if ($humi =~ /(\d):1/) {
                        $hid = $1;
                        $target_name=$router_name.".hum.".$hid;
$target_lines .= <<HUMIDITY
Target[$target_name]:
hhmsSensorArrayHumidityPercent.$hid&hhmsSensorArrayHumidityPercent.$hid:
$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: humidity
bb*yellow[$target_name]: 17:80
bb*red[$target_name]: 12:85
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe humidity gauge
YLegend[$target_name]: relative humidity
ShortLegend[$target_name]: %
PageTop[$target_name]: <H1>Humidity</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
HUMIDITY
;
                }
        }
}
elsif ($hostoid eq '1.3.6.1.4.1.13045.1.1') {
        snmpMIB_to_OID("/usr/share/snmp/mibs/sh2.mib");
        my (@sensors) = snmpwalk($router_connect,'SH2SensorType');
        foreach my $sens (@sensors) {
                if ($sens =~ /(\d+):Temp/) {
                        my $sid = $1;
                        my $target_name = $router_name . ".temp." .
$sid;
$target_lines .= <<TEMP2
Target[$target_name]:
SH2SensorCurrentValue.$sid&SH2SensorCurrentValue.$sid:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: temp
bb*yellow[$target_name]: 83
bb*red[$target_name]: 88
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 185
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe temperature gauge
YLegend[$target_name]: degrees F
ShortLegend[$target_name]: F
PageTop[$target_name]: <H1>Temperature</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
TEMP2
;
                }
                elsif ($sens =~ /(\d+):Hum/) {
                        my $sid = $1;
                        my $target_name = $router_name . ".hum." . $sid;
$target_lines .= <<HUMIDITY2
Target[$target_name]:
SH2SensorCurrentValue.$sid&SH2SensorCurrentValue.$sid:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: humidity
bb*yellow[$target_name]: 17:80
bb*red[$target_name]: 12:85
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe humidity gauge
YLegend[$target_name]: relative humidity
ShortLegend[$target_name]: %
PageTop[$target_name]: <H1>Humidity</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
HUMIDITY2
;
                }
        };
}
elsif ($hostoid eq '1.3.6.1.4.1.901.1') {

my $target_name = $router_name . ".temp";
$target_lines .= <<TEMP3
Target[$target_name]: internalTempC.1&internalTempC.1:$router_connect *
9 / 5 + 32
bb*host[$target_name]: $router_name
bb*svc[$target_name]: temp
bb*yellow[$target_name]: 83
bb*red[$target_name]: 88
routers.cgi*InSummary[$target_name]: yes
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 185
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe temperature gauge
YLegend[$target_name]: degrees F
ShortLegend[$target_name]: F
PageTop[$target_name]: <H1>Temperature</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
TEMP3
;
$target_name = $router_name . ".hum";
$target_lines .= <<HUMIDITY3
Target[$target_name]: internalHumidity&internalHumidity:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: humidity
bb*yellow[$target_name]: 17:80
bb*red[$target_name]: 12:85
routers.cgi*InSummary[$target_name]: yes
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe humidity gauge
YLegend[$target_name]: relative humidity
ShortLegend[$target_name]: %
PageTop[$target_name]: <H1>Humidity</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
HUMIDITY3
;
$target_name = $router_name . ".air";
$target_lines .= <<AIRFLOW3
Target[$target_name]: internalAirflow&internalAirflow:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: airflow
bb*yellow[$target_name]: 1:99
bb*red[$target_name]: 0:100
routers.cgi*InSummary[$target_name]: yes
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe airflow gauge
PageTop[$target_name]: <H1>Airflow</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
AIRFLOW3
;
$target_name = $router_name . ".light";
$target_lines .= <<LIGHT3
Target[$target_name]: internalLight&internalLight:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: light
bb*yellow[$target_name]: 1:99
bb*red[$target_name]: 0:100
routers.cgi*InSummary[$target_name]: yes
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe Light gauge
PageTop[$target_name]: <H1>Light</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
LIGHT3
;
$target_name = $router_name . ".sound";
$target_lines .= <<SOUND3
Target[$target_name]: internalSound&internalSound:$router_connect
bb*host[$target_name]: $router_name
bb*svc[$target_name]: sound
bb*yellow[$target_name]: 1:99
bb*red[$target_name]: 0:100
routers.cgi*InSummary[$target_name]: yes
routers.cgi*Options[$target_name]: nototal
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 100
RouterUptime[$target_name]: $router_connect
Options[$target_name]: Gauge noi
Title[$target_name]: Probe sound gauge
PageTop[$target_name]: <H1>Sound</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
SOUND3
;
}
else { print "The OID is $hostoid\n"; }


-- 
Daniel J McDonald, CCIE # 2495, CNX
Austin Energy

dan.mcdonald at austinenergy.com

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list