Changeset 14
- Timestamp:
- Jan 31, 2008, 11:57:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r13 r14 164 164 my $verbose = shift; 165 165 166 print "Switch description\n" if $verbose; 167 print "------------------\n" if $verbose; 166 printf "%-25s %-25s %s\n",'Switch','Description','Type'; 167 # print "Switch description\n" if $verbose; 168 print "-------------------------------------------------------------------------\n" if $verbose; 168 169 169 170 INIT_EACH_SWITCH: 170 171 for my $sw (@SWITCH) { 171 #print "$sw->{hostname} \n";172 172 my %session = ( -hostname => $sw->{hostname} ); 173 173 $session{-version} = $sw->{version} || 1; … … 175 175 if (exists $sw->{version} and $sw->{version} eq 3) { 176 176 $session{-username} = $sw->{username} || 'snmpadmin'; 177 #print "$sw->{hostname} -- $session{-username} \n";178 #for (keys %session) {179 #print "++ $_ -> $session{$_}\n";180 #}181 177 } 182 178 else { … … 187 183 188 184 my ($session, $error) = Net::SNMP->session( %{$sw->{local_session}} ); 189 # -hostname => $sw->{hostname}, 190 # -version => $sw->{version} || 1, 191 # -community => $sw->{community} || $DEFAULT{community} || 'public', 192 # -username => $sw->{username} || 'snmpadmin', 193 # -port => $sw->{snmpport} || $DEFAULT{snmpport} || 161, 194 # ); 195 # if (exists $sw->{version} and $sw->{version} eq 3) { 196 print "$error \n" if $error; 197 #} 185 print "$error \n" if $error; 186 198 187 my $result = $session->get_request( 199 188 -varbindlist => ['1.3.6.1.2.1.1.5.0']
Note: See TracChangeset
for help on using the changeset viewer.