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. GetDCI

GetDCI

Scheduled Pinned Locked Moved Support
10 Posts 2 Posters 94.0k 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.
  • N
    N
    Nikk
    wrote on last edited by
    #1

    Hi,

    I was wondering whether i can achieve this or not:

    I have dci's who shows free disk space and dci's who shows total disk space. For one node there are more than one disk.
    What i want is, when alarm ir raised from free disk space threshold, i want to pass the total disk value to event too.
    I can achieve this with script:

    return GetDCIValue($node, FindDCIByName($node, "Filesystem.Total(C:)"));

    but this is for one dci with disk C.
    So is there a way to use this one script or event for more than one disk, or I must create new script and event for each disk?

    Regards,
    Nikk

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

      Hi!

      In the script you have access to DCI's "instance" field (via $event->instance). If you have correct disk name in that field (and it will be populated automatically if DCI in question was created by instance discovery) you can form correct DCI name for FindDCIByName.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • N
        N
        Nikk
        wrote on last edited by
        #3

        Thanks for solution!

        So I tried it, stumpled upon instance discovery filter script. I wanted to get only C and D disks.
        I tried this script:

        if (substr($1,1,1) = "C") || (substr($1,1,1) = "D")
        {
            return true;
        }
        else
        {
            return false;
        }

        Seems like i don't get something, please guide me to right path 🙂

        Nikk

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

          Looks like typo - you use = instead of == for comparison.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • N
            N
            Nikk
            wrote on last edited by
            #5

            Really, thank you for the obvious mistake 🙂

            1 Reply Last reply
            0
            • N
              N
              Nikk
              wrote on last edited by
              #6

              Anyway, i'm still getting the other disks (see 1. screen), maybe the script isn't right.

              Then i tried your script:

              value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
              return (value != null) && (value > 0);

              And get rid only of Disk A:, but no disk E: (see 2. screen).


              1.png

              2.png

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

                Script looks correct. Could it be that disk E: has non-zero total space (could be the case if this is CD drive with disk inserted or any other read-only device)?

                Best regards,
                Victor

                1 Reply Last reply
                0
                • N
                  N
                  Nikk
                  wrote on last edited by
                  #8

                  It could be, but I don't have no direct access to that server to check it. Thank you!

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

                    You can query FileSystem.Total(E:) using nxget to check it.

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0
                    • N
                      N
                      Nikk
                      wrote on last edited by
                      #10

                      Sorry for late answer, been busy.

                      I checked with nxget and it returned non-zero value.

                      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