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. Simple Data Transformation Question

Simple Data Transformation Question

Scheduled Pinned Locked Moved Support
4 Posts 3 Posters 24.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.
  • D
    D
    djdrastic
    wrote on last edited by
    #1

    Hi Viktor and co

    Have a NetXMS 2.0.1 system in Server/Remote Agent w/Sites configuration

    Have a simple data transformation question.
    I'm trying to monitor temperature of some Mikrotik routerboards with SNMP via .1.3.6.1.4.1.14988.1.1.3.10.0

    I need to transform the value that the Mikrotik reports by dividing the value by 10.
    I've entered the following values in the Transformation option.

    Simple Delta

    sub main()
    {
      return $1 / 10;
    }

    Test returns the correct results however values received by in the Last Values tab or DCI History return results of 0

    Anything I'm missing here ?

    Thanks


    Transformation2.jpg

    Transformation.jpg

    Last_Values.jpg

    1 Reply Last reply
    0
    • T
      T
      tomaskir
      wrote on last edited by
      #2

      Hi!

      return $1/10;
      

      Is enough actually, you dont need to declare an explicit main() method/function.
      See this: https://wiki.netxms.org/wiki/UM:NetXMS_Scripting_Language_(NXSL)#Script_entry_point

      As for why you are seeing 0 in last values, you have "Simple delta" as delta calculation enabled.
      Set delta calculation to None, and it will work.

      1 Reply Last reply
      0
      • A
        A
        Alex Kirhenshtein
        wrote on last edited by
        #3
        $1/10
        

        will work as well (note missing ";" in the end, that's on purpose)

        1 Reply Last reply
        0
        • D
          D
          djdrastic
          wrote on last edited by
          #4

          @tomaskir said in Simple Data Transformation Question:

          Hi!

          return $1/10;
          

          Is enough actually, you dont need to declare an explicit main() method/function.
          See this: https://wiki.netxms.org/wiki/UM:NetXMS_Scripting_Language_(NXSL)#Script_entry_point

          As for why you are seeing 0 in last values, you have "Simple delta" as delta calculation enabled.
          Set delta calculation to None, and it will work.

          Yikes I feel embarrassed now  :-[ :-[ :-[ :-[ :-[ :-[ :-[ :-[
          Setting the delta calculation to zero sorted it right out.
          I'll have to re-read the wiki again to make sure I'm understanding it right.

          Thanks tomaskir and Alex for the quick help.

          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