Reply

NetMRI CCS Script Regex Issue

[ Edited ]
Member
Posts: 2
178     0

I'm trying to write a NetMRI CCS script to clean up some additional flash directories on our Cisco devices, however, I'm trying to use a regex in the Trigger Variable to get the .bin file *after* the last backslash, in order to just pull the file itself. However, no amount of getting this to work in NetMRI seems to be working. Running the regex in regex101.com works perfectly. Running in NetMRI gives me: 

*** Template does not match ***
 BOOT.*:($bootvar) 

Here's my setup:

 

My Trigger-Variable:

 

$Bootvar /[^\/]*.bin/

 

My Trigger-Template:

 

BOOT.*:[[$Bootvar]]

 

The output I'm trying to parse:

 

BOOT path-list : flash:/c2960x-universalk9-mz.152-4.E10/c2960x-universalk9-mz.152-4.E10.bin

I'm trying to just pull the c2960x-universalk9-mz.152-4.E10.bin part at the very end. I'm starting to think that this will need to be a Python script, not a CCS script, but I'd appreciate anyone who can help me get it to work this way.

 

Re: NetMRI CCS Script Regex Issue

Adviser
Posts: 450
179     0

It works just removed the "Boot.*:"

 

 

My Trigger-Variable:

 

$Bootvar /[^\/]*.bin/

 

My Trigger-Template:

 

[[$Bootvar]]

 

You can also use "http://yournetmri_IP/netmri/ccs/tx/regex_test/RunRegex.tdf" 

For testing RegEx Smiley Happy

regex_boot.png

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

https://sifbaksh.com

Re: NetMRI CCS Script Regex Issue

Member
Posts: 2
179     0

That does the trick, I appreciate it!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You