NXSL Script - Get DCI Comments?
-
Is there a way to retrieve the "Comments" property of a DCIObject?
Essentially I'd like to add some support information to the comments section of a DCI, that is also then included in emails that are generated for alerts against that DCI.
As a test I tried the following:-
sub main() { node = FindObject("SomeNode"); dciID = FindDCIByName(node, "SomeDCIName"); dciObj = GetDCIObject(node, dciID); println(dciObj->name); println(dciObj->comments); }However it errors on the comments attribute line, and certainly the https://wiki.netxms.org/wiki/NXSL:DCI page does not list a "comments" attribute (but there is one on the node object https://wiki.netxms.org/wiki/NXSL:Node)
I've had a look through the script reference pages, but I can't see any functions to enable me to query it - does anyone know of a way to do so?
Otherwise I guess I would need to use a custom attribute.
Simon
-
Yes, comments attribute was missing in DCI class. I've added it, will be available in 2.0-M5.
Best regards,
Victor -
-
If you build server from sources, you can try replace files src/server/include/nms_dcoll.h and src/server/core/nxsl_classes.cpp with attached and recompile the server. Other than that, there are no workarounds.
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