#! /usr/bin/perl -w use strict; use DBI; use bbvi::iptools; use api::Mtik; use api::printhash; use api::getsnmp; my $ip = $ARGV[0] || '10.105.41.166'; isip($ip) or die; open LOG,">testresult.txt" or die; unless(Mtik::login($ip,'admin','xxxxxxxx')) { die "login failed\n" } my %hash = (); if(my $error = getsnmp(\%hash,1)) { printf LOG qq{%3d: get snmp failed - \"$error\"\n},__LINE__; exit; } printhash(\%hash,"hash returned from getsnmp");