Report of devices and actions generating non-zero exit codes

(imported topic written by SystemAdmin)

I’ve created a fixlet that makes a copy the client log with todays date, parses it for non-zero exit codes and stores that in a ‘Computer Setting’. The data looks something like this:

UPS_non_zero_exit_code Exit Code=1967, fixlet 1783Exit Code=128, fixlet 2460Exit Code=128, fixlet 2460Exit Code=128, fixlet 2460Exit Code=128, fixlet 2460Exit Code=1, fixlet 2490Exit Code=1, fixlet 2491

Once the data is collected, I can report on all devices which looks like this.

Hostname, Exit Code, Fixlet #

<?Relevance (item 0 of it, substrings separated by "Exit" of item 1 of it ) whose (exists matches (regex ".+") of item 1 of it ) of ((item 0 of it, concatenation "=" of (substrings separated by "%253d" of (concatenation "," of (substrings separated by "%252c" of (following text of first "=" of (item 1 of it as string)))))) whose (item 1 of it starts with "Exit Code" and item 1 of it does not contain "3010") of ( name of item 0 of it, values of results (item 0 of it, item 1 of it) ) whose (item 1 of it contains "UPS_non_zero_exit_code=") of (it, bes property "Client Settings") of bes computers ) ?>

The output looks like this:

Hostname, Exit Code, Fixlet #

WKST00001104, ( Code=2359302, fixlet 2276 )

WKST00001104, ( Code=2359302, fixlet 2290 )

WKST00001104, ( Code=2359302, fixlet 2297 )

WKST00001104, ( Code=2359302, fixlet 2305 )

WKST000010FF, ( Code=2359302, fixlet 2276 )

WKST000010FF, ( Code=2359302, fixlet 2290 )

WKST000010FF, ( Code=2359302, fixlet 2297 )

WKST000010FF, ( Code=2359302, fixlet 2305 )

WKST0000122C, ( Code=1601, fixlet 2483 )

WKST00001A9B, ( Code=2359302, fixlet 2276 )

WKST00001A9B, ( Code=2359302, fixlet 2290 )

WKST00001A9B, ( Code=2359302, fixlet 2305 )

I’m not sure I understand the type of data that is even being returned. Is that a plural of a string and a list?

Here is my question; that last number “fixlet 2276” references the Action ID. I want to incorporate the name and time of the action into the report. The data can be retrieved from

name of bes action whose (id of it = 2276)

I’ve tried to get the data into a single report with no success. Can someone help me to incorporate the data into the report

Any help would be greatly appreciated

(imported comment written by SystemAdmin)

I was able to work around this problem by implementing some javascript in my report. I read the results into an array, parsed out the results and stored the action ID in a variable. Then queried for the name and time issued of the action.

it looks like this:

<style type=
"text/css"> table 
{ border-collapse:collapse; font: 8pt verdana, geneva, lucida, 
'lucida grande', arial, helvetica, sans-serif; 
}   td 
{ white-space:nowrap; padding:0px; 
}   table tr td 
{ border: 1px solid black; 
}   #even 
{ background-color: #cccccc; padding:0px; 
}   #odd 
{ background-color: #eeeeee; 
}   .clickable-image 
{ cursor: pointer; 
} </style>   <IMG class=
"clickable-image" src=
"/ReportFiles/spreadsheet.png">   <table id=
"myTable" ><tr><th>Hostname</th><th>Error Code</th><th>Action No.</th><th>Action Name</th><th>time issued</th></tr> <script type = 
"text/javascript">   var compDataArr = 

new Array(); compDataArr = EvaluateRelevance(
'(item 0 of it, substrings separated by "Exit" of item 1 of it ) whose (exists matches (regex ".+") of item 1 of it ) of ((item 0 of it, concatenation "=" of (substrings separated by "%253d" of (concatenation "," of (substrings separated by "%252c" of (following text of first "=" of (item 1 of it as string)))))) whose (item 1 of it starts with "Exit Code" and item 1 of it does not contain "3010") of ( name of item 0 of it, values of results (item 0 of it, item 1 of it) )  whose (item 1 of it contains "non_zero_exit_code=") of  (it, bes property "Client Settings") of bes computers )');   

for(var i = 0; i < compDataArr.length; i++) 
{ 

if (i%2 == 0) document.writeln(
'<tr id="odd">') 

else document.writeln(
'<tr id="even">'); var tempArray = compDataArr[i] .split(
','); document.writeln(
'<td>' + tempArray[0] + 
'</td>'); document.writeln(
'<td>' + tempArray[1].substring(tempArray[1].length - (tempArray[1].length -9)) + 
'</td>'); var actionNumber = tempArray[2].substring(tempArray[2].length - (tempArray[2].length -8)).replace(
" )",
""); document.writeln(
'<td>' + actionNumber + 
'</td>'); document.writeln(
'<td>' + EvaluateRelevance(
'if ( exists bes action whose (id of it = ' + actionNumber + 
')) then ((name of it & "</td><td>" & time issued of it as string) of bes action whose (id of it = ' + actionNumber + 
')) else "Unknown"') + 
'</td>'); document.writeln(
'</tr>'); 
}   function CreateExcelSheet() 
{ var x=myTable.rows   var xls = 

new ActiveXObject(
"Excel.Application") xls.visible = 

true xls.Workbooks.Add 

for (i = 0; i < x.length; i++) 
{ var y = x[i].cells   

for (j = 0; j < y.length; j++) 
{ xls.Cells( i+1, j+1).Value = y[j].innerText 
} 
} 
}   </script>

Thanks for taking a look at it