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. adding together OIDs from many different nodes within a tempate?

adding together OIDs from many different nodes within a tempate?

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

    I'm looking for a way to add up all of the wireless clients connected to an AP, then show this in a dashboard.  the tricky part I can't figure out, is there a way to make this dynamic so as we build our network further, it is automatically sucked into the software?    I've got auto bind setup for an AP template, maybe a way to use the template to build this?

    Thanks in advance!

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

      Hi,

      depending on what you mean by "add up". Do you want to add each client as a node and collect some data from each? Or you want to count AP clients and calculate some common data on AP?

      Best regards,
      Victor

      1 Reply Last reply
      0
      • M
        M
        mgthump
        wrote on last edited by
        #3

        in the middle of those options.

        I'd like our APs to be pulled into a template automatically (I've got that part setup and working) and i have that template collecting the amount of connected Clients from each AP.
        Then i'd like a dashboard (or another method inbetween first if needed)  to look at every AP in that template, look at the OID for the number of connected subs and give me the total. 

        so  AP 1  has 10 clients,
        and AP 2 has 10 more clients skipping to ap 53 all of them with 10 clients each, Id like a dashboard to show me a result of 530 total connected clients across all APs.
        I'd like this to happen based on the template container itself if possible so new access points get pulled in automatically.

        Thanks!!!!

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

          Hi,

          looks like you need DCI summary table. After you hve it configured, you can either open it on demand for any container, or put on dashboard.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • T
            T
            Tursiops
            wrote on last edited by
            #5

            If I understand you correctly, you want a total figure of a specific DCI that exists on all nodes which are assigned to a template.

            You could create a dummy node, assign it to the same template and create a separate Script DCI on it, similar to this:

            templates = GetNodeTemplates($node);
            total=0;
            foreach(t : templates) {
            	if ( t->name == "<NAMEOFYOURTEMPLATE>" ) {
            		children = GetObjectChildren(t);
            		foreach(c : children) {
            			dciValue = GetDCIValue(c,FindDCIByName(c,"<YOUROID>"));
            			if ( dciValue != null ) total+=dciValue;
            		}
            	}
            }
            return total;
            

            Quite possible that this can be simplified.
            I just tested that against a PostgreSQL Template we have, to add up the size of some databases with the same name. I used FindDCIByDescription for this purpose, but the effect will be the same.
            Example output (with some additional println to show the individual database sizes to confirm this works):

            Database Size: 17988120
            Database Size: 1099291160
            Database Size: 20306456
            Database Size: 49494552
            Database Size: 19675672
            Database Size: 30808600
            Database Size: 16579096
            
            
            *** FINISHED ***
            
            Result: Total: 1254143656
            

            You can then add this particular script DCI to your Dashboard.

            1 Reply Last reply
            0
            • M
              M
              mgthump
              wrote on last edited by
              #6

              This method worked!!!!  I had to use the description as well, but I had been trying to wrap my mind around this stuff for a while.  you and Victor are geniuses.

              I've very much a noob with scripting and each little bit I think I grasp a touch more. 

              Thanks again, fellas!

              @tursiops said in adding together OIDs from many different nodes within a tempate?:

              If I understand you correctly, you want a total figure of a specific DCI that exists on all nodes which are assigned to a template.

              You could create a dummy node, assign it to the same template and create a separate Script DCI on it, similar to this:

              templates = GetNodeTemplates($node);
              total=0;
              foreach(t : templates) {
              	if ( t->name == "<NAMEOFYOURTEMPLATE>" ) {
              		children = GetObjectChildren(t);
              		foreach(c : children) {
              			dciValue = GetDCIValue(c,FindDCIByName(c,"<YOUROID>"));
              			if ( dciValue != null ) total+=dciValue;
              		}
              	}
              }
              return total;
              

              Quite possible that this can be simplified.
              I just tested that against a PostgreSQL Template we have, to add up the size of some databases with the same name. I used FindDCIByDescription for this purpose, but the effect will be the same.
              Example output (with some additional println to show the individual database sizes to confirm this works):

              Database Size: 17988120
              Database Size: 1099291160
              Database Size: 20306456
              Database Size: 49494552
              Database Size: 19675672
              Database Size: 30808600
              Database Size: 16579096
              
              
              *** FINISHED ***
              
              Result: Total: 1254143656
              

              You can then add this particular script DCI to your Dashboard.

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

                Actually you can create such script DCI on any node (including server node) and skip GetNodeTemplates part, using FindObject instead. So it will be something like this:

                total = 0;
                t = FindObject("<NAME_OR_ID_OF_TEMPLATE>");
                if (t != 0) {
                	children = GetObjectChildren(t);
                	foreach(c : children) {
                		dciValue = GetDCIValue(c,FindDCIByName(c,"<YOUROID>"));
                		if ( dciValue != null ) total+=dciValue;
                	}
                }
                return total;
                

                With that variant it is not necessary to assign template to node with summary DCI.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • M
                  M
                  mgthump
                  wrote on last edited by
                  #8

                  Thank you, Victor. 

                  that example was a touch more flexible. 

                  great work with NetXMS by the way.  absolute love this program even though I'm still only scratching the surface!

                  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