Reply

Sending SYSLOG to the correct NetMRI Collector

Adviser
Posts: 424
5280     0

How do I send SYSLOG messages in an OC Setup?

How do I know which collector to send SYSLOG messages to?

Solution:

This will help you send SYSLOG messages to correct NetMRI Collector

We have a "well known" variable call "$netmri_ipaddress" that is the Collector that discovered the device.

Use this CCS Script:

Script-Filter:

    $vendor eq “Cisco” and $sysdescr like /IOS/

######################

Action:

    Add SYSLOG to Routers and Switches

Action-Commands:

    config t

    logging $netmri_ipaddress 

    end

    wr mem

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

Cool!

DSchmidt
Techie
Posts: 8
5280     0

$netmri_ipaddress could be used in a lot of places. You could write a script to include logging or update ACLs and instead of having to hard code the IP address of NetMRI, just use $netmri_ipaddress. You can share the script with colleagues on different networks, and they don't even have to upate the script for their environment (ok maybe a few tweaks, but won't have to chance the IP of NetMRI).

Definitely a great "hidden" variable to keep in mind when writing scripts.

This is great!

Authority
Posts: 41
5280     0

Great info Sif!  I can see so many use of this variable.  Do you know if we can use this variable in device group definition?

Ditto on Nick Chia's Comment

DSalmon
Techie
Posts: 1
5280     0

Can this variable be used for device group membership criteria?

Just tested it and you can

Adviser
Posts: 424
5280     0

Just tested it and you can not create a group gents.

You can ask your Account Team to file and RFE

Sif

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

I wanted to verify this

Authority
Posts: 53
5280     0

I wanted to verify this setting from within a policy. We've got multiple collectors so this setting isn't that easy to verify. After a lot of trying, this is what worked for me:

<PolicyRuleLogic editor="raw-xml" expression='1' xmlns='http://www.infoblox.com/NetworkAutomation/1.0/ScriptXml'>
  <ConfigFileCheck label='1' note='' op='contains-all'>
    <Expr op='concat'>
      <Expr value='logging '/>
      <Expr field='data_source.DataSourcePrivateIPDotted'/>
    </Expr>
  </ConfigFileCheck>
</PolicyRuleLogic>

Nice!

Adviser
Posts: 357
5280     0

Nice!

I think I've spotted a bug

Authority
Posts: 53
5280     0

I think I've spotted a bug here.

Looks like <Expr field='data_source.DataSourcePrivateIPDotted'/> resolves to nothing once the policy is deployed making all my devices match the policy if they contain "logging " in the config. When I test the policy from the OC GUI, it works just fine.

Well, that's not good. I will

Adviser
Posts: 357
5280     0

Well, that's not good. I will have QA take a look.

loving life

tromero
Techie
Posts: 1
5280     0
Its cool
Highlighted

Re: Ditto on Nick Chia's Comment

Adviser
Posts: 424
5280     0

You can now do it with version 7.x

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Showing results for 
Search instead for 
Do you mean 

Recommended for You