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. netxms 1.2.16 getavgdcivalue not working

netxms 1.2.16 getavgdcivalue not working

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 10.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.
  • M
    M
    multix
    wrote on last edited by
    #1

    Hi There!

    I am trying to use NetXMS on routers' bandwidth usage statistics and trying to see if any saturation is happening on my network.

    For this, I am trying to use getavgdcivalue command on scripting but i am sure that command is not returning true result.

    I had a look at code, and did not see any error.
    Itried to use sql statement as described other posts about this command, and sql command is working properly but getavgdcivalue command is not working.

    I Tried to use GetminDCIValue, it is working.
    I tried to use GetMaxDCIValue, it is working.

    I tried to use GetSumDCIValue, it is NOT Working properly.
    I tried to use GetAVGDCIValur, it is NOT working properly.

    Getsumdcivalue and getavgdcivalue is returning integers that smaller than 10.

    By the way, i am using netxms on linux mint machine and mysql.

    Can anybody help me to solve this problem, please?

    1 Reply Last reply
    0
    • M
      M
      multix
      wrote on last edited by
      #2

      I had a look into code and saw a new command : GetDCIValues . With this command, i can read all records between timestamp as an array.
      i can calculate an average value by:

      GetDCIValues between timestamps, Sum them and divide to record count between timestamps  (because both GetAvgDCIValue and GetSumDCIValue are not working properly and returning meanless integers between 1..10)

      so i can calculate avg. But If there is an other way, can anybody tell me, please ?

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

        Hi,

        that's very strange, because as you probably see in the code, all four functions share common implementation and only change SQL aggregate function. Can you please share exact data - actual DCI values, result of  GetAvgDCIValue and GetMaxDCIValue, and results of appropriate SQL queries?

        Best regards,
        Victor

        1 Reply Last reply
        0
        • M
          M
          multix
          wrote on last edited by
          #4

          All Information about DCI values and script as follows:

          DCI Values :
          "Timestamp","Value"
          "15.10.2014 22:48:51","5192"
          "15.10.2014 22:48:41","7360"
          "15.10.2014 22:48:31","8624"
          "15.10.2014 22:48:21","160"
          "15.10.2014 22:48:11","2952"
          "15.10.2014 22:48:01","160"
          "15.10.2014 22:47:51","160"
          "15.10.2014 22:47:41","160"
          "15.10.2014 22:47:31","160"
          "15.10.2014 22:47:21","160"
          "15.10.2014 22:47:11","160"
          "15.10.2014 22:47:01","2952"
          (Got these with export to csv)

          my sample script is :

          node=FindNodeObject(null,11298);
          nodedci2=FindDCIByDescription(node,"inbound_12");
          nodedci=GetDCIObject(node,nodedci2);
          saturesure=GetCustomAttribute(node,"saturesure");
          btime=time();
          avgdci=GetAvgDCIValue(node,nodedci->id,btime-saturesure,btime);
          sumdci=GetSumDCIValue(node,nodedci->id,btime-saturesure,btime);
          println "avgdci    : ".avgdci;
          println "sumdci    : ".sumdci;
          println "saturesure : ".saturesure;

          inboundsondakka=GetDCIValues(node,nodedci->id,btime-saturesure,btime);
          ib=0;
          ic=0;
          foreach (ia:inboundsondakka)
          {
          ib++;
          ic=ic+ia;
          println ib.".th record :".ia;
          }

          ic=ic/ib;
          println "recordcount :".ib;
          println "avgdcivalue :".ic;

          return false;

          (11298 my node id)

          and console output is :

          avgdci : 2.00000
          sumdci : 3.00000
          saturesure : 120
          1th record : 5192
          .
          .
          .
          12.th record : 2952
          recordcount : 12
          avgdcivalue : 2350.00000

          NETXMS version : 1.2.16. Compiled from source, and i am using mysql 5.5.38-0 and Operating System is : linux mint 17

          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