Topic
2 replies Latest Post - ‏2013-06-05T13:15:24Z by Paweł Pyrek
Paweł Pyrek
Paweł Pyrek
4 Posts
ACCEPTED ANSWER

Pinned topic Custom report - multiple data and a graph using D3 js

‏2013-04-17T10:57:43Z |

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:

<style type="text/css">

    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;
    }
</style>
<table>
<th>ID</th><th>Host</th><th>Client</th><th>Group</th><th>IEM Server</th><th>IEM Relay</th><th>Primary Relay</th><th>Secondary Relay</th><th>IP</th><th>IEM Version</th><th>OS</th>
<?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" )
)

?>
</table>

Updated on 2013-04-17T10:58:07Z at 2013-04-17T10:58:07Z by Paweł Pyrek
  • Lee Wei
    Lee Wei
    598 Posts
    ACCEPTED ANSWER

    Re: Custom report - multiple data and a graph using D3 js

    ‏2013-04-20T21:08:52Z  in response to Paweł Pyrek

    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

     

    • Paweł Pyrek
      Paweł Pyrek
      4 Posts
      ACCEPTED ANSWER

      Re: Custom report - multiple data and a graph using D3 js

      ‏2013-06-05T13:15:24Z  in response to Lee Wei

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