diff --git a/AcliPm/CommandProcessing.pm b/AcliPm/CommandProcessing.pm index 03bbb02..5ba87bc 100644 --- a/AcliPm/CommandProcessing.pm +++ b/AcliPm/CommandProcessing.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::CommandProcessing; -our $Version = "1.09"; +our $Version = "1.10"; use strict; use warnings; @@ -345,8 +345,8 @@ sub processCommonCommand { # Process a control/embedded command which exists on foreach my $cnd (@{$alias->{$name}{SEL}}) { cmdOutput($db, " IF " . $cnd->{CND} . "\n THEN:\n") unless $cnd->{CND} eq 1; cmdOutput($db, " ELSE:\n") if $cnd->{CND} eq 1; - (my $cmd = $cnd->{CMD}) =~ s/\s*;\s*/;/g; - cmdOutput($db, " " . join("\n ", split(";", $cmd)) . "\n\n"); + (my $cmd = quoteCurlyMask($cnd->{CMD}, ';')) =~ s/\s*;\s*/;/g; + cmdOutput($db, " " . join("\n ", map(quoteCurlyUnmask($_, ';'), split(";", $cmd))) . "\n\n"); } } if ($namepat && !$matchFlag) { @@ -4311,6 +4311,8 @@ sub processEmbeddedCommand { # Process an embedded command available as if on co cmdOutput($db, "show running ||ssid [] grep on WLAN SSIDs\n"); cmdOutput($db, "show running ||ovsdb grep on ovsdb config context\n"); cmdOutput($db, "show running ||app grep on application config context\n"); + cmdOutput($db, "show running ||dhcp-server [] grep on dhcp-server config context\n"); + cmdOutput($db, "show running ||dhcp-srv|dhcpsrv|dhcps [] same as above for dhcp-server grep\n"); cmdOutput($db, "show log [-i] unwrap logfile on: ERS stackables, ISW\n"); $command = ''; }; diff --git a/AcliPm/ConnectDisconnect.pm b/AcliPm/ConnectDisconnect.pm index 6944053..d7b44a5 100644 --- a/AcliPm/ConnectDisconnect.pm +++ b/AcliPm/ConnectDisconnect.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::ConnectDisconnect; -our $Version = "1.03"; +our $Version = "1.04"; use strict; use warnings; @@ -166,6 +166,7 @@ sub connectToHost { # Connect to host saveInputBuffer($term_io); # Will clear InputBuffQueue if set $host_io->{LoopbackConnect} = undef; $host_io->{SessionUpTime} = time + $host_io->{SessionTimeout}*60; # Reset session inactivity timer + $host_io->{KeepAliveUpTime} = time + $host_io->{KeepAliveTimer}*60; # Reset keepalive timer $mode->{connect_stage} = 0; if ($host_io->{ComPort} !~ /^(?:TELNET|SSH)$/) { diff --git a/AcliPm/GlobalDefaults.pm b/AcliPm/GlobalDefaults.pm index 6ce29a8..113d982 100644 --- a/AcliPm/GlobalDefaults.pm +++ b/AcliPm/GlobalDefaults.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::GlobalDefaults; -our $Version = "1.08"; +our $Version = "1.09"; use strict; use warnings; @@ -42,7 +42,8 @@ our $UnrecognizedLogins = 1; # How many unrecognized logins to let user intera our $VarRangeUnboundMax = 299; # When capturing > $var %n- ; max range of columns to capture our $MaxSedPatterns = 20; # We want to limit this (this default can be overridden in acli.sed file) our $CompleteLineMarker = "\x00"; # Marker we use for complete lines on which we have to cache the last \n -our $HighlightMarker = "\x00\x00"; # Marker where for highlight text, while applying sed output patterns +our $HighlightMarkerBeg = "\x01"; # Beginning marker for highlight text, while applying sed output patterns +our $HighlightMarkerEnd = "\x02"; # Ending marker for highlight text, while applying sed output patterns our $PseudoDefaultSelection = 'voss'; # Pseudo default selection in %PseudoSelectionAttributes hash our $DotActivityUnbufferThreshold = 3; # Number of consecutive only dots received from host which will make us switch to unbuffered mode diff --git a/AcliPm/GlobalMatchingPatterns.pm b/AcliPm/GlobalMatchingPatterns.pm index d20b12b..ed96b68 100644 --- a/AcliPm/GlobalMatchingPatterns.pm +++ b/AcliPm/GlobalMatchingPatterns.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::GlobalMatchingPatterns; -our $Version = "1.11"; +our $Version = "1.12"; use strict; use warnings; @@ -150,7 +150,7 @@ our %Grep = ( '^(?:locale)', # level2 ], PassportERS => [ - '^ *(?:interface |router \w+(?:\s+r\w+)?\s*$|router vrf|route-map (?:\"[\w\d\s\.\+<>-]+\"|[\w\d\.-]+) \d+\s*$|application|i-sid \d+|wireless|logical-intf isis \d+|mgmt [\dcvo]|ovsdb\s*$)', # level0 + '^ *(?:interface |router \w+(?:\s+r\w+)?\s*$|router vrf|route-map (?:\"[\w\d\s\.\+<>-]+\"|[\w\d\.-]+) \d+\s*$|application|i-sid \d+|wireless|logical-intf isis \d+|mgmt [\dcvo]|ovsdb\s*$|(?:ip )?dhcp-server subnet)', # level0 '^ *(?:route-map (?:\"[\w\d\s\.\+<>-]+\"|[\w\d\.-]+) \d+\s*$)', # level1 ], Series200 => [ @@ -174,8 +174,9 @@ our %Grep = ( Mgmt => '^(?:mgmt [\dcvo]|interface mgmtEthernet|router vrf MgmtRouter)', Ovsdb => '^ovsdb\s*$', Application => '^application$', + DhcpSrv => '^(?:ip )?dhcp-server ', }, - CreateContext => '^(?:route-map |ip igmp profile |i-sid \d+|logical-intf isis \d+|ipv6 dhcp guard policy |ipv6 nd raguard policy |mgmt [\dcvo])', + CreateContext => '^(?:route-map |ip igmp profile |i-sid \d+|logical-intf isis \d+|ipv6 dhcp guard policy |ipv6 nd raguard policy |mgmt [\dcvo]|dhcp-server subnet)', ExitInstance => '^ *(?:exit|back|end)\b', DeltaPattern => { # These patterns can capture and add to the current grep search patterns PassportERS => { @@ -288,6 +289,7 @@ our %Grep = ( '^logical-intf isis \d+ vid (?:\d+[,\-])+\d+ primary-vid \d+ (?:port \d+/\d+(?:/\d+)?|mlt \d+)(?: name "?[\w\d\._ -]+"?)?\s*\n\n?exit\s*\n', '^mgmt (?:\d )?(?:.+)?\n\n?exit\s*\n', '^ovsdb\s*\n\n?exit\s*\n', + '^(?:ip )?dhcp-server subnet [\d\.\/]+\s*\n\n?exit\s*\n', ], Series200 => [ '^line \w+\s*\n\n?exit\s*\n', diff --git a/AcliPm/HandleBufferedOutput.pm b/AcliPm/HandleBufferedOutput.pm index b0afd39..68b6acb 100644 --- a/AcliPm/HandleBufferedOutput.pm +++ b/AcliPm/HandleBufferedOutput.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::HandleBufferedOutput; -our $Version = "1.09"; +our $Version = "1.10"; use strict; use warnings; @@ -1292,17 +1292,17 @@ sub handleBufferedOutput { # Handles how ACLI releases to screen buffered output my @hlGrep; if ($term_io->{HLgrep}) { # Highlight is snipped before sedPatternReplace my $hlCount = 0; - my $hlMarker = $HighlightMarker . chr($hlCount); - while ($bohLine =~ s/$term_io->{HLgrep}/$hlMarker/) { + my $hlMarker = $HighlightMarkerBeg . $hlCount . $HighlightMarkerEnd; + while ($bohLine =~ s/$term_io->{HLgrep}/$hlMarker/ && length($&)) { # Check length of replacement, to avoid going into infinite loop with 'x?' pats push(@hlGrep, $&); - $hlMarker = $HighlightMarker . chr(++$hlCount); + $hlMarker = $HighlightMarkerBeg . ++$hlCount . $HighlightMarkerEnd; } } # This is where we apply sed output colour patterns sedPatternReplace($host_io, $term_io->{SedColourPats}, \$bohLine) if %{$term_io->{SedColourPats}}; if (@hlGrep) { # and after sedPatternReplace highlight replacement is made for my $i (0 .. $#hlGrep) { - my $hlMarker = $HighlightMarker . chr($i); + my $hlMarker = $HighlightMarkerBeg . $i . $HighlightMarkerEnd; $bohLine =~ s/$hlMarker/$term_io->{HLon}$hlGrep[$i]$term_io->{HLoff}/ } } diff --git a/AcliPm/HandleDeviceOutput.pm b/AcliPm/HandleDeviceOutput.pm index a16e6af..7f48f9c 100644 --- a/AcliPm/HandleDeviceOutput.pm +++ b/AcliPm/HandleDeviceOutput.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::HandleDeviceOutput; -our $Version = "1.11"; +our $Version = "1.12"; use strict; use warnings; @@ -1183,11 +1183,15 @@ sub handleDeviceOutput { # Handles reception of output from connectyed device elsif ($mode->{dev_del} eq 'bs' || $mode->{dev_del} eq 'bt' || $mode->{dev_del} eq 'bx') { # Remove space+backspace sequences; used by device to delete a line of output quit(1, "ERROR: backspace count not set in 'bs' dev_del mode", $db) unless $host_io->{BackspaceCount}; my $keepOutput; - if ($host_io->{Type} eq 'Ipanema' && $mode->{dev_del} eq 'bt' && $$outRef =~ s/^\cG\x0d\e\[\d+C([^\x00\x0d\n\cH\e]*)$/$1/) { - # Ipanema: eth get back bell + "-diag"; same for other ? commands - print "\cG" unless length $1; - $host_io->{BackspaceCount} = 3 - length $1; # The length will always need to be 3: \e\[19C\e\[K\x00\x00\x00 - debugMsg(2,"PreAdjustingTabExpansion-ipanema:>", $outRef, "<\n"); + if ($host_io->{Type} eq 'Ipanema' && $mode->{dev_del} eq 'bt') { + if ($$outRef =~ s/^\cG?\x0d\e\[\d+C([^\x00\x0d\n\cH\e]+)/$1/) { + # Ipanema: eth get back bell + "-diag"; same for other ? commands + print "\cG" unless length $1; + debugMsg(2,"PreAdjustingTabExpansion-ipanema:>", $outRef, "<\n"); + } + if ($$outRef =~ s/^[^\x00\x0d\n\cH\e]*([^\x00\x0d\n\cH\e])\K\x0d\g{1}//) { + debugMsg(2,"PreAdjustingTabExpansion2-ipanema:>", $outRef, "<\n"); + } } else { print "\cG" if $$outRef =~ s/^\cG//; # Pass it on; PPCLI show sn @@ -1262,6 +1266,9 @@ sub handleDeviceOutput { # Handles reception of output from connectyed device } debugMsg(2,"BackSpaceMode-OutputToCheckForBackspaces:\n>", $outRef, "<\n"); } + if ($host_io->{Type} eq 'Ipanema' && $mode->{dev_del} eq 'bt' && $$outRef =~ s/^\e\[A[^\x00\x0d\n\cH\e]+\e\[K\n//) { + debugMsg(2,"AvoidSafetyEscape-ipanema:>", $outRef, "<\n"); + } debugMsg(2,"BackspaceExpectedCount = $host_io->{BackspaceCount}\n"); my $bcntminus1 = $host_io->{BackspaceCount} - 1; if ( ( @@ -1319,9 +1326,11 @@ sub handleDeviceOutput { # Handles reception of output from connectyed device ) || ( $host_io->{Type} eq 'Ipanema' && ( + $$outRef =~ s/^\x0d\e\[K\e\[A$prompt->{Match}// || $$outRef =~ s/^\e\[$host_io->{BackspaceCount}D(?:\e\[K)?// || - $$outRef =~ s/^\x0d\e\[19C\e\[K\x00{$host_io->{BackspaceCount}}// || - $$outRef =~ s/^\cH{$host_io->{BackspaceCount}}\e\[K// + $$outRef =~ s/^\x0d\e\[\d+C\e\[K\x00{3,}// || + $$outRef =~ s/^\cH{$host_io->{BackspaceCount}}\e\[K// || + $$outRef =~ s/^\x0d$prompt->{Match}\e\[K// ) ) ) { @@ -1563,6 +1572,9 @@ sub handleDeviceOutput { # Handles reception of output from connectyed device elsif ($host_io->{Type} eq 'Wing' && $$outRef =~ s/^\e\[K//) { # Output might get preceded with \e[K if tab expansion was used in previous command debugMsg(2,"Wing-tab-reformatting:\n>", $outRef, "<\n"); } + elsif ($host_io->{Type} eq 'Ipanema' && $$outRef =~ s/^[^\x00\x0d\n\cH\e]*([^\x00\x0d\n\cH\e])\K\x0d\g{1}//) { + debugMsg(2,"Ipanema-tab-reformatting:\n>", $outRef, "<\n"); + } my $tabSynMode = $TabSynMode{$host_io->{Type}}[$term_io->{AcliType}]&3; debugMsg(2,"TabSynMode = ", \$tabSynMode, "\n"); if ($tabSynMode == 3) { # Ensure we have a prompt in the output + tail match (ERS & VSP) @@ -1601,7 +1613,7 @@ sub handleDeviceOutput { # Handles reception of output from connectyed device debugMsg(2,"ConvertingTab-to-Syntax with output:\n>", $outRef, "<\n"); redo; # Fall through to 'sx' processing below } - if ($$outRef =~ s/\e.*$//) { + if ($host_io->{Type} eq 'ExtremeXOS' && $$outRef =~ s/\e.*$//) { # On XOS, long commands, we see a \eE appended : configure lldp ports all advertise vendor-specific med policy application voice vlan Default E debugMsg(2,"outRef after removing esc-E appended:\n>", $outRef, "<\n"); } diff --git a/AcliPm/InputProcessing.pm b/AcliPm/InputProcessing.pm index b92ce74..59f0f92 100644 --- a/AcliPm/InputProcessing.pm +++ b/AcliPm/InputProcessing.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::InputProcessing; -our $Version = "1.09"; +our $Version = "1.10"; use strict; use warnings; @@ -525,6 +525,9 @@ sub prepGrepStructure { # Process grep string and setup grep structure according push(@{$grep->{Instance}}, 'Vrf'); push(@{$grep->{RangeList}}, undef); debugMsg(1,"-> Grep-Instance : set to Vrf\n"); + # Allow Perl's metacharacters {}[]()^$.|*+?\ and backslash the rest + $grepString =~ s/([\/])/\\$1/g; + debugMsg(1,"-> Grep-String-after-backslashing : >", \$grepString, "<\n"); $grepString =~ s/^vrf\s+/vrf /i; if ($grepString =~ s/^vrf ((?:[^,]+,)+[^,]+)$/vrf (?:$1)(?:\\s|\$)/i) { $grepString =~ s/,/|/g; @@ -533,9 +536,6 @@ sub prepGrepStructure { # Process grep string and setup grep structure according $grepString =~ s/^vrf (.*)/vrf $1(?:\\s|\$)/i; } debugMsg(1,"-> Grep-String-Formatted : >", \$grepString, "<\n"); - # Allow Perl's metacharacters {}[]()^$.|*+?\ and backslash the rest - $grepString =~ s/([\/])/\\$1/g; - debugMsg(1,"-> Grep-String-after-backslashing : >", \$grepString, "<\n"); } elsif ($grepAdv && !$grepQuotes && $grepString =~ /^route-map(?:\s+((?:\S+,)*\S+))?$/i) { # Route-map push(@{$grep->{Instance}}, 'RouteMap'); @@ -551,7 +551,7 @@ sub prepGrepStructure { # Process grep string and setup grep structure according $grepString =~ s/^route-map .*$/route-map \.*?$matchString/i; } debugMsg(1,"-> Grep-String-Formatted : >", \$grepString, "<\n"); - # Allow Perl's metacharacters {}[]()^$.|*+?\ and backslash the rest + # Allow Perl's metacharacters {}[]()^$.|*+?\ and backslash the rest - at the end so also applies to $matchString $grepString =~ s/([\/])/\\$1/g; debugMsg(1,"-> Grep-String-after-backslashing : >", \$grepString, "<\n"); } @@ -658,6 +658,25 @@ sub prepGrepStructure { # Process grep string and setup grep structure according } debugMsg(1,"-> Grep-String-Formatted : >", \$grepString, "<\n"); } + elsif ($grepAdv && !$grepQuotes && $grepString =~ /^(?:dhcp-serv(?:er?)?|dhcp-?s(?:[er][rv]?)?)(?:\s+((?:\S+,)*\S+))?$/i) { # DHCP Server + push(@{$grep->{Instance}}, 'DhcpSrv'); + push(@{$grep->{RangeList}}, undef); + debugMsg(1,"-> Grep-Instance : set to DhcpSrv\n"); + my $matchString = defined $1 ? quoteCurlyUnmask($1, ' ') : ''; + $matchString =~ s/[\'\"]//g; # Remove all and any quotes + $grepString =~ s/^(?:dhcp-serv(?:er?)?|dhcp-?s(?:[er][rv]?)?)/dhcp-server/i; + $grepString =~ s/^dhcp-server\s+/dhcp-server /i; + if ($grepString =~ s/^dhcp-server (?:[^,]+,)+[^,]+$/dhcp-server \.*?(?:$matchString)/i) { + $grepString =~ s/,/|/g; + } + else { + $grepString =~ s/^dhcp-server .*$/dhcp-server \.*?$matchString/i; + } + debugMsg(1,"-> Grep-String-Formatted : >", \$grepString, "<\n"); + # Allow Perl's metacharacters {}[]()^$.|*+?\ and backslash the rest - at the end so also applies to $matchString + $grepString =~ s/([\/])/\\$1/g; + debugMsg(1,"-> Grep-String-after-backslashing : >", \$grepString, "<\n"); + } elsif ($grepAdv && !$grepQuotes && $host_io->{Type} eq 'WLAN9100' && $grepString =~ /^ssid(?:\s+(\S+))?$/i) { # SSID list or range push(@{$grep->{Instance}}, 'Ssid'); push(@{$grep->{RangeList}}, undef); diff --git a/AcliPm/Logging.pm b/AcliPm/Logging.pm index 969179f..a4ed452 100644 --- a/AcliPm/Logging.pm +++ b/AcliPm/Logging.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::Logging; -our $Version = "1.02"; +our $Version = "1.03"; use strict; use warnings; @@ -17,7 +17,7 @@ use AcliPm::GlobalDefaults; sub closeLogFile { # Handles closing log file my $script_io = shift; - printf { $script_io->{LogFH} } "\n=~=~=~=~=~=~=~=~=~=~= %s log %s =~=~=~=~=~=~=~=~=~=~=\n", $ScriptName, scalar localtime; + printf { $script_io->{LogFH} } "\n=~=~=~=~=~=~=~=~=~=~= %s CLOSE log %s =~=~=~=~=~=~=~=~=~=~=\n", $ScriptName, scalar localtime; close $script_io->{LogFH}; $script_io->{LogFile} = $script_io->{LogFH} = undef; } @@ -78,7 +78,7 @@ sub openLogFile { # Handles opening log file } } if ( open($script_io->{LogFH}, $script_io->{OverWrite}, $logfile) ) { - printf { $script_io->{LogFH} } "\n=~=~=~=~=~=~=~=~=~=~= %s log %s =~=~=~=~=~=~=~=~=~=~=\n", $ScriptName, scalar localtime; + printf { $script_io->{LogFH} } "\n=~=~=~=~=~=~=~=~=~=~= %s OPEN log %s =~=~=~=~=~=~=~=~=~=~=\n", $ScriptName, scalar localtime; $script_io->{AutoLogFail} = 0 if $script_io->{AutoLog}; return 1; # File opened successfully } diff --git a/AcliPm/ParseCommand.pm b/AcliPm/ParseCommand.pm index dbc4a09..ca2218f 100644 --- a/AcliPm/ParseCommand.pm +++ b/AcliPm/ParseCommand.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::ParseCommand; -our $Version = "1.09"; +our $Version = "1.10"; use strict; use warnings; @@ -14,6 +14,7 @@ use AcliPm::CommandStructures; use AcliPm::DebugMessage; use AcliPm::GlobalConstants; use AcliPm::GlobalMatchingPatterns; +use AcliPm::MaskUnmaskChars; use AcliPm::TabExpand; @@ -566,7 +567,11 @@ sub mergeCommand { # Updates the parsed command hash with a new command update # - apply forloop order: cmdParse, updateParsed(except if semicln list) my @updatedParsed; - my @updatedCmdList = length $updatedCmd ? split(/[^\\]\K;\s*/, $updatedCmd) : (''); # Split the command into sections, if semicolon fragmented + my @updatedCmdList = (''); + if (length $updatedCmd) { + $updatedCmd = quoteCurlyMask($updatedCmd, ';'); # Mask semi-colons inside quotes/brackets/etc.. + @updatedCmdList = map(quoteCurlyUnmask($_, ';'), split(/[^\\]\K;\s*/, $updatedCmd)); # Split the command into sections, if semicolon fragmented + } my $colonMarkersExist = scalar @updatedCmdList && scalar grep {/:$/} @updatedCmdList; debugMsg(4,"=mergeCommand: colonMarkersExist\n") if $colonMarkersExist; my %turnIntoAppend; diff --git a/AcliPm/Version.pm b/AcliPm/Version.pm index 8b23891..c69ab1b 100644 --- a/AcliPm/Version.pm +++ b/AcliPm/Version.pm @@ -1,6 +1,6 @@ # ACLI sub-module package AcliPm::Version; -our $VERSION = "6.01"; # This version is the ACLI release version +our $VERSION = "6.02"; # This version is the ACLI release version use strict; use warnings; diff --git a/Changes b/Changes index c9e1481..2084d67 100644 --- a/Changes +++ b/Changes @@ -1248,3 +1248,20 @@ Revision history for acli.pl * Control ACLI> interface was not able to set debug level > 999 * More paging output with error patters was producing unexpected lines between --more-- prompts * Script xmcacli (v1.17) updated with missing XMC family "200 Series" for Series200 support +6.02 2023-10-09 + * Uses Control::CLI version 2.11 and Control::CLI::Extreme version 1.10 + * More fixes around CLI tab expanson support for SD-WAN Ipanema family type + * Doing a highlight string (cmd ^ string) where there were more than 40 matches of that string in the output would + crash ACLI + * Doing a highlight string (cmd ^ string) with a string ending with '?' would hang ACLI + * Added new VOSS9.0 "ip dhcp-server" context for grep of show running config + * When reconnecting to a VOSS switch, which was factory defaulted and prompts to set the username password, the + keepalive function was kicking in and preventing user from actually providing the new password. As a workaround one + had to force a reconnect and then it was possible to provide the new password and login. Now the keepalive timer + is reset on every new connection, as should have always been the case. + * When logging to file, time stamp lines now indicate if logging file was closed or opened + * List variable assignment $var[] = (val1; val2) was not handled correctly if used in alias file + * Using serial port on Silicon Labs CP210x USB cable (for universal hardware USB port) was failing with error: + invalid COMMPROP block length= 66 at C:/Strawberry/perl/site/lib/Control/CLI.pm line 296 + * Update script updated to be able to use HTTPS to fetch updates and now only fetches updates from github.com + * VOSS .tgz/.voss image files are highlighted now in ls output of switch file system diff --git a/acli.alias b/acli.alias index 710423e..b40d592 100644 --- a/acli.alias +++ b/acli.alias @@ -1,6 +1,6 @@ # acli.pl alias file # -$Version = 1.61_001 +$Version = 1.62 # # This file should be placed either in the same directory as acli.pl or else in your home directory (ENV paths HOME & USERPROFILE are checked) # If the file is present in multiple paths the order of preference is the following: @@ -192,7 +192,7 @@ log [$unitOrName] {family_type} eq 'WLAN9100' = show log {is_xos} = show log chronological {is_isw} = do show logging -i - {is_sdwan} = shell; cat /var/log/commd.log + {is_sdwan} = shell; cat /var/log/commd.log: logt [$unitOrName] ~:"Show log file in reverse order; most recent events first" ?:"Alias syntax:\n logt [|]\n" @@ -388,7 +388,7 @@ ztp ipsec $rt ~:"Show IPsec status of WAN Router tunnels of SD-WAN appliance" !{is_sdwan} = &noalias - 1 = enable $rt; ipsec status + 1 = enable $rt; ipsec status: fabric ~:"Show fabric config and status of SD-WAN appliance" !{is_sdwan} = &noalias @@ -400,7 +400,7 @@ dws probe $siteMgmtIP $wan ~:"Tcpdump probing to selected remote site on selected WAN of SD-WAN appliance" !{is_sdwan} = &noalias - 1 = enable; tcpdump -i $wan host $siteMgmtIP and port 19999 ^"19999:" + 1 = enable; tcpdump -i $wan host $siteMgmtIP and port 19999 ^"19999:": apps [$search] ~:"Display App name and Id on SD-WAN appliance" !{is_sdwan} = &noalias @@ -980,7 +980,10 @@ spb nick ~:"Show all SPB nodes in fabric" = show isis spbm nick-name nicksrv ~:"Show nick-name server config & leases" = @echo off; @print; show spbm|nick; show spbm nick-name server leases; @echo on -isj ~:"Show SPB ISIS adjacencies" = show isis adjacencies +isj + ~:"Show SPB ISIS adjacencies" + {is_sdwan} = debug fabric show config + 1 = show isis adjacencies isi ~:"Show SPB ISIS interfaces" = show isis interface isa ~:"Show SPB ISIS interface authentication" = show isis int-auth isl1 ~:"Show SPB ISIS interface L1 counters" = show isis int-l1-cntl-pkts @@ -1217,43 +1220,42 @@ bgn [$vrf] {family_type} eq 'PassportERS' = show ip bgp summary [vrf $vrf]|STATE,^\d,---,- [\dI]!metric {is_xos} = show bgp neighbor !\(\w\),\s:\s,Stati {is_slx} = do show ip bgp summary -# {is_sdwan} = enable $vrf -# ; @echo off output off -# ; @my $bg_* -# ; $bg_cltList[] = ("/etc/bird.d/run/bird.ctl"; "/run/bird/bird.rt2.ctl") -# ; @error disable -# ; @for $bg_idx &$bg_cltList[] -# ; ls $bg_cltList[$bg_idx] > $bg_ctl %1 -# ; @if $bg_ctl -# ; @echo off output on -# ; birdcl -s $bg_cltList[$bg_idx] show protocols -# ; @last -# ; @endif -# ; @endfor -# ; @error enable -# ; @echo on - {is_sdwan} = enable $vrf; birdcl -s /run/bird/bird.rt2.ctl show protocols + {is_sdwan} = enable $vrf + ; @echo off output off + ; @my $bg_* + ; $bg_cltList[] = ("/etc/bird.d/run/bird.ctl"; "/run/bird/bird.$vrf.ctl") + ; @error disable + ; @for $bg_idx &$bg_cltList[] + ; ls $bg_cltList[$bg_idx] > $bg_ctl %1 + ; @if $bg_ctl eq $bg_cltList[$bg_idx] + ; @echo off output on + ; birdcl -s $bg_cltList[$bg_idx] show protocols: + ; @last + ; @endif + ; @endfor + ; netstat -tnap + ; @error enable + ; @echo on bgr [$vrf] ~:"Show BGP routes for a given VRF or GRT" {family_type} eq 'PassportERS' && $vrf =~ /^\d+$/ = show ip bgp route [vrfids $vrf] {family_type} eq 'PassportERS' = show ip bgp route [vrf $vrf] {is_xos} = show bgp route all!: \d,Stati -# {is_sdwan} = enable $vrf -# ; @my $bg_* -# ; $bg_cltList[] = ("/etc/bird.d/run/bird.ctl"; "/run/bird/bird.rt2.ctl") -# ; @error disable -# ; @for $bg_idx &$bg_cltList[] -# ; ls $bg_cltList[$bg_idx] > $bg_ctl %1 -# ; @if $bg_ctl -# ; @echo off output on -# ; birdcl -s $bg_cltList[$bg_idx] show route all -# ; @last -# ; @endif -# ; @endfor -# ; @error enable -# ; @echo on - {is_sdwan} = enable $vrf; birdcl -s /run/bird/bird.rt2.ctl show route all + {is_sdwan} = enable $vrf + ; @my $bg_* + ; $bg_cltList[] = ("/etc/bird.d/run/bird.ctl"; "/run/bird/bird.$vrf.ctl") + ; @error disable + ; @for $bg_idx &$bg_cltList[] + ; ls $bg_cltList[$bg_idx] > $bg_ctl %1 + ; @if $bg_ctl eq $bg_cltList[$bg_idx] + ; @echo off output on + ; birdcl -s $bg_cltList[$bg_idx] show route all: + ; @last + ; @endif + ; @endfor + ; @error enable + ; @echo on ipff [$slots] ~:"Show IPFIX flows" @@ -1283,7 +1285,7 @@ bfdn [$vrf] {is_voss} && $vrf =~ /^\d+$/ = show ip bfd neighbors [vrfids $vrf]! {is_voss} = show ip bfd neighbors [vrf $vrf]! {is_xos} = show bfd session - {is_sdwan} = enable $vrf; birdcl -s /run/bird/bird.rt2.ctl show bfd sessions + {is_sdwan} = enable $vrf; birdcl -s /run/bird/bird.rt2.ctl show bfd sessions: bfds [$vrf] ~:"Show BFD statistics / counters" {is_voss} && $vrf =~ /^\d+$/ = show ip bfd stats [vrfids $vrf]! diff --git a/acli.sed b/acli.sed index 5e19fb7..89ed709 100644 --- a/acli.sed +++ b/acli.sed @@ -1,7 +1,7 @@ ############################## # SED file for ACLI Terminal # ############################## -# Version = 1.10 +# Version = 1.11 # # This file is read when a new ACLI Terminal is launched and can be used to define SED (serial editor) patterns # It can be located in any of these directories in the following order: @@ -88,10 +88,11 @@ category global category PassportERS 'smlt \Ksmlt' colour green 'smlt \Knorm' colour red +'\d{8,} \w{3} +\d+ [\d:]+ \K\S+?\.(?:tgz|voss)' colour red # Highlight VOSS image files category BaystackERS,ISW -'(?i)active(?= (?:client|proxy|radius))' colour green -'(?i)reject(?= (?:client|proxy|radius))' colour red +'(?i)active(?= (?:client|proxy|radius|ring))' colour green +'(?i)reject(?= (?:client|proxy|radius|ring))' colour red category ExtremeXOS '(?:Client|Proxy|Radius|(?:Static|Dynamic) +\d+) +\KActive' colour green diff --git a/docs/aclidoc.chm b/docs/aclidoc.chm index 747046d..6ed4078 100644 Binary files a/docs/aclidoc.chm and b/docs/aclidoc.chm differ diff --git a/docs/aclidoc.pdf b/docs/aclidoc.pdf index 8f93713..c3cfd34 100644 Binary files a/docs/aclidoc.pdf and b/docs/aclidoc.pdf differ diff --git a/docs/html/grep.htm b/docs/html/grep.htm index 9b81006..a67d122 100644 --- a/docs/html/grep.htm +++ b/docs/html/grep.htm @@ -543,8 +543,15 @@

Advanced Grep

show running ||i-sid [<isid-list>] grep on i-sid config contexts show running ||acl [<acl-id-list>] grep on filter acl ids show running ||logical-intf [<intf-list>] grep on ISIS logical interfaces + show running ||lintf|lisis|isl [<intf-list>] same as above for logical-intf grep show running ||mgmt [<port-list or id-list>] grep on Mgmt interfaces show running ||ssid [<ssid-name-list>] grep on WLAN SSIDs + show running ||ovsdb grep on ovsdb config context + show running ||app grep on application config context + show running ||dhcp-server [<subnet-list>] grep on dhcp-server config context + show running ||dhcp-srv|dhcpsrv|dhcps [<snet-list>] same as above for dhcp-server grep + +

Some examples follow.

Grep on MLTs:

diff --git a/linux/README_Linux.txt b/linux/README_Linux.txt index 486bcc7..263263f 100644 --- a/linux/README_Linux.txt +++ b/linux/README_Linux.txt @@ -1,4 +1,4 @@ -$Version = 1.00 +$Version = 6.00 Install instructions ==================== @@ -57,14 +57,14 @@ Open a new tab (with Terminal or iTerm2): acli.pl command line options: ---------------------------- ~$ acli -h -acli.pl version 4.00 +acli.pl version 6.00 Usage: acli.pl [-cehijkmnopqswxyz] - acli.pl [-ceijklmnopqrstwxyz] [] [] - acli.pl [-ceijmnopqrswx] serial:[[@]] [] - acli.pl [-ceijmnopqrswxyz] trmsrv:[ | #] [] - acli.pl [-eimoqsw] pseudo[1-99]:[] [] + acli.pl [-ceijklmnopqrstwxyz] [:@] [] [] + acli.pl [-ceijmnopqrswx] [:@]serial:[[@]] [] + acli.pl [-ceijmnopqrswxyz] [:@]trmsrv:[ | #] [] + acli.pl [-eimoqsw] pseudo:[] [] acli.pl -r <"relay cmd" | IP> [] acli.pl [-f] -g [] [<2nd file>] [...] @@ -74,10 +74,11 @@ Usage: <"relay-cmd"/IP> : To execute on relay in form: "telnet|ssh [-l ]>] <[user[:]@]IP>" If single IP/Hostname provided then "telnet IP/Hostname" will be executed : Optional output capture file of CLI session + : Loads up pseudo mode profile name (or legacy number 1-99) -c : For newline use CR+LF (default) or just CR -e escape_char : CTRL+ for escape sequence; default is "^]" -f : Used with -g to force the Control::CLI::Extreme family_type - -g : Perform ACLI grep on offline config file or from STDIN (pipe) + -g : Perform ACLI grep on offline config file or from STDIN (pipe) -h : Help and usage (this output) -i : Path to use when logging to file -j : Automatically start logging to file ( used as filename) @@ -89,7 +90,7 @@ Usage: -p : Use factory default credentials to login automatically -q quit_char : CTRL+ for quit sequence; default is "^Q" -r : Connect via Relay; append telnet/ssh command to use on Relay to reach host - -s : List of socket names for terminal to listen on + -s : List of socket names for terminal to listen on (0 to disable sockets) -t : When tcp-port specified, flag to say we are connecting to a terminal server -w : Run on provided working directory -x : If connection lost, exit instead of offering to reconnect diff --git a/macos/README_macos.txt b/macos/README_macos.txt index bb10a67..f4b82d7 100644 --- a/macos/README_macos.txt +++ b/macos/README_macos.txt @@ -1,4 +1,4 @@ -$Version = 1.00 +$Version = 6.00 Install instructions ==================== @@ -91,14 +91,14 @@ Restart the Terminal app. acli.pl command line options: ---------------------------- iMac:~ $ acli -h -acli.pl version 4.00 +acli.pl version 6.00 Usage: acli.pl [-cehijkmnopqswxyz] - acli.pl [-ceijklmnopqrstwxyz] [] [] - acli.pl [-ceijmnopqrswx] serial:[[@]] [] - acli.pl [-ceijmnopqrswxyz] trmsrv:[ | #] [] - acli.pl [-eimoqsw] pseudo[1-99]:[] [] + acli.pl [-ceijklmnopqrstwxyz] [:@] [] [] + acli.pl [-ceijmnopqrswx] [:@]serial:[[@]] [] + acli.pl [-ceijmnopqrswxyz] [:@]trmsrv:[ | #] [] + acli.pl [-eimoqsw] pseudo:[] [] acli.pl -r <"relay cmd" | IP> [] acli.pl [-f] -g [] [<2nd file>] [...] @@ -108,10 +108,11 @@ Usage: <"relay-cmd"/IP> : To execute on relay in form: "telnet|ssh [-l ]>] <[user[:]@]IP>" If single IP/Hostname provided then "telnet IP/Hostname" will be executed : Optional output capture file of CLI session + : Loads up pseudo mode profile name (or legacy number 1-99) -c : For newline use CR+LF (default) or just CR -e escape_char : CTRL+ for escape sequence; default is "^]" -f : Used with -g to force the Control::CLI::Extreme family_type - -g : Perform ACLI grep on offline config file or from STDIN (pipe) + -g : Perform ACLI grep on offline config file or from STDIN (pipe) -h : Help and usage (this output) -i : Path to use when logging to file -j : Automatically start logging to file ( used as filename) @@ -123,7 +124,7 @@ Usage: -p : Use factory default credentials to login automatically -q quit_char : CTRL+ for quit sequence; default is "^Q" -r : Connect via Relay; append telnet/ssh command to use on Relay to reach host - -s : List of socket names for terminal to listen on + -s : List of socket names for terminal to listen on (0 to disable sockets) -t : When tcp-port specified, flag to say we are connecting to a terminal server -w : Run on provided working directory -x : If connection lost, exit instead of offering to reconnect diff --git a/macos/aclidoc_macos b/macos/aclidoc_macos index bbe60b5..46c5eed 100644 --- a/macos/aclidoc_macos +++ b/macos/aclidoc_macos @@ -1,2 +1,2 @@ -$Version = 6.00 +$Version = 6.02 AcliDoc.zip diff --git a/windows/aclidoc b/windows/aclidoc index c6140df..f7e09ac 100644 --- a/windows/aclidoc +++ b/windows/aclidoc @@ -1,2 +1,2 @@ -$Version = 6.00 +$Version = 6.02 aclidoc.chm