This is a FRAMEWORK only. Customize this to your own needs but I get this question a lot so I thought it may prove helpful as a basis for writing your own report.
This is to find the mahcines that were targeted by a script on its last run.
First get you script KBOT ID.
DO this by click on the name of your script and reading the number at the end of the string like below.
This script has an ID of 14 so thats the KBOT ID we will target with our SQL code.
From our report editor we start a new SQL report and use the following code.
*************SQL*******************
SELECT
KBOT.ID AS SCRIPT_ID,
KBOT.NAME AS SCRIPT_NAME,
KBOT.DESCRIPTION,
MACHINE.NAME AS COMPUTER_NAME
FROM KBOT, KBOT_LOG, KBOT_LOG_DETAIL, MACHINE
WHERE KBOT.ID = KBOT_LOG.KBOT_ID
AND KBOT_LOG.OUTPUT_DETAIL_ID = KBOT_LOG_DETAIL.ID
AND KBOT_LOG.MACHINE_ID = MACHINE.ID
AND KBOT.ID = 14
ORDER BY KBOT_LOG.START_TIME DESC
LIMIT 1
**************************************
Several things you can change depending on your needs.
Play around with it but to target different scripts change KOBOT_ID = 14 to your script ID. To see more than the last results remove or change the LIMIT 1 statement.
Comments