Script to Check IP Address Attributes

From Observer GigaFlow Support | VIAVI Solutions Inc.
Revision as of 14:50, 17 July 2018 by Kevin Wilkie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Checking whether an ip address has attributes in a category

var utils = Java.type('ros.CROSUtils');
var address="172.21.21.21"
if (actions.allIPs.containsKey(utils.inet_atob(address))){
var ip = actions.allIPs.get(utils.inet_atob(address))
log.warn(ip);
 var atrribs = ip.getAttributes("Function")
 if (atrribs.length()>0){
 log.warn("Already have attribute:"+atrribs);
 }else{
 log.warn("No attributes");
 }
}