We have over 400 scripts in our K1000, and I would like to be able to run an audit of some sort to determine which scripts are no longer being used so I can remove them.  I found in Settings > History > Reporting > Objects than I can perform an advanced search for "Run Now" to get a list of scripts that have been run but I think the results only show those that were manually run, not scheduled.  Without having to open each script individually, how can I find out which scripts are also scheduled to run automatically?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1
I came up with this query:
SELECT KBOT.ID, KBOT.NAME, KBOT.MODIFIED, MAX(LOG.TIMESTAMP) as "Latest Start",
CONCAT_WS(" ", CRON.MINUTES, CRON.HOURS, CRON.DAYS_OF_MONTH, CRON.MONTHS, CRON.DAYS_OF_WEEK) as "Cron Schedule",
GROUP_CONCAT(MACHINE.NAME) as "Machines"
FROM KBOT
LEFT JOIN KBOT_LOG_LATEST LOG on LOG.KBOT_ID = KBOT.ID 
LEFT JOIN KBOT_CRON_SCHEDULE CRON on CRON.KBOT_ID = KBOT.ID
LEFT JOIN MACHINE on MACHINE.ID = LOG.MACHINE_ID
GROUP BY KBOT.ID
This should return the following information for every script:
ID
Name
Last Modified Date
Latest start time according to the KBOT_LOG_LATEST table
Cron Schedule (if there is one)
The machines the script has run on according to the KBOT_LOG_LATEST table.

Answered 08/10/2016 by: chucksteel
Red Belt

  • Thanks but I'm not a SQL/database guy. Where do I run this query at?
    • Reporting, Choose Action, New (SQL). Paste the query into the SQL box and fill out the other fields as necessary. After saving the report it will be available to run in the list of reports.
      • this worked out great, I just started as an IT intern on friday and just started working with the KACE box
      • Welcome to the community!
Please log in to comment
Answer this question or Comment on this question for clarity