Instance Discovery Filter Script adding "{alias}"
-
Hey
if found this solution for automation and filtering of dcis for my switches:
Description: Traffic, IN {instance-name}
Instance Discovery
Snmpwalk OID
Base OID
.1.3.6.1.2.1.31.1.1.1.1
filtering script
snmp = CreateSNMPTransport($node);
/* nur wenn PortSpeed > 0 */
x = SNMPGetValue(snmp, ".1.3.6.1.2.1.2.2.1.5.".$1);
y = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.17.".$1);
if (x>0 && y!=2) return 1;
else return 0;I would like to integrate the alias/port description in the description part
so the ouput would beDescription: Traffic {alias}, IN {instance-name}
how could i do this ?
regards
-
Hi,
you cannot add another placeholder, but you can concatenate anything you need into {instance-name} in filter script. For example, to add prefix "instance" to every instance name return from script as following:
return %(true, $1, "instance: " . $1);
first element is acceptance indicator, second is instance ({instance} will be replaced by it), third is instance name. There should be examples on the forum for filtering scripts used to return meaningful interface names in {instance-name}.
Best regards,
Victor -
-
You can read it from interface object (you can find one using GetInterfaceObject function), or directly from device via SNMP or agent (there are functions for direct SNMP or agent access).
Best regards,
Victor -
@victor said in Instance Discovery Filter Script adding "{alias}":
Hi,
you cannot add another placeholder, but you can concatenate anything you need into {instance-name} in filter script. For example, to add prefix "instance" to every instance name return from script as following:
return %(true, $1, "instance: " . $1);
first element is acceptance indicator, second is instance ({instance} will be replaced by it), third is instance name. There should be examples on the forum for filtering scripts used to return meaningful interface names in {instance-name}.
Best regards,
Victorthank you so much for very helpful post. i will definitely take a note on everything you say because for sure it will resolve my problem as well in filter script adding. thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login