- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Run a command through compliance xml
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-18-2016 09:52 PM - edited 07-18-2016 10:28 PM
Hello,
I was wondering if there is a way to run a command on a device, put it into a variable, then run a compliancy check against the variable. Some things I want to check on a device, such as snmp user, is not displayed in a config and wanted to see if it was possible to check this using compliancy xml.
Thank you,
Jerry
Re: Python - External Script to Run the "Ad Hoc Command Batch" on NetMRI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-19-2016 10:34 AM
Re: Python - External Script to Run the "Ad Hoc Command Batch" on NetMRI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-19-2016 10:35 AM
To be clear, you can't run a command within the policy engine. You would run a separate job that sets the value in the custom field or list, and have a policy rule that checks that.
Re: Python - External Script to Run the "Ad Hoc Command Batch" on NetMRI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-12-2016 12:58 PM
Would you be able to supply an example of an xml rule checking a custom field?
Re: Python - External Script to Run the "Ad Hoc Command Batch" on NetMRI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-19-2016 07:28 AM
Sure. This rule will check whether a device custom field "asset_tag_no" is populated or not.
<PolicyRuleLogic editor="raw-xml" xmlns='http://www.infoblox.com/NetworkAutomation/1.0/ScriptXml'> <If> <Expr op='and'> <Expr op='eq'> <Expr value=''/> <Expr field=’meta.asset_tag_no'/> </Expr> </Expr> <Then> <PolicyRuleFail>Asset tag number is empty.</PolicyRuleFail> </Then> <Else> <PolicyRulePass/> </Else> </If> </PolicyRuleLogic>
John