bloxHub

www.infoblox.com/community
8 posts / 0 new
Trigger issue

Hi all:I am trying to write a trigger that will grab the interface name (Gi0/##) only when the 1st number (VLAN) is 28:Trigger-Variables: $VLANinterfacestringTrigger-Template: 28 .* DYNAMIC [[$VLANinterface]]Device output:48 001f.5b33.26b8 DYNAMIC Gi0/4428 000a.5e2d.518b DYNAMIC Gi0/528 000d.602e.e807 DYNAMIC Gi0/660 000d.93ae.ad38 DYNAMIC Gi0/47140 0013.215e.de94 DYNAMIC Gi0/14128 0013.215e.de94 DYNAMIC Gi0/15With that above template it will grab Gi0/5, Gi0/6 and Gi0/15; I really only want Gi0/5 and Gi0/6.I have tried: >> \s28 .* DYNAMIC [[$VLANinterface]]

+1
0
-1
Tags
Automation Change Manager,cisco,script,trigger template,regular expression
Re: Trigger issue

With \s, it works correctly for me in a Trigger Test.  NetMRI version is 2.4.2.34.

- Marty

+1
0
-1
Re: Trigger issue

How did I know that it was going to be fixed in the newest version... I guess it will have to wait until I can upgrade our system.
Thanks.

+1
0
-1
Re: Trigger issue

Can replace the "\s" with a "\r".  A $variable /^28/ should also work.

+1
0
-1
Re: Trigger issue

We have found that any regular expressions in a trigger must be inside a trigger variable otherwise they are considered normal characters to be matched exactly.  Your post has had all line feeds removed so I am not sure of the data we are matching but the following should be close to what you need.

Trigger-Variables:
$MacAddress           /[\w.]+/
$VLANinterface        string


Trigger-Template:
     28 [[$MacAddress]] DYNAMIC [[$VLANinterface]]

+1
0
-1
Re: Trigger issue

 Lets see if this time the 'pasting' will work...

Trigger-Variables: $VLANinterfacestring
Trigger-Template: 28 .* DYNAMIC [[$VLANinterface]]
Device output:
48 001f.5b33.26b8 DYNAMIC Gi0/44
28 000a.5e2d.518b DYNAMIC Gi0/5
28 000d.602e.e807 DYNAMIC Gi0/6
60 000d.93ae.ad38 DYNAMIC Gi0/47
140 0013.215e.de94 DYNAMIC Gi0/14
128 0013.215e.de94 DYNAMIC Gi0/15

In  the end all I am trying to get is Gi0/## for any line thatstarts only with 28, not 128, 280,etc... Hopefully the upgrade to 2.4 will fix it.

+1
0
-1
Re: Trigger issue

Ok this should work on the version you are running. I'll explain $VlanMac
\b says there should be a word boundry ie. no letters or numbers before
\s says it needs to be immediatly followed by a space
[\w.]+ matches the mac address as any number of word chr's or a period.

 

Trigger-Variables:
    $VLANinterface      string
    $VlanMac                /\b28\s[\w.]+/

Trigger-Template:
    [[$VlanMac]] DYNAMIC [[$VLANinterface]]

 

 

 In later versions the VlanMac isn't needed and you can use

Trigger-Template:
    \b28 [\w.]+ DYNAMIC [[$VLANinterface]]

Try that first and see if it works on your version.

Hope this helps

 

Bob @ Eqalis  www.eqalis.com

+1
0
-1
Re: Trigger issue

 I see what you are doing there, and it makes sense now. Thanks!

+1
0
-1