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. Unsigned Integer DCI and diff()

Unsigned Integer DCI and diff()

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

    I've been monitoring UPS runtime, and as that really should never go into a negative value, I thought I'd use an unsigned integer for the DCI.
    I also used a threshold to alert if the runtime dropped by 20 minutes within 1 minute, kind of as an indicator that the battery is on its way out.

    The result of the above setup is that the threshold gets triggered a lot. Every time the runtime goes down, it triggers.
    For all I can tell this is due to the unsigned integer. If the the difference to the previous value is negative (i.e. from 120 to 116, a difference of -4), it compares the threshold of 20 with 4294967292 (i.e. 2^32 - diff). I don't think the unsigned integer class for the actual value should apply to the result of the diff?
    Or did is this some other odd issue I ran into? Since switching from Unsigned Int to Integer, I'm not getting these alerts anymore.

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

      Hi,

      it's actually a bug, diff definitely should be treated as signed value. I'll register it in our issue tracker.

      Best regards,
      Victor

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

        Fixed in version 2.1-M2.

        Best regards,
        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