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. Templates & Instance Discovery

Templates & Instance Discovery

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

    Is it possible to use Instance Discovery within a DCI configured to a Template?  I've tried to configure this according to youTube videos and instructions on the Wiki, but it seems the DCIs never get created on the actual node after applying Template when using Instance Discovery.

    I'm running 1.2.12 on Windows 2008 with SQL 2008.  Any help would be appreciated.

    1 Reply Last reply
    0
    • Z
      Z
      zsing82
      wrote on last edited by
      #2

      OK, one of the things I'm trying to do is collect bandwidth consumption from Windows hosts and servers running NetXMS Agent.

      Here's what I have:
      A template named "Agents" with Automatic Apply script as

      return $node->isAgent;
      

      Template "Agents" contain multiple DCIs.  I have 2 specific DCIs:

      Number of input bytes on interface {instance}
      Number of output bytes on interface {instance}
      

      with source being "NetXMS Agent"; data type "UnsignedInt64"; and parameters as follows:

      Net.Interface.BytesIn64({instance})
      Net.Interface.BytesOut64({instance})
      

      The "Instance Discovery" page is where I think I'm getting something wrong.  For both DCIs, I have "Agent List" as discovery method and List Name is "Net.InterfaceList".  This list returns the ifIndex, IP Address, ifType, MAC Address, and ifDesc.
      I'd like to transform the list results so that only ifIndex is returned to {instance}, but I have no idea how to do that.  Is this even possible using Templates?

      P.S.  I'd also like to perform similar action with FileSystem.FreeSpace%, etc...

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

        Hi!

        You can transform instance values in instance filtering script. Fltering script can return an array consisting of two elements - true/false flag and new instance value. For extracting interface index from interface list you can use the following script:

        if ($1 ~= "^([0-9]+) .*")
        {
           return %(true, $1);  // at this point $1 contains first matching group
        }
        return false;
        

        Best regards,
        Victor

        1 Reply Last reply
        0
        • Z
          Z
          zsing82
          wrote on last edited by
          #4

          Thank you very much for your help!  That worked perfectly.  I never would've figured out that script

          1 Reply Last reply
          0
          • H
            H
            Haari
            wrote on last edited by
            #5

            Hello,

            tried to do the same Thing like zsing82 but i'm always getting an error:

            Status of DCI 98 (NetXMS Agent: Net.Interface.BytesIn64()) changed to UNSUPPORTED

            It seems that there is something wrong with the "instance". the filtering script is exactly the one from victors post.

            I tried something similar with my hdd's and "FileSystem.MountPoints" as Instance List. This list works and delivers me all the wanted Information. But for the Network Interfaces i end up with this "unsupported"-error.

            Any ideas?

            Kind Regards
            Haari

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

              @haari said in Templates & Instance Discovery:

              Hello,

              tried to do the same Thing like zsing82 but i'm always getting an error:

              Status of DCI 98 (NetXMS Agent: Net.Interface.BytesIn64()) changed to UNSUPPORTED

              It seems that there is something wrong with the "instance". the filtering script is exactly the one from victors post.

              I tried something similar with my hdd's and "FileSystem.MountPoints" as Instance List. This list works and delivers me all the wanted Information. But for the Network Interfaces i end up with this "unsupported"-error.

              Any ideas?

              Kind Regards
              Haari

              Attach a screenshot of how your DCI is configured please.

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

                It could be that your agent does not support 64 bit interface counters (they are supported only on Windows Vista and later). Then you have to use Net.Interface.BytesIn.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • H
                  H
                  Haari
                  wrote on last edited by
                  #8

                  Hi,

                  here come the screenshots from my DCI.
                  The OS is WIN 7 Prof. (64 Bit)

                  Using "nxget -l <host> Net.InterfaceList" on the Server delivers 2 Interfaces with IP and other informations. So for me it seems correct.

                  Sorry if this is a dumb question but we are currently checking if netxms could be an alternative for our already outdated NAGIOS Installation. Cause of this i'm trying a lot of things to check what's possible an what might not.

                  Best regards
                  Haari


                  dci1.PNG

                  dci2.PNG

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

                    That's very strange. I just test it just in case, and it works as expected. Let's try to delete all DCIs already created and create new one from scratch to be sure that everything is correct, and then run configuration poll so instance discovery will occur.

                    Best regards,
                    Victor

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

                      Just an update - since this topic is the top google result for NetXMS Agent Instance discovery.

                      With 2.0 there is a new agent list "Net.InterfaceNames" which contains all interface names present on a node.
                      You can use this list as instance discovery source, without a need for any filtering script.

                      Screenshots attached.


                      agent_instance_discovery_1.PNG

                      agent_instance_discovery_2.PNG

                      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