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. Send different DCI values from the same node (or not?)

Send different DCI values from the same node (or not?)

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 12.4k 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.
  • S
    S
    Stardust
    wrote on last edited by
    #1

    Hello,

    I'm generating an event when disk space is low -> no problem.

    I generate a Treshold when FileSystemFreePerc < 10%.
    On the message field of Event configuration I write: "Low disk space of %n : %4 %% (limit %3 %%)" and then send it by mail.

    But how can I send the value of another parameter like FileSystem.Total of the same node? (or of another? I see that each parameter have ID).

    Regards

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

      Hi,

      you can use scripts for that. You can insert return value of script from script library using %[script_name] macro, and in a script you can use AgentReadParameter to read data directly from agent or GetDCIValueByName/GetDCIValueByDescription to get value of another DCI.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • S
        S
        Stardust
        wrote on last edited by
        #3

        Thanks for the reply,

        I've done:

        sub Free()
        {
        
           value = AgentReadParameter($node, "FileSystem.Free(" . $1 . ")");
           return (value != null) && (value > 0);
        }
        

        In a script library.

        (I wanted that the script work on the actual "instance" letter Drive, is that possible?)

        Then, in event message "%[NameInTheLibrary]" doesn't work.

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

          Hi,

          there are few errors:

          1. you should place your code within main() function or not use functions at all;
          2. If this is threshold violation event, then instance will be passed as event's parameter #6, and can be accessed as $event->parameters[6]
          3. Expression

          return (value != null) && (value > 0);

          will return 0 (false) or 1 (true) which is probably not what you want.

          Script that will return value of FileSystem.Free for current instance or N/A if it cannot be obtained can looks like following:

          value = AgentReadParameter($node, "FileSystem.Free(" . $event->parameters[6] . ")");
          return (value != null) ? value : "N/A";
          

          Best regards,
          Victor

          1 Reply Last reply
          0
          • S
            S
            Stardust
            wrote on last edited by
            #5

            Thanks !!  ;D

            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