Custom report, reading a local file

(imported topic written by lmpymilk91)

Can a custom report read from a file on the local server or an extenal file from a remote source like ?

something like (exists file “\127.0.0.1\foo\bar.txt” whose (exists lines whose (it as string as lowercase starts with “FooBar” as lowercase) of it))

Thanks

Chris

(imported comment written by Lee Wei)

Hi Chris,

The TEM custom report is basically an HTML program, so it will be able to read a resource which is URL based, like http://, but not a file.

Sounds a little like the issue we discussed here:

http://forum.bigfix.com/viewtopic.php?pid=32982#p32982

The “File” inspector is valid only on the Client side, but is not available in the session relevance on the server side.

Lee Wei

(imported comment written by lmpymilk91)

Do you have a small example of getting a string from an URL based resource?

Thanks

Chris

(imported comment written by Lee Wei)

Here is an example of using JavaScript, and the XmlHttpRequest() object to read a URL and parse its content.

http://www.ibm.com/developerworks/web/library/wa-httpget/index.html

Lee Wei

(imported comment written by lmpymilk91)

Here is what I am trying to do.

<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Wireless - Failed Auth</title> </head> <body> <style type=
"text/css"> th 
{ font-size:15; background-color: #eaeaea; border: 1px solid #cccccc; margin: 0; white-space: nowrap; 
} td 
{ border: 0px; 
} #ResultsTable 
{ width: 100%; border-width: 0px; 
} #ResultsTable td 
{ vertical-align: top; white-space: nowrap; outline: #cccccc solid thin 
} table 
{ font-size: 15px; color: black; text-indent: 2px; 
} </style>   <table id=
"ResultsTable"> <th>Computer Name</th> <th>DNS Name</th> <th>Facility</th> <th>Service Area</th> <th>User Name</th> <th>Computer Model</th> <th>Asset Tag</th> <th>Serial Number</th> <th>BIOS Date</th> <th>MAC Address</th> <th>Last Report Time</th>   <!--Start Report
//--> <?Relevance   
"(trs of (td of concatenation %22,%22 of unique values of (values of results (bes property %22Computer Name%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22DNS Name%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22Active_Directory-Facility%22, it))" & 
" & td of concatenation %22,%22 of unique values of (values of results (bes property %22Active_Directory-Service_Area%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22User Name%22, it))" & 
" & td of concatenation %22,%22 of unique values of (values of results (bes property %22Computer Model - Windows%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22Asset Tag%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22Serial Number%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22BIOS%22, it))" & 
" & td of concatenation %22,%22 of unique values of (values of results (bes property %22MAC Addresses%22, it)) & td of concatenation %22,%22 of unique values of (values of results (bes property %22Last Report Time%22, it))))" & (
" of bes computers whose %28 %28 exists %28 values of results %28 it, bes property %22MAC Addresses%22 %29 %29 whose %28"& (concatenation 
" OR " of unique values of ((If (it contains 
".") Then (
"%28it as lowercase contains %22" & (((first 2 of it) &
"-"& (last 2 of first 4 of it) &
"-"& (last 2 of first 6 of it) &
"-"& (last 2 of first 8 of it) &
"-"& (last 2 of first 10 of it) &
"-"& (last 2 of first 12 of it)) of (concatenation 
"" of (substrings separated by 
"." of it))) & 
"%22 as lowercase%29") Else (
"%28it as lowercase contains %22" & (it) & 
"%22 as lowercase%29")) of (following text of first 
"," of it)) of (unique values of (lines whose ((it contains 
",") AND (it does not contain 
"#")) of file 
"<PathToFile>\WirelessAuthFailures.csv"))) & 
"%29%29 AND %28 last report time of it > now - 14*day %29 %29")   ?> <!--End Report
//--> </table></body></html>