Thank you!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Tursiops on April 04, 2019, 02:24:29 PM
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.