Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. NXSL Script - Get DCI Comments?

NXSL Script - Get DCI Comments?

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 63.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D
    DrCamel
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Yes, comments attribute was missing in DCI class. I've added it, will be available in 2.0-M5.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • D
        D
        DrCamel
        wrote on last edited by
        #3

        Excellent, thanks Victor!

        Is there any work around in the meantime? aside from using custom attributes instead.

        Simon

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          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


          nxsl_classes.cpp

          nms_dcoll.h

          1 Reply Last reply
          0
          • D
            D
            DrCamel
            wrote on last edited by
            #5

            Ok, thanks again Victor.

            1 Reply Last reply
            0

            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups