Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

Script fails when running the cli command "clear count" on Cisco devices.

Techie
Posts: 9
2183     0

I'm having trouble when running this script to clear the counters. 
I figured that because the prompt has changed the script doesn't recognize it and times out. 
I tried setting the Trigger-Context-Prompt: to recognize the prompt, but I'm having no luck.   Any ideas?

Script-Filter:
    $Vendor eq "Cisco"

Action:
Clear Counters

Action-Timeout:
30

Action-Commands:

clear count

Output-Triggers:
Clear Count

##################
Trigger:
Clear Count

Trigger-Context-Prompt: .*]

####
# Tried several versions of Trigger-Variables and Trigger-Template
#  ###
Trigger-Variables:
$EZ /\w+/
Trigger-Template:
Clear $EZ

Trigger-Commands:
\r
exit

 

Highlighted

This should do it for you:

Adviser
Posts: 422
2183     0

This should do it for you:

Action-Commands:

clear count \r\r

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Highlighted

Hi Tom,

Adviser
Posts: 53
2183     0

Hi Tom,

Your theory is correct in that the script is timing out due to the change in prompt structure. I am assuming that all you are looking to do here is have the script press "enter" in response to the [confirm] prompt? If so, you can accomplish this by adding a "\r" (i.e. carriage return) to the end of the "clear count" command (i.e. "clear count\r"). No need for any of the Trigger-Context-Prompt stuff.

Thanks,

- Chris

 

Highlighted

Script fails when running the cli command "clear count" on Cisco

Techie
Posts: 9
2183     0

That fixed it!

Thank you Sif and Chris

Showing results for 
Search instead for 
Do you mean 

Recommended for You