netenglabs / suzieq

Using network observability to operate and design healthier networks
https://www.stardustsystems.net/
Apache License 2.0
780 stars 104 forks source link

Node: change how we look for prompt with IOS devices #871

Closed ddutt closed 1 year ago

ddutt commented 1 year ago

We were using a regexp to detect the prompt of IOS after a command output had completed. This was causing to misparse many entries. IOS (and XE) devices have a fixed prompt: [hostname]> or [hostname]#. For example, leaf01> or leaf01#.

This patch fixes the prompt to be an exact match based on these possibilities. Furthermore, in certain cases, when we attempt to enable privilege escalation, we were no handling the case where the enable command itself failed. We now handle that as well.

Proposed Release Note Entry

Use string tuples and an understanding of IOS(XE) prompts to detect the end of command output.