"Wagner" <wagnergc@itautec-philco.com.br> writes:
>
> Thanks Todd,
>
> I still didn't find a solution for this problem...
>
> Maybe a script is the only solution... i'll try it out...
Excellent excuse to think perl thoughts and make the world better.
Here's a banged together example in Perl. Modify to suit:
----------------------------------------------------------------------
#!/usr/bin/perl -w
#aix07[/home/toddh]$ /usr/OV/bin/snmpwalk localhost
#interfaces.ifTable.>
#interfaces.ifTable.ifEntry.ifType.1 : INTEGER: 7
#interfaces.ifTable.ifEntry.ifType.2 : INTEGER: 7
#interfaces.ifTable.ifEntry.ifType.3 : INTEGER: 7
#interfaces.ifTable.ifEntry.ifType.4 : INTEGER: 24
my $instance;
my $oid;
my $type;
my $value;
my $totalmem = 0;
my @output = `/usr/OV/bin/snmpwalk localhost
interfaces.ifTable.ifEntry.ifType`;
print @output;
foreach $instance (@output) {
($oid,$type,$value) = split(/:/, $instance, 3);
chomp $value;
print $value;
$totalmem += $value ;
}
print "\n The total is: $totalmem \n";
# my $somethreshold = 3000;
# if ( $totalmem >= $sometthreshold) {
# exec("/usr/bin/mail blah@foo.com 'The sky is falling');
#}
Best Regards,
--
Todd H.
http://www.toddh.net/
|