#/bin/perl # samplescript.pl to test snmp functions use Net::SNMP; use strict; use warnings; use vars qw($sess $err $response); ($sess, $err) = Net::SNMP->session( -hostname => shift || 'localhost', -community => shift || 'public', -port => shift || 178 ); if (!defined($sess)) { printf("ERROR: %s\n", $err); exit 1; }