adding together OIDs from many different nodes within a tempate?
-
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!
-
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 -
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!!!!
-
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 -
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: 1254143656You can then add this particular script DCI to your Dashboard.
-
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: 1254143656You can then add this particular script DCI to your Dashboard.
-
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 -
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