#!/usr/bin/perl -w # vi:ts=4:sw=4 use strict; use Getopt::Long; use SNMP::Simple; our %opt = ( DestHost => 'localhost', Community => 'public', Version => 1, Timeout => 1_000_000, ); our $oid; GetOptions( 'h|host=s' => \$opt{DestHost}, 'c|community=s' => \$opt{Community}, 'v|version=i' => \$opt{Version}, 't|timeout=i' => \$opt{Timeout}, 'o|oid=s' => \$oid, ); our $snmp = SNMP::Simple->new(%opt); print $snmp->get($oid), "\n";