try show lldp remote-device all
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Apr 2022 10:07:21 +0000 (12:07 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Apr 2022 10:07:21 +0000 (12:07 +0200)
dell-switch.pl

index 6ca957b..33f1d1d 100755 (executable)
@@ -116,6 +116,18 @@ while() {
                }
        } elsif ( $buff =~ m/% Unrecognized command/ ) {
                exit 1;
+       } elsif ( $buff =~ m/% Invalid input detected at .* marker/ ) {
+
+               # try to rewrite command differences
+
+               if ( $command =~ m/show lldp neighbors/ ) {
+                       unshift @commands_while, 'show lldp remote-device all';
+                       undef $command; # don't save this command
+                       $buff = '';
+               }
+
+               warn "# commands_while = ",dump( \@commands_while );
+
        } elsif ( $buff =~ s{More: <space>,  Quit: q.*One line: <return>\s*}{} ) {
                send_pty " ";
        } elsif ( $buff =~ s{\Q--More-- or (q)uit\E}{} ) {