How to display duration between trap events?
-
Hi,
I would like to ask that is there any solution to calculate the elapsed time between a traps pair?
A little more detailed, the problem what I need to solve is the following:
I get a trap about the starting of a signal drop.
From this I generate an event for example with the following text: "Started from 11:00:12 10/02/2020 the RF signal out of tolerance."
When the signal loss ceases (typically max. few minutes), the end-of alarm trap arrives as well. From this I also generate an event that works properly and clears the existing alarm as well.
What I can't solve for the moment is to display the duration of the signal loss (e.g. in seconds) in the end of event text.
Is there any solution to this?
Thank you very much for any suggestions in advance. -
Hi,
you can set custom attribute on a node to current time from first event, and for the second event use script macro to read custom attribute value and return the difference with current time. For example:
- Create script in script library called SetSignalLossTime:
$node->setCustomAttribute(".signalLossTime", time());- Create script in script library called GetSignalLossDuration:
t = $node->getCustomAttribute(".signalLossTime"); return (t != null) ? time() - t : 0;-
Create server action of type script that will execute script SetSignalLossTime.
-
Add action from #3 to EPP rule where you generate alarm for signal loss.
-
In the message template for recovery event add %[GetSignalLossDuration] to insert duration of signal loss.
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