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. DCI question

DCI question

Scheduled Pinned Locked Moved Support
7 Posts 2 Posters 16.2k 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.
  • G
    G
    gmonk63
    wrote on last edited by
    #1

    Is it possible to setup a threshold based on multiple DCI values ?  So if I have four DCI's and I want to sum the values provided by all four and only trigger and alarm if the sum of those four DCI values is >= 50   

    Thanks

    1 Reply Last reply
    0
    • T
      T
      tomaskir
      wrote on last edited by
      #2

      Create a script DCI and collect the combined value of the DCIs into the script DCI.

      Then make the threshold on that DCI.

      Sample script attached below.
      Save it to script library and call it from the script DCI.

      val1 = GetDCIValueByDescription($node, "DCI1 description");
      val2 = GetDCIValueByDescription($node, "DCI2 description");
      val3 = GetDCIValueByDescription($node, "DCI3 description");
      val4 = GetDCIValueByDescription($node, "DCI4 description");
      
      if (val1 == null || val2 == null || val3 == null || val4 == null)
        return 0;
      
      return val1 + val2 + val3 + val4;
      
      1 Reply Last reply
      0
      • G
        G
        gmonk63
        wrote on last edited by
        #3

        tomaskir,

        Im almost succesfull at what im trying to achieve but im stuck on figuring out a way to reset values after the polling interval  I have four DCI's that collect and increment the values every minute and using your code created an internal DCI which will sum those values every 15min and i want to trigger an alarm based on the totals of the internal DCI  but how do I reset the values  the DCI's  after every poll interval instead of permanently incrementing

        1 Reply Last reply
        0
        • T
          T
          tomaskir
          wrote on last edited by
          #4

          I dont understand exactly what you are trying to achieve, but maybe look at the delta functionality for the DCI.
          It will automatically calculate the change of the DCI for the time period, and show you the value the DCI changed by.

          1 Reply Last reply
          0
          • G
            G
            gmonk63
            wrote on last edited by
            #5

            Does any one  have any examples of a dci threshold script ? Im trying to trigger a threshold event but only if the threshold is met and secondary dci is true.. example

            if (current dci >= 100 and secondary dci is true)
            {

            trigger event

            }

            else
            {
            keep on going
            }

            * Does the threshold script need to return a boolean  or integer to be evaluated

            1 Reply Last reply
            0
            • T
              T
              tomaskir
              wrote on last edited by
              #6

              I really recommend reading the script hints, they are available since 2.0+.
              Regarding reading another DCI, see this:
              https://wiki.netxms.org/wiki/NXSL:GetDCIValueByDescription
              https://wiki.netxms.org/wiki/NXSL:GetDCIValueByName

              Here is an example... this is a threshold on disk % usage, depending on the size of the disk.
              If disk is smaller then 1GB - 80% threshold.
              1GB-1TB - 90% threshold.
              1TB+ - 95% threshold.

              storageSize = AgentReadParameter($node, "FileSystem.Total(" . $dci->instance . ")");
              if (storageSize == null)
                return false;
              
              if (storageSize < 1099511627776) {
                // for storageSize under 1TB
                if (storageSize < 1073741824) {
                  // for storageSize under 1GB, 80%
                  usageThreshold  = 80;
                } else {
                  // for storageSize between 1GB and 1TB, 90%
                  usageThreshold  = 90;
                }
              } else {
                // for storageSize above 1TB, 95% threshold
                usageThreshold  = 95;
              }
              
              if ($1 > usageThreshold)
                return true;
              
              return false;
              
              1 Reply Last reply
              0
              • G
                G
                gmonk63
                wrote on last edited by
                #7

                Thanks,  Ive read the hints but wasnt sure how it pertained to triggering events weather the script needed to return a boolean or value  but from your script i see it needs to return a boolean in order to generate the event ... Thanks for your help

                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