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. using DCI attributes within transformation script

using DCI attributes within transformation script

Scheduled Pinned Locked Moved Support
11 Posts 3 Posters 28.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.
  • S
    S
    SKYnv
    wrote on last edited by
    #2

    $1 - current value (last polled)
    if you want use another dci in curent dci see this http://wiki.netxms.org/wiki/NXSL_Function_Reference#Data_Collection

    1 Reply Last reply
    0
    • G
      G
      gkaudewitz
      wrote on last edited by
      #3

      Sorry but I hove to clarify the question. I want to do the following with the Transformatinscript of the DCI

      I have an DCI with parameter:
      .1.3.6.1.2.1.31.1.1.1.10.10201
      from that parameter/name I want to build the parameter
      .1.3.6.1.2.1.2.2.1.5.10201
      to find the corresponding DCI by GetDCIValueByName that has requested the interface speed.
      With this information I want to calculate the percentage value for the usage of the interface within the transformormationscript.

      1 Reply Last reply
      0
      • S
        S
        SKYnv
        wrote on last edited by
        #4

        mmm?

        sub main()
        {
          if ($node->isSNMP)
          {
           transport = CreateSNMPTransport($node);
            if (transport == null)
            {
            return -1;
            }
        
            ifspeed = SNMPGetValue(transport, ".1.3.6.1.2.1.2.2.1.5.10201"); // get if speed
        
            if (ifspeed != null)
            {
                //you can use "case/switch" if have y have many params
                if (ifspeed == "blablabla") //change blabla bla string. see mib, i don't know how it on cisco
                {
                   return (($1*8)/(1 << 20)); //transform bytes to megabites
                }
                else
                {
                   return $1; //return default value
                }
            }
          }
        }
        
        1 Reply Last reply
        0
        • G
          G
          gkaudewitz
          wrote on last edited by
          #5

          Not really what I want to do.
          Within transformationscript some pseudocode now
          sub main()
          {
            pos = rindex(trim($dci->name),".");
            len = length(trim($dci->name)) - pos;
            port = right($dci->name,len);
            snmpoid = ".1.3.6.1.2.1.2.2.1.5.".port;
            speed = GetDCIValueByName($node,snmpoid);
            result = (($1*8)*100)/speed;
            return result;
          }

          the meaning of $dci in this example would be the same as with $node refering to the current DCI.

          1 Reply Last reply
          0
          • S
            S
            SKYnv
            wrote on last edited by
            #6

            @gkaudewitz said in using DCI attributes within transformation script:

            Not really what I want to do.
            Within transformationscript some pseudocode now
            sub main()
            {
              pos = rindex(trim($dci->name),".");
              len = length(trim($dci->name)) - pos;
              port = right($dci->name,len);
              snmpoid = ".1.3.6.1.2.1.2.2.1.5.".port;
              speed = GetDCIValueByName($node,snmpoid);
              result = (($1*8)*100)/speed;
              return result;
            }

            the meaning of $dci in this example would be the same as with $node refering to the current DCI.

            $dci object added in 1.2.4 dev version
            how get snmp y see in my script.
            i'm recomend write script in script library and using functions with "use" operator.

            1 Reply Last reply
            0
            • G
              G
              gkaudewitz
              wrote on last edited by
              #7

              Now we have same understanding of my problem.
              Thanks for the information concerning $dci.
              This will simplify the tasks concerning calculation of values for me. Because I don't want generating an extra snmprequest each time the octet-value is requested.

              Thanks for the help!

              1 Reply Last reply
              0
              • S
                S
                SKYnv
                wrote on last edited by
                #8

                @gkaudewitz said in using DCI attributes within transformation script:

                Now we have same understanding of my problem.
                Thanks for the information concerning $dci.
                This will simplify the tasks concerning calculation of values for me. Because I don't want generating an extra snmprequest each time the octet-value is requested.

                Thanks for the help!

                if portspeed is constant you can write array with each port information in the script.

                1 Reply Last reply
                0
                • G
                  G
                  gkaudewitz
                  wrote on last edited by
                  #9

                  Is the $dci object added in final version of 1.2.4?

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

                    Yes, it is available in 1.2.4.

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0
                    • S
                      S
                      SKYnv
                      wrote on last edited by
                      #11

                      @gkaudewitz said in using DCI attributes within transformation script:

                      Is the $dci object added in final version of 1.2.4?

                      and in 1.2.4 added multipliers for charts.

                      and y need only transform bytes to bites

                      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