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. RAM percentage?

RAM percentage?

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

    Hi

    I'm trying to calculate the percentage of free ram using the NetXMS agent.

    The system has 520093696 bytes of ram.
    So I did this:

    1)Went to transformation TAB of DCI
    2)Put in the following calculation: ($1 / 520093696) * 100 
    3)Set delta processing to: Keep original value.

    This is the first time I've used this feature so talk slowly  😄
    Thanks in advance.

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

      Hello!

      Looks correct. Do you have any problems with it? Also, since version 0.2.20 you can collect total amount of RAM as separate DCI and use it's value in calculation instead of hardcoded value.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • X
        X
        xenth
        wrote on last edited by
        #3

        It does nothing with my calculation, just keeps giving the numer in Mbytes  ???

        Your idea sounds better, how would I do this? I haven't done this before so can you give me an example of how you would do this?

        Thanks as always!

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

          Some additional info can be found in this thread: https://www.netxms.org/forum/index.php/topic,289.0.html.

          Assuming that you have DCI for parameter System.Memory.Physical.Total, your transformation script may look like this:

          sub main()
          {
             total = GetDCIValue($node, FindDCIByName($node, "System.Memory.Physical.Total"));
             return $1 / total * 100;
          }
          

          or simplified to

          $1 / GetDCIValue($node, FindDCIByName($node, "System.Memory.Physical.Total")) * 100
          

          Best regards,
          Victor

          1 Reply Last reply
          0
          • X
            X
            xenth
            wrote on last edited by
            #5

            I don't know why but your scripts aren't working either.

            It looks like whatever I put as transformation script with "no delta processing", does absolutely nothing  😞

            Hardcoded: ($1 / 520093696) * 100:
            Gives the normal value

            Your codE: $1 / GetDCIValue($node, FindDCIByName($node, "System.Memory.Physical.Total")) * 100 :
            Gives the normal value

            What could be causing this, am I doing something wrong?

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

              It' because DCI data type is unsigned int64, and automatic conversion from it to float (real) is not allowed. If you take a look at event log, you most likely will see a lot of SYS_SCRIPT_ERROR events. You have two options: change DCI data type to "float" or "integer", or do an explicit type conversion like this:

              int64($1) / GetDCIValue($node, FindDCIByName($node, "System.Memory.Physical.Total")) * 100
              

              Currently NetXMS will leave original value if transformation script fails - not a correct behaviour probably.

              Best regards,
              Victor

              1 Reply Last reply
              0
              • X
                X
                xenth
                wrote on last edited by
                #7

                Aaaah I see! Excellent  🙂

                Thanks so much again, nice to have this running.

                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