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. Calculating with multiple oids

Calculating with multiple oids

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

    Hello

    I would like to monitor router memory usage but in order for that i need to poll 4 seperate values and do some math with them. What would be the cleanest approach to solve this problem?

    Oids:
    .1.3.6.1.2.1.25.2.3.1.3.1 [STRING] = Physical memory
    .1.3.6.1.2.1.25.2.3.1.4.1 [INTEGER] = 1024 (hrStorageAllocationUnits)
    .1.3.6.1.2.1.25.2.3.1.5.1 [INTEGER] = 160908 (hrStorageSize)
    .1.3.6.1.2.1.25.2.3.1.6.1 [INTEGER] = 128164 (hrStorageUsed)

    Demo math:
    125,16*100 / 157,13 = 79,65%

    Desired output:
    Physical memory = 79,65%

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      At some point in the future, when https://track.radensolutions.com/issue/NX-2322 will be implemented it would be possible to specify muliple OIDs and they will appear as variables in transformation script.

      For now - either a script DCI that does all SNMP job and calculation and returns final result, or SNMP DCI that reads one OID and the rest being read in transformation script, e.g.:

      totalMem = $1;
      
      transport = $node->createSNMPTransport();
      if (transport == null) return null;
      
      freeMem = transport->getValue(".1.3.6.1.4.1.14823.2.2.1.1.1.11.1.4.1");
      if (freeMem == null) return null;
      
      return format(100UL * freeMem / totalMem, 1, 0);
      

      The only bonus of the first approach is that you can perform recalculation for historical collected values.

      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