Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

Network Automation and Compliance (NetMRI)

Reply

NetMRI CCS Script Regex Issue

[ Edited ]
Techie
Posts: 4
1769     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

Superuser
Posts: 115
1770     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

Techie
Posts: 4
1770     0

That does the trick, I appreciate it!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You