Event SYS_IF_DOWN has default message Interface "%2" changed state to DOWN (IP Addr: %3/%4, IfIndex: %5)
How can i add %6 or %? with interface ifAlias?
Hi,
interface alias is not passed to SYS_IF_DOWN. You can create script in script library called GetInterfaceAlias with the following code:
return GetInterfaceObject($node, $event->parameters[5])->alias;
and then use macro %[GetInterfaceAlias] in message text.
Best regards,
Victor
Yes. Thanks you very much.
Event SYS_THRESHOLD_REACHED don't have parameter index of interface.
Can i store it from Threshold Script and get it in Event?
Can you show me another way to get it?
In version 3.0 you can set interface as related object for DCI and then access it via DCI object.
Best regards,
Victor
I create the script GetInterfaceAlias
if ($dci==null)
return "?";
else
return GetInterfaceObject($node, $dci->instanceData)->alias;
and using macro in message %[GetInterfaceAlias] but this return "?"
my threshold script run correct
ifo = GetInterfaceObject($node, $dci->instanceData);
speed = ifo->speed;
if (speed!=null)
if ($1/speed*100 > $2)
return true;
return false;
I'am using NETXMS 3.0.2287.
Can you tell me my mistake.
Currently $dci is not supported when a script is called from event processing. For SYS_THRESHOLD_EVENTs DCI ID is passed as 5-th parameter of $event:
trace(1, "Script on SYS_THRESHOLD_EVENT: DCI ID: ".$event->parameters[5]+0);
trace(1, "Script on SYS_THRESHOLD_EVENT: DCI name: ".GetDCIObject($node,($event->parameters[5]))->name);
trace(1, "Script on SYS_THRESHOLD_EVENT: Interface name: ".GetDCIObject($node,($event->parameters[5]))->relatedObject->name);