net-snmp-perl-test.pl
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:1k
- #!/usr/bin/perl
- #
- # Net-SNMP Perl Test
- #
- # Written by Alex Burger
- # alex_b@users.sourceforge.net
- #
- # 3/26/2004
- #
- ##############################################################################
- $| = 1;
- use SNMP;
- $ENV{'MIBS'} = 'ALL';
- &SNMP::initMib();
- $SNMP::best_guess = 2;
- $include_module = 1;
- my $test;
- my $long_names;
- my $include_module;
- print "nnTesting translateObjn";
- print "********************n";
- $test = 'sysDescr';
- $expect = '.1.3.6.1.2.1.1.1';
- $long_names = 0;
- $include_module = 0;
- $translated = &SNMP::translateObj("$test",$long_names,$include_module);
- if ($translated eq $expect)
- {
- print "Test passed. Result: $translatedn";
- }
- else
- {
- print "Test FAILED! Expected: $expectn";
- print " Received: $translatedn";
- }
- print "n";