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. Threshold with if clause?

Threshold with if clause?

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 17.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.
  • S
    S
    stoffmann
    wrote on last edited by
    #1

    Hi,
    I have the following problem. I need to monitor a folder for changes. I do this by using a File.Size DCI and comparing the size of the folder with the previous read size. The DCI runs every hour. If the size is the same, it's a sign that our process has a problem.
    My problem now is, that the folder can be empty for long time and this is totally ok. How can I tell a threshold not to fire an alarm if the value is zero?

    Regards

    Stefan

    1 Reply Last reply
    0
    • L
      L
      lweidig
      wrote on last edited by
      #2

      Assuming the GetDCIValue contains the last value until the collection is complete (need to verify this) then a simple Threshold script like the following should work:

      // Empty is OK no matter what
      if ($1 == 0) return false;
      
      // Non-empty OK only if different
      if ($1 != GetDCIValue($node, $dci->id)) return false;
      
      // Not OK, trigger threshold
      return true;
      
      1 Reply Last reply
      0
      • S
        S
        stoffmann
        wrote on last edited by
        #3

        Thank You.

        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