#!/usr/bin/perl
use SNMP_util ;
($host,$index) = @ARGV ;
@timeout = snmpwalk("public\@$host","1.3.6.1.4.1.9.9.42.1.3.2.1.2.$index") ;
@thresh = snmpwalk("public\@$host","1.3.6.1.4.1.9.9.42.1.3.1.1.6.$index") ;
$, = "\n" ;
#print "timeout  = " , @timeout, "\n" ;
#print "thresh  = " , @thresh, "\n" ;
$last = 0 ;
foreach $in (@timeout) {
	($if,$val) = split (/:/,$in) ;
	($index) = ($if =~ /^(\d+)\./) ;
	#print "index = $index\n" ;
	$err = $val if $index > $last ;		# prefer the newer
	$last = $index ;
}

$last = 0 ;
foreach $in (@thresh) {
	($if,$val) = split (/:/,$in) ;
	($index) = ($if =~ /^(\d+)\./) ;
	#print "index = $index\n" ;
	$thresh = $val if $index > $last ;		# prefer the newer
	$last = $index ;
}

$err *= 6000 ;
$thresh *= 6000 ;
print "$thresh\n$err\n" ;

	

