Scheduled Scripts Report
Hi,
I am really not an expert with SQL Query and I have been searching around the web with no success. Even after contacting Dell support they told me that it was no in their policy to help me with this type of request. I'm looking for a way to be able to run a report that would pull specific script logs from the inventory and report them on a single page. Right now I have to run through all computers in the inventory to check if the script was successfully executed and you can imagine it's real pain in the ass.
I hope you guys can give me a hand with this,
Thank you,
Patrick
Answers (1)
Here's something that should get you pretty much what you need, once you tweak it.
Just change the 'ScriptName1|ScriptName2|ScriptName3|etc' part in the next-to-the-last line to use the names (or the unique parts of the names) of your scripts. For example, if you had the following scripts:
Temp Folder Cleanup
Wireless Profile Add
Adobe Reader Registry Fix
You could change this part to be something like this:
'cleanup|wireless|fix'
One other note about the text from the logs (Output, Status, Activity) - when I tested, the line breaks weren't being processed when run as a K1000 SQL report. These characters appear where each line break should be - <BR>
I tried working around this using a REPLACE statment, but it didn't work (probably because these characters don't appear in the output when run in MySQL Workbench - may be a bug in the version I'm using).
Anyways, enough with the details - here's the query you can start with:
select K.NAME as SCRIPT_NAME, KL.START_TIME as STARTED, KL.STOP_TIME as FINISHED, concat((KL.STOP_TIME - KL.START_TIME), ' seconds') as ELAPSED_TIME, KL.STATUS as STATUS, O.TEXT as OUTPUT_LOG, S.TEXT as STATUS_LOG, A.TEXT as ACTIVITY_LOG from KBOT K join KBOT_LOG KL on K.ID = KL.KBOT_ID join KBOT_LOG_DETAIL O on O.ID = KL.OUTPUT_DETAIL_ID join KBOT_LOG_DETAIL S on S.ID = KL.STATUS_DETAIL_ID join KBOT_LOG_DETAIL A on A.ID = KL.ACTIVITY_DETAIL_ID where K.TYPE = 'policy' and K.NAME rlike 'ScriptName1|ScriptName2|ScriptName3|etc' order by KL.START_TIME desc
Hope that helps!
John
Comments:
-
John you are awesome!!! This is exactly what I needed. Thank you very much for your help. - Ray085 10 years ago