UseInterfaceAliases
-
-
Hi,
you can do that using scripts - interface object has attribute "alias". To get interface object you can use function GetInterfaceObject if you know interface index or walk through all node interfaces using GetNodeInterfaces function and iterate through it's results.
Best regards,
Victor -
Hi,
I have tested the following script but I don't know if it's the best way to obtain the alias attribute:
sub main() { aliasNAME = "no info"; if ($event->parameters[1] != null) { id = $event->parameters[1]; interfaces = GetNodeInterfaces($node); foreach(i : interfaces) { if (i->id == id) { aliasNAME = i->alias; } } } return aliasNAME; } -
That looks good.
As bonus info, you don't have to declare the main() function.
See this: https://wiki.netxms.org/wiki/UM:NetXMS_Scripting_Language_(NXSL)#Script_entry_point -
For processing SYS_IF_DOWN/SYS_IF_UP events script could be easier, because you have interface index as fifth parameter:
iface = GetInterfaceObject($node, $event->parameters[5]); return (iface != null) ? iface->alias : "no info";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