07-18-2016 09:52 PM - edited 07-18-2016 10:28 PM
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.
07-19-2016 10:34 AM
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.
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>