in reply to Multiple conditions matching when pulling OID value with Net::SNMP

You needed to change "=" to "==".
Oh yeah and get that "my" out of your "if" statement. That's legal, but not what you want.
You also need to "use warnings" and "use strict", please. Trust us, you'll love it.
if ( $status == $on_commercial ) { print "The ups is normal\n"; } if ( $status == $on_battery ) { print "The ups is on battery\n"; }

andyford
or non-Perl: Andy Ford

  • Comment on Re: Multiple conditions matching when pulling OID value with Net::SNMP
  • Download Code