Value from dci table to event template?
-
Is there any possibility to get a value to event template other than the instance one.
It returns the row but you cannot use this in the event template like %column:ColumName or %row:ColumName?? -
In all places where macros are supported you can use %[script_name] macro. Script with specified name should be in script library. In that script you can access table value (it will be object of class table - https://www.netxms.org/documentation/nxsl-latest/#class-table) and get value of specific cell from it.
When developing your script, you can run it via Execute Script on the node where you have your table DCI. However, there's a difference - when script is ran automatically on threshold violation, variables $event, $dci will be set - you can use these to get parameters of event or id of the DCI. When running via Execute Script, these variables will not be set, so you need to modify your script slightly.
Here's a brief example:
//t = GetDCIValue($node, $dci.id); // for use in script called on threshold violation t = GetDCIValue($node, 13741); // for testing - use via Execute Script on node //row = $event.getParameter(4); // for use in script called on threshold violation row = t.findRowIndexByInstance("/sys"); // for testing return t.get(row, 1);You can give some more information, what exactly cell of your table you want to extract, then I can give some more examples.
-
I might have been overthinking this issue.
I think its enough to have this in the event template:
Nginx certificate will expire in 14 days for: %<instance> on server %n
%<instance> is the certificate name in my case
and %n is the node or object name in netxms.Thank you so much for the input though.
-
In many cases it's better to use regular DCIs and instance discovery to automatically creation and removal of them.
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