Report showing computer group name and type (Automatic or Manual)

Hi,

I thought getting a list of computer groups and if they are an automatic group or a manual group would be simple.

I tried the following from Web Reports and found that type (from BigFix Console) doesn’t seem to match up with the type in relevance…

I tried:

(name of it, type of it,number of members of it) of bes computer groups

and it is saying that operator “type” is not defined.

Am I missing something? Ias it just because it’s Wednesday?

Thanks,
BobK

Hi BobK,

There isn’t a ‘type’ property for ‘bes computer groups’ (which is why you’re getting an error that ‘type’ is not defined). To see all the elements that can be returned from ‘bes computer groups’, aside from looking at the documentation, you can leverage the following relevance:

properties whose (it as string contains "<bes computer group>")

This then might lead you to relevance such as the following to return group ‘type’:

(name of it, (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a"), number of members of it) of bes computer groups

@Aram,

Thanks! I was trying to figure out if there was a way to see all the “field” (sorry, too much SQL)!
I looked up Manual Flag (now that I know its name) and it says it could have a third value, “ad-hoc”. Is that something that would happen often, or is that something that really isn’t used anymore?

Thanks again,
BobK

Now, to make it look nice: (When I try this, I get

around first property, but no for the other three properties)
concatenation of trs of (
    (   td of name of it as string &
        td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
        td of (creation time of it as string) & 
        td of (number of members of it as string)
    ) of bes computer groups
)

Does anyone know what I did wrong?

Thanks,
BobK

You have a very minor error in:

td of name of it as string

You ended up with creating an HTML

name but convert it to string right away.
So precedence is important and you want:
td of (name of it as string)

Example:

(html "<table>" & it & html "</html>") of
concatenation of trs of (
    (   td of (name of it as string) &
        td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
        td of (creation time of it as string) & 
        td of (number of members of it as string)
    ) of bes computer groups
)

@leewei

Thank you for the explanation and the code!!! Hopefully that will help me avoid that problem in the future!

Now, to make that all look pretty (in Web Reports), I have done the following (see below)

Do you have a suggestion for a better (perhaps cleaner) way of doing this, or is this good?

<html>
<head>
<style>
h1 {
    text-align:  center;
}
table {
   border-collapse: collapse;
}
th {
   color:white;
   background-color: black;
   border:  1px solid white;
   padding:  5px;
}
table, td {
   border:  1px solid black;
   padding:  5px;
}
</style>
</head>
<?relevance

(html "<table><tr> <th>Computer Group</th><th>Group Type</th><th>Creation Time</th><th>Member Count</th> </tr>" & it & html "</html>") of
concatenation of trs of (
    (   td of (name of it as string) &
        td of (if manual flag of it then "Manual" else if automatic flag of it then "Automatic" else "n/a" as string) &
        td of (creation time of it as string) & 
        td of (number of members of it as string)
    ) of bes computer groups
)


?>
</html>

Also, the line:

 (html "<table> & it & html "</html>") of

Should that have been:

 (html "<table> & it & html "</table>") of

That is taking the html tag <table> then concatenating the results of the following relevance (it) and then concatenating the html tag </table>

I wasn’t aware that was available, so thank you for that as well!!!

Thanks!
BobK

1 Like

@Bob_K, very nice, you are all good, sorry for the type ref the html table.

@leewei

No problem! I am a frequent flyer with typos…

:smirk:

Thanks,
BobK