Custom report - multiple data and a graph using D3 js

(imported topic written by Paweł Pyrek)

Hi,

I’m creating a custom report which will generate a table containing information about IEM (TEM / Bigfix) environment and later on I will generate a custom infrastructure schema using D3 java script library from this data. I’m still missing some fields. Maybe someone knows how to get those. Check lines with TODO statements below:

table { margin: 0; border-collapse: collapse; color: #222; font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; } th { font: 9pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: navy; font-weight: normal; background-color: #F2F2F2; border: 1px solid #cccccc; margin: 0; padding: 4px 10px 4px 5px; text-align: left; } td { color: #222; font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; border-bottom: 1px solid #cccccc; margin: 0; /* padding: 6px 20px 1px 0; */ padding: 8px 20px 5px 5px; } td.userinput { color: #222; font: 10pt arial, helvetica, sans-serif; font-weight: normal; border-bottom: 0px; margin: 0; padding: 6px 20px 1px 0; } td.errormsg { color: red; font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-weight: bold; border-bottom: 0px; margin: 0; padding: 6px 20px 1px 0; } td.msg { color: #747170; font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-weight: bold; border-bottom: 0px; margin: 0; padding: 6px 20px 1px 0; } <?Relevance concatenations of ( trs of ( td of ( id of it as string ) & td of ( name of it ) & td of ( ( if (exists client settings whose (name of it = "Client") of it) then (value of client settings whose (name of it = "Client") of it) else "None" ) ) & td of ( ( if (exists client settings whose (name of it = "Location") of it) then (value of client settings whose (name of it = "Location") of it ) else if (exists client settings whose (name of it = "Segment") of it) then (value of client settings whose (name of it = "Segment") of it) else "None" ) ) & td of ( if (exists root server flag of it ) then (root server flag of it as string) else "None") & td of ( if (exists relay server flag of it ) then (relay server flag of it as string) else "None") & td of ( "TODO: Get primary relay hostname" ) & td of ( "TODO: Get secondary relay hostname" ) & td of ( "TODO: Get IP (or list of IPs)" ) & td of ( agent version of it ) & td of ( operating system of it ) ) ) of bes computers whose ( ( relay server flag of it as string as lowercase contains "true" ) or ( root server flag of it as string as lowercase contains "true" ) ) ?>
ID Host Client Group IEM Server IEM Relay Primary Relay Secondary Relay IP IEM Version OS

(imported comment written by Lee Wei)

Here you go, you can give the following a try.

  • Primary and Secondary relays do not existsfor the main IEM Server.

  • For the IP Address example, note that we use concatenation to ensure that when a computer has multiple addresses, we can still return them correctly.

( trs of

(

td of ( id of it as string ) &

td of ( name of it ) &

td of ( ( if (exists client settings whose (name of it = “Client”) of it) then (value of client settings whose (name of it = “Client”) of it) else “None” ) ) &

td of ( ( if (exists client settings whose (name of it = “Location”) of it) then (value of client settings whose (name of it = “Location”) of it ) else

if (exists client settings whose (name of it = "Segment") of it) then (value of client settings whose (name of it = "Segment") of it) else "None" ) ) &

td of ( if (exists root server flag of it ) then (root server flag of it as string) else “None”) &

td of ( if (exists relay server flag of it ) then (relay server flag of it as string) else “None”) &

td of ( ( if (exists client settings whose (name of it = “__RelayServer1”) of it) then (value of client settings whose (name of it = “__RelayServer1”) of it) else “None” ) ) &

td of ( ( if (exists client settings whose (name of it = “__RelayServer2”) of it) then (value of client settings whose (name of it = “__RelayServer2”) of it) else “None” ) ) &

td of ( concatenation "; " of values of results from (bes properties whose (name of it = “IP Address”)) of it ) &

td of ( agent version of it ) &

td of ( operating system of it )

) ) of bes computers

(imported comment written by Paweł Pyrek)

Thank You for the advice. I’m finishing slowly my report in spare time. I will share the code when it will be finished :slight_smile: