Changeset 304 for trunk/klask
- Timestamp:
- Oct 11, 2017, 9:39:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r303 r304 362 362 363 363 #--------------------------------------------------------------- 364 # va rechercher le nom des switchs pour savoir qui est qui364 # Get switch name and switch model 365 365 sub init_switch_names { 366 366 my ($verbose, $verb_description, $check_hostname, $check_location) = @_; … … 394 394 $sw->{'description'} = $result->{$OID_NUMBER{'sysName'}} || $sw->{'hostname'}; 395 395 $sw->{model} = get_switch_model($result->{$OID_NUMBER{'sysDescription'}}); 396 printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{'description'}, $sw->{model} if $verbose; 397 396 398 if ($verb_description) { 397 399 my $desc = $result->{$OID_NUMBER{'sysDescription'}}; 398 400 $desc =~ s/[\n\r]/ /g; 399 print " 401 print " +> $sw->{'hostname'} - description: $desc\n" 400 402 } 401 403 if ($check_hostname) { 402 404 my ($hostname) = split /\./, $sw->{'hostname'}, 2; 403 print " $hostname - error internal hostname: $sw->{'hostname'}\n" if $result->{$OID_NUMBER{'sysName'}} ne $hostname;405 print " +> $hostname - error internal hostname: $sw->{'hostname'}\n" if $result->{$OID_NUMBER{'sysName'}} ne $hostname; 404 406 } 405 407 if ($check_location) { 406 408 my $location = $result->{$OID_NUMBER{'sysLocation'}}; 407 409 $location =~ s/^"(.+)"$/$1/; 408 print " $sw->{'hostname'} - error location: '$location' -> '$sw->{'location'}'\n" if $location ne $sw->{'location'}; 409 } 410 #$sw->{'location'} = $result->{"1.3.6.1.2.1.1.6.0"} || $sw->{'hostname'}; 411 #$sw->{contact} = $result->{"1.3.6.1.2.1.1.4.0"} || $sw->{'hostname'}; 410 print " +> $sw->{'hostname'} - error location: '$location' -> '$sw->{'location'}'\n" if $location ne $sw->{'location'}; 411 } 412 412 413 $session->close; 413 414 # Ligne à virer car on récupère maintenant le modèle du switch415 #my ($desc, $type) = split m/ : /xms, $sw->{'description'}, 2;416 printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{'description'}, $sw->{model} if $verbose;417 414 } 418 415
Note: See TracChangeset
for help on using the changeset viewer.