Welcome to Netcordia Connection Sign in | Join | Help
in Search

Trigger issue

Last post 09-26-2008 2:49 PM by lbdwag. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-25-2008 3:18 PM

    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: $VLANinterface string 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 With 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]] <
  • 09-25-2008 4:07 PM In reply to

    Re: Trigger issue

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

    - Marty

  • 09-25-2008 4:13 PM In reply to

    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.

  • 09-25-2008 4:14 PM In reply to

    Re: Trigger issue

    Can replace the "\s" with a "\r".  A $variable /^28/ should also work.
    Mike Griffin
    Netcordia TAC
    support@netcordia.com
  • 09-25-2008 5:58 PM In reply to

    • Eqalis
    • Top 25 Contributor
    • Joined on 01-04-2008
    • UK

    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]]

    EQALIS
    info(at)eqalis.com
    www.eqalis.com
  • 09-26-2008 8:21 AM In reply to

    Re: Trigger issue

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

    Trigger-Variables: $VLANinterface string
    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.

  • 09-26-2008 11:57 AM In reply to

    • Eqalis
    • Top 25 Contributor
    • Joined on 01-04-2008
    • UK

    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

    EQALIS
    info(at)eqalis.com
    www.eqalis.com
  • 09-26-2008 2:49 PM In reply to

    Re: Trigger issue

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

Page 1 of 1 (8 items)