Now, I feel as if tho I have to mention I have exhaustively searched on this site and other BigFix sites and spent considerable time in Web Reports trying to get my 2 reports combined without luck.
I am lacking something (talent) to get the combination of reports.
Here is what I am trying to do, one relay per line:
Run report only on computers that are relays
Get the list of the relays IP addresses
Get the number of computer that are using that particular relay
A analyses value that runs on the relays reporting the AD sitename (if exists)
I have to do this through 2 reports now
First one is the relay and the count of clients:
<?relevance (it, multiplicity of it) of unique values of relay servers of bes computers?>
Second one is the few others minus the analyses value
<?relevance (name of it, concatenation ";" of values of results (bes property "IP address", it)) of bes computers whose (relay server flag of it = true)?>
I almost thought I was there with this… but no
<?relevance (name of it whose (relay server flag of it = true), (multiplicity of it as string) of unique values of relay servers of it) of bes computers?>
Is there anyone who may be able to help me out please to efficiently combine all these into one report, I am struggling hardcore and my brain is not coping with the inability to resolve this.
Would like it to be fairly efficient but I can probably work on that if necessary… I just dont get why I can not do what I think should be possible.
Wonder if someone can make something of this new attempt i have please, I am getting further along but am not able to get the “it” for the number of relays to work dynamically, I can use a static relay value and every relay listed will have the same value.
I would appreciate any assistance with how to rewrite the number of clients on the relay to use the it instead of static value i put in … which only gets that relays number and not dynamically like I need.
(
name of it, values of results from (bes property "DynamicSiteName") of it, concatenation "#" of (ip addresses of it as string), number of bes computers whose (value of result (bes property "Relay", it) as string contains "insertsomebigfixrelayservernamehere")
)
of unique values of bes computers whose (relay server flag of it = true)
So this part is the currently for testing “static” and should refer to the bottom line instead so it compares to the relay…
number of bes computers whose (value of result (bes property "Relay", it) as string contains "insertsomebigfixrelayservernamehere")
What I need is “insertsomebigfixrelayservernamehere” to somehow reference to
of unique values of bes computers whose (relay server flag of it = true)
This is indeed a tough one. Didn’t want you to think you’re being ignored, but every time I think I have a way in to this relevance I get stumped.
How are you using this? If it’s in a Console Dashboard or an interactive Web Report, I’ve sometimes gotten around these tough ones with JavaScript. I.E. first get the results of unique values of bes computers whose (relay server flag of it = true), stored in a JavaScript array, then looping through each element to get the results. That’ll only work interactively (the JavaScript won’t fire on a stored or emailed Web Report).
Let me know if you’re ready to go down that dark path, using JavaScript in an OJO is barely documented (or at least, I’ve never found much), but I’ve been able to leverage it in a number of my dashboards now.
I don’t have a console available now (I rarely read the forum while at work), but I’ve carved out what might be a similar case in the fixlet debugger.
(
it, (it, multiplicity of it) of unique values of items 1 of
(
("a","relay1");
("b","relay1");
("c","relay2")
)
) whose (item 0 of it = item 0 of item 1 of it)
of
("relay1";"relay2")
A: relay1, ( relay1, 2 )
A: relay2, ( relay2, 1 )
Consider that you retrieve relays named “relay1” and “relay2”; and clients “a”, “b”, and “c” that return their parent relay property. You can count the number of clients connected to each relay by obtaining the “multiplicity of unique values of” the parent relay property. Then filter that to matches between the relay name and the clients’ parent relay name. This may take considerable time to evaluate based on the number of clients and number of relays.
I don’t have a console to check, but I think that based on your query that could translate to
(
/* relay name */
name of item 0 of it,
/* relay site */
values of results from (bes property "DynamicSiteName") of item 0 of it,
/* ip addresses of relay*/
concatenation "#" of (ip addresses of item 0 of it as string),
/* number of clients reporting to relay*/
item 1 of item 1 of it
) of
(
it,
(it, multiplicity of it) of unique values of (values of results (bes property "Relay", bes computers) as string)
)
whose (name of item 0 of it = item 0 of item 1 of it) of
bes computers whose (relay server flag of it = true)
Yes, I’ve used JavaScript heavily in Dashboards, but it’s not so great for archiving/mailing Stored Reports. I’ve not had any luck getting the JS to fire and end up with empty saved reports - there doesn’t seem to be an “onLoad” event when the report is generated.
Back at a console now, and I think this does retrieve what you want -
q: (name of item 0 of it, item 1 of item 1 of it) of (it, (it, multiplicity of it) of unique values of (values of results (bes property "Relay", bes computers) as string)) whose (name of item 0 of it as lowercase = (if it contains "." then preceding text of first "." of it else it) of item 0 of item 1 of it as lowercase) of bes computers whose (relay server flag of it = true)
For the Relay properties, just pull the “[whatever] of item 0 of it”, and for the count pull “item 1 of item 1 of it”. It doesn’t run as poorly as I had expected.
Note that if the client views the Relay using any kind of an alias name or direct IP address, those clients won’t be counted.
This may perform better with larger numbers of relays & clients:
q: (preceding text of first ":" of item 0 of it as integer, name of item 1 of it) of (elements of item 0 of it, elements of item 1 of it ) whose (following text of first ":" of item 0 of it = name of item 1 of it as lowercase) of (set of (multiplicity of it as string & ":" & it) of unique values of ((if it contains "." then preceding text of first "." of it else it) of values of results (bes property "Relay", bes computers) as string as lowercase), set of bes computers whose (relay server flag of it = true))
A: 105, RELAY1
A: 11, RELAY2
A: 1327, RELAY3
A: .....
In this version, I only have to iterate through all the clients retrieving their “Relay” value one time, where in the earlier version I iterate through all the clients X each of the relays.
Unfortunately due to some urgent work this was put in hold till recently again and I forgot to check the thread.
Thought I would check it and see your hard work from a while ago now! Woops!
Your time was not wasted however, I appreciate your responses and am impressed with the speed of the return of results in the last example. It took 0.8 seconds on 1000~ relays in a 60k environment. I like it.
I added some modifications to it to return the additional results I wanted in a single view/report, now the column output is as follows:
Count of clients connected to relay, relay name (if has FQDN return only first part), AD site (Custom analyses), subnets from relay, last report time of relay.
Also I can see/am aware of the issue of the relay not showing up in the list if DNS name or IP address is used. I knew about that before I started but could not establish a way to read the relay list first and then have the clients evaluate their relay against that. May play with that part when time allows.
This takes me 16.8 seconds to run now would love to reduce it but nothing I tried yet has had any positive effect.
Thanks again Jason for the help, really appreciate it.
(
preceding text of first ":" of item 0 of it as integer,
(if (it contains ".") then (preceding text of first "." of it) else (it)) of name of item 1 of it as string,
(if (exists results (bes properties whose (name of it = "DynamicSiteName" and name of source analyses of it = "Retrieve AD Site Name"), item 1 of it)) then (values of results (bes properties whose (name of it = "DynamicSiteName" and name of source analyses of it = "Retrieve AD Site Name"), item 1 of it)) else ("Relay missing AD SiteName")),
concatenation ";" of (values of results (bes property whose (name of it = "Subnet Address"), item 1 of it) as string),
(((day_of_month of it as two digits & "/" & month of it as two digits & "/" & year of it as string) of date (universal time zone) of it & " " & ((two digit hour of it & ":" & two digit minute of it & ":" & two digit second of it) of time (universal time zone) of it)) of last report time of item 1 of it)
)
of (elements of item 0 of it, elements of item 1 of it) whose (following text of first ":" of item 0 of it is contained by name of item 1 of it as lowercase) of (set of (multiplicity of it as string & ":" & it) of unique values of ((if it contains "." then preceding text of first "." of it else it) of values of results (bes property "Relay", bes computers) as string as lowercase), set of bes computers whose (relay server flag of it = true))