Le show vlan ne fonctionne pas sur certains switch Cisco (Rancid)


Voici ma fonction shVlan du fichier bin/rancid

sub ShowVLAN {
print STDERR «     In ShowVLAN: $_ » if ($debug);

#($_=<INPUT>,return(1)) if (!$DO_SHOW_VLAN);

while (<INPUT>) {
tr/15//d;
last if (/^$prompt/);
next if (/^(s*|s*$cmds*)$/);
return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(1) if /Ambiguous command/i;
# newer releases (~12.1(9)) place the vlan config in the normal
# configuration (write term).
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
if (/^(<;-+ More -+>;)/) {
my($len) = length($1);
s/^$1s{$len}//;
}
ProcessHistory(« COMMENTS », »keysort », »IO », »!VLAN: $_ »);
}
ProcessHistory(« COMMENTS », »keysort », »IO », »!n »);
return(0);

}

Cette fonction m’a permis de résoudre mon problème.

Autres articles intéressants :

  1. Procédure –> Création de Vlan et configuration (CISCO)
  2. Trouver le port d’un switch ou est brancher un element reseau
  3. Installer rancid sur RHEL
Leave a Comment