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. Custom Attributes

Custom Attributes

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

    Hello,

    I'm creating templates for switch management. We have both Cisco and HP switches.
    To handle this, I'm creating templates per Makers and template to handle DCI and other things.

    Do you know if it is wise to use Custom Attributes to store specific OIDs ?

    Is it possible to retrieve Custom Attribute values directly from SNMP DCI page ? or do I need to code transformation script for an internal dummy DCI ?

    If a custom attribute is declared twice (ie : one on 2 templates attached to one node), is it possible to know which one will be used ?

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

      argrr...

      Custom Attributes created in a template are not "visible" from script created in another one.

      I've create a CA in HP template MaxMemoryOID = .1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.5.1
      I've bind a HP switch to this template.

      And in a generic Switch template, I've create a dummy DCI to get SNMP value :

      sub main()
      {
      	trace(1,"Get CA=" . GetCustomAttribute($node, "MaxMemoryOID"));
      	snmp = CreateSNMPTransport($node);
      	return SNMPGetValue(snmp, GetCustomAttribute($node, "MaxMemoryOID"));
      }
      

      If CA is manually defined in the node : it works, if it is inheritated from first template : value is NULL.

      Any idea to overcome this ?

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

        Hi!

        Custom attributes are attached to the object. Template only handles data collection configuration, custom attributes will not be copied. Custom attributes was designed to store object-specific attributes, and often used by integration tools or scripts. For data collection it is usually enough to create different templates for different vendors/models.

        Best regards,
        Victor

        1 Reply Last reply
        0
        • T
          T
          touton
          wrote on last edited by
          #4

          As I'm creating lots of settings (thresholds,...) I was hopping to be able to create template that can work with any devices, and move vendor specifics to another place.

          what is the best to do this ?

          Last solution may be to export one template,  modify the xml, and then re-import ? (not really clean, and don't know how the object IDs will match ?)

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

            Another possible option is to use script type macros in templates. For example, you can use macro like

            %{script:SelectOID}

            instead of actual OID in template, and create script called [n]SelectOID[/b] in script library, which will return correct OID for given node. This script will have $node variable set, so it can get any information about the node.

            For example:

            if ($node->snmpOID like ".1.3.6.1.4.1.11.*")
               return ".1.3.6.1.4.1.11.2.3.4.5.6.7.8.0";
            return return ".1.3.6.1.2.1.1.1.0";
            

            Not sure if this will be easier then configuring separate templates...

            Best regards,
            Victor

            1 Reply Last reply
            0
            • T
              T
              touton
              wrote on last edited by
              #6

              ok,

              I've recreate specific template per maker. What is the best way to duplicate a template ? Is it clever to export / do modification or merge modification /re-import ?

              Is there some info on how we can modify templates by scripts ?

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

                Hi!

                You can create new empty template, open data collection configuration for existing one, select DCIs you want to copy to new template, right-click, select "Copy to other node...", and select new template object as destination.

                You can modify templates using nxshell and Python scripts. Info about nxshell can be found here: http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations, and Java API documentation is here: https://www.netxms.org/documentation/javadoc/latest/ (you call Java API from nxshell script).

                Best regards,
                Victor

                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