Dash symbol not working with send_command to cisco devices #3176
Replies: 1 comment
-
I wan not under enable() mode. The commands are working now after Connecthandler.enable() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've written a set of show commands to parse output for cisco devices.
sh_bootvar = "sh bootvar | include BOOT variable does not exist|CONFIG_FILE does not exist"
sh_cap_route = "sh capability feature routing | section Disabled"
sh_cpu_report = "sh monitor event-trace cpu-report brief back 110:00"
sh_data_corr = 'show data- ' # checks data inconsistency errors
sh_logging = "show logging | include [A-Z]+-[0-4]"
#shows log severity 3 or above
#we will extract logging level 0-4 in the last 5 days, let the node parse the regex
sh_mem_failure = "sh memory failures alloc | include \S+.*[0-9]"
When i send these individual commands under send_command, everything works including the pipe commands, except for the dash commands that are outside of brackets. For example the router parses [0-9] correctly (under show memory failure), but when I use a dash outside of brackets it returns:
% Invalid input detected at '^' marker.
for example "show data-corr"
I changed my Pycharm environment to UTF-8, ISO, ascii, always the same problem. I tried using keypad alt+0150, alt+0151, and then trying to escape the symbol within the command via \2D, as well as hex escape code. I tried with r"data corr-" and r"data corr-". The router simply doesn't want to parse the dash symbol. Any suggestions?
I was not under enable Mode.
The commands are working now after : ConnectHandler.enable()
Beta Was this translation helpful? Give feedback.
All reactions