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. Interface Name in DCI through template

Interface Name in DCI through template

Scheduled Pinned Locked Moved Support
8 Posts 3 Posters 29.4k 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.
  • P
    P
    Percy
    wrote on last edited by
    #1

    hi Victor,

    i have created  Templates

    Description- Traffic In {instance} (Byte/sec)
    Parameter-.1.3.6.1.2.1.31.1.1.1.1.{instance}    //ifName Oid
    Origin- SNMP
    Datatype- String
    Instance Discovery-Snmp walk-oid
    Base Oid-.1.3.6.1.2.1.31.1.1.1.1
    Polling Interval = 60 seconds

    transformation Script-
    transport = CreateSNMPTransport($node);    // Create SNMP transport for node
    if (transport == null)
    {
    println "Failed to create SNMP transport, exit";
    return 1;
    }
    trafficIn = SNMPGetValue(transport, ".1.3.6.1.2.1.31.1.1.1.6.$1");
    return = trafficIn;

    this template create DCI for the Routers in this way

    Description                                    Parameter                                  data Type
    Traffic In {instance} (Byte/sec)      .1.3.6.1.2.1.31.1.1.1.1.{instance}      String
    Traffic In fa0/0 (Byte/sec)              .1.3.6.1.2.1.31.1.1.1.1.fa0/0            String
    Traffic In fa0/1 (Byte/sec)              .1.3.6.1.2.1.31.1.1.1.1.fa0/1            String
    Traffic In fa0/2 (Byte/sec)              .1.3.6.1.2.1.31.1.1.1.1.fa0/2            String

    but when i check the DCI values. it does not collect the data shows zero for all interfaces DCI, why transformation script is not working. please correct me where i am doing wrong. please let me know if there are other way to do the same.

    thanks in advance,
    Percy

    1 Reply Last reply
    0
    • A
      A
      andrey--k
      wrote on last edited by
      #2

      @percy said in Interface Name in DCI through template:

      trafficIn = SNMPGetValue(transport, ".1.3.6.1.2.1.31.1.1.1.6.$1");

      I am not shure, but try to change to:

      trafficIn = SNMPGetValue(transport, ".1.3.6.1.2.1.31.1.1.1.6." . $1);
      
      1 Reply Last reply
      0
      • P
        P
        Percy
        wrote on last edited by
        #3

        hi,
        thanks for the Reply... i have tried this still not working...
        i think problem is here
        in this $1 = fa0/0, fa0/1 and so on
        trafficIn = SNMPGetValue(transport, ".1.3.6.1.2.1.31.1.1.1.6.fa0/0); but when we select walk with this OId it give result like this
        .1.3.6.1.2.1.31.1.1.1.6.1    125824582
        .1.3.6.1.2.1.31.1.1.1.6.2    112124548
        .1.3.6.1.2.1.31.1.1.1.6.3    152548225

        here {instance} is an Index i.e integer value but we are passing string fa0/0

        when i change the Parameter Oid IfName to ifIndex than DCI doesnot show the Interface Name...but give the Values for the DCI.
        in this case DCI doesnot shows the interface Name

        Description                                    Parameter                                  data Type
        Traffic In {instance} (Byte/sec)      .1.3.6.1.2.1.2.2.1.1.{instance}    integer
        Traffic In 1 (Byte/sec)                  .1.3.6.1.2.1.2.2.1.1.1                integer
        Traffic In 2 (Byte/sec)                  .1.3.6.1.2.1.2.2.1.1.2                integer
        Traffic In 3 (Byte/sec)                  .1.3.6.1.2.1.2.2.1.1.3                integer

        difficult to find the DCI for the Interface Inteface fa0/1 or if there are many Interfaces difficult to find the DCI for the particular inteface.

        Regards.
        Percy

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

          Hi, the OID range you are trying to look into is .1.3.6.1.2.1.31.1.1.1.6.x (as seen in the transformation script) but in the DCI template you have just .1.3.6.1.2.1.31.1.1.1.1.x ?

          And the Datatype in the DCI template configuration should be Integer, not String (not sure if it is the main problem though).

          M.Sperl

          1 Reply Last reply
          0
          • A
            A
            andrey--k
            wrote on last edited by
            #5

            I had not find way to make DCI Description field another than index.  😞

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

              Sorry I did not understand the problem.

              I tried to solve this with macro but not sure if instance parameter can be passed to the script...

              For that reason every other part of the DCI is normal:

              DCI:

              Description: ifDescr: %{script:ReturnIfDescr}
              Parameter: .1.3.6.1.2.1.2.2.1.10.{instance} // <= value InOctets for ports, taken from the .10 branch
              Origin: SNMP
              Datatype: Integer
              Instance discovery metod: SNMP Walk - OIDs
              Base SNMP OID: .1.3.6.1.2.1.2.2.1.10
              

              Script Library:
              ReturnIfDescr:

              transport = CreateSNMPTransport($node);
              if (transport == null) return "n/a";
              return SNMPGetValue(transport, ".1.3.6.1.2.1.2.2.1.2.1"); // <= ifDescription of 1st port, taken from the .2 branch
              

              But this script returns only description of the first port to the macro.

              There should be something like this, but it does not work this way ofcourse ..

              return SNMPGetValue(transport, ".1.3.6.1.2.1.2.2.1.2.".$instance);
              

              p.s. this solution will not reflect any changes in the ifDescription though as the macro is run only when the DCI is created

              M.Sperl

              1 Reply Last reply
              0
              • P
                P
                Percy
                wrote on last edited by
                #7

                hi..,

                i tried the way you mention above but not working properly.
                Still i am facing the same problem in getting the port name or interface name in DCI description.

                percy

                1 Reply Last reply
                0
                • A
                  A
                  andrey--k
                  wrote on last edited by
                  #8

                  I have found interesting function:

                  http://wiki.netxms.org/wiki/NXSL:CreateDCI
                  

                  May be it helps...

                  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