- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
NetMRI CCS Script Regex Issue
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2021 01:10 PM - edited 01-25-2021 01:42 PM
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.
Solved! Go to Solution.
Re: NetMRI CCS Script Regex Issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 08:24 AM
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
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: NetMRI CCS Script Regex Issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 10:50 AM
That does the trick, I appreciate it!