Changeset 309


Ignore:
Timestamp:
Oct 19, 2017, 9:52:24 PM (7 years ago)
Author:
g7moreau
Message:
  • Protect key model and revision
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r308 r309  
    356356      next if not $sw_snmp_description =~ m/$SWITCH_KIND{$sw_kind}->{match}/ms; # option xms break search, why ?
    357357
    358       return $SWITCH_KIND{$sw_kind}->{model};
     358      return $SWITCH_KIND{$sw_kind}->{'model'};
    359359      }
    360360
     
    370370   for my $sw_kind (keys %SWITCH_KIND) {
    371371      next if not $sw_snmp_description =~ m/$SWITCH_KIND{$sw_kind}->{match}/ms; # option xms break search, why ?
    372       last if not exists $SWITCH_KIND{$sw_kind}->{revision};
    373 
    374       my ($revision) = $sw_snmp_description =~ m/$SWITCH_KIND{$sw_kind}->{revision}/xms;
     372      last if not exists $SWITCH_KIND{$sw_kind}->{'revision'};
     373
     374      my ($revision) = $sw_snmp_description =~ m/$SWITCH_KIND{$sw_kind}->{'revision'}/xms;
    375375      return $revision || 'unknow';
    376376      }
     
    411411
    412412      $sw->{'description'} = $result->{$OID_NUMBER{'sysName'}} || $sw->{'hostname'};
    413       $sw->{model} = get_switch_model($result->{$OID_NUMBER{'sysDescription'}});
    414       $sw->{revision} = get_switch_revision($result->{$OID_NUMBER{'sysDescription'}});
    415       printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{'description'}, $sw->{model}.'('.$sw->{revision}.')' if $verbose;
     413      $sw->{'model'} = get_switch_model($result->{$OID_NUMBER{'sysDescription'}});
     414      $sw->{'revision'} = get_switch_revision($result->{$OID_NUMBER{'sysDescription'}});
     415      printf "%-26s 0--------->>>> %-25s %s\n", $sw->{'hostname'}, $sw->{'description'}, $sw->{'model'}.'('.$sw->{'revision'}.')' if $verbose;
    416416
    417417      if ($verb_description) {
     
    890890      $checksum_data .= join ':',
    891891         $switch_db{$sw_name}->{'description'},
    892          $switch_db{$sw_name}->{model},
     892         $switch_db{$sw_name}->{'model'},
    893893         $switch_db{$sw_name}->{'hostname'},
    894894         "\n";
     
    29542954
    29552955            my $swname  = $sw;
    2956                $swname .= q{\n-\n} . "$db_switch_global{$sw}->{model}" if exists $db_switch_global{$sw} and exists $db_switch_global{$sw}->{model};
     2956               $swname .= q{\n-\n} . "$db_switch_global{$sw}->{'model'}" if exists $db_switch_global{$sw} and exists $db_switch_global{$sw}->{'model'};
    29572957            print "\"$sw\" [label=\"$swname\", color=black, fillcolor=palegreen, shape=rect, style=filled];\n";
    29582958            print "\"location$b-$l\" -> \"$sw\" [len=2, color=firebrick, arrowtail=dot];\n";
Note: See TracChangeset for help on using the changeset viewer.