How to call a script from "instance-name" ?
-
Hello everyone, do you know how can I call a script from a dci description?
for example, this is the description of a dci: TrafficIN %{script:getIfNameByName({instance-name})}
this is my script:
scriptName:getIfNameByName
sub getIfName(netString)
{
if (length(netString) > 0)
array a;
a [length(netString)];
a = SplitString(netString, " ");
return (a [
(a->size)-1
]
);
}
return getIfName($1);
how can I call that script and send "instance-name" as parameter? -
-
Yes your point is valid but I know that is possible, if I change the script and return any value, It appears on dci description.
I would like to know how to do it. -
Sounds like {instance-name} is not being interpreted prior to calling the script.
Maybe add some trace commands to your script, e.g. something like this:trace(0,"Instance Name: ".$1);Then check your server logs and see what is being returned: Nothing? Literally "{instance-name}"? Something else?
-
Hi,
{instance-name} is a placeholder which is replaced only during instance discovery. You can set it's value by returning third element from instance filter script, like this:
return %(true, "this will became instance", "this will became instance name");
Best regards,
Victor
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