$head_lines .= <Temperature
System:$sysname
Location:$syslocation
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
System:$sysname
Location:$syslocation
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 .= <Temperature
System:$sysname
Location:$syslocation
TEMP2 ; } elsif ($sens =~ /(\d+):Hum/) { my $sid = $1; my $target_name = $router_name . ".hum." . $sid; $target_lines .= <Humidity
System:$sysname
Location:$syslocation
HUMIDITY2 ; } }; } elsif ($hostoid eq '1.3.6.1.4.1.901.1') { snmpMIB_to_OID("/usr/share/snmp/mibs/it-watchdogs-mib.my"); my $target_name = $router_name . ".temp"; $target_lines .= <Temperature
System:$sysname
Location:$syslocation
TEMP3 ; $target_name = $router_name . ".hum"; $target_lines .= <Humidity
System:$sysname
Location:$syslocation
HUMIDITY3 ; $target_name = $router_name . ".air"; $target_lines .= <Airflow
System:$sysname
Location:$syslocation
AIRFLOW3 ; $target_name = $router_name . ".light"; $target_lines .= <Light
System:$sysname
Location:$syslocation
LIGHT3 ; $target_name = $router_name . ".sound"; $target_lines .= <Sound
System:$sysname
Location:$syslocation
SOUND3 ; # check for a water probe $target_name = $router_name . ".water"; my ($io3val) = snmpget($router_connect,'internalIO3'); if ($io3val > 0) { $target_lines .= <Water
System:$sysname
Location:$syslocation
WATER ; }; } else { print "The OID is $hostoid\n"; }