/build/static/layout/Breadcrumb_cap_w.png

Script auditing: I want to find out which K1000 scripts are no longer being used

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

Answers (1)

Posted by: chucksteel 7 years ago
Red Belt
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.


Comments:
  • Thanks but I'm not a SQL/database guy. Where do I run this query at? - kcorrie 7 years ago
    • 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. - chucksteel 7 years ago
      • this worked out great, I just started as an IT intern on friday and just started working with the KACE box - JimmySparrow 7 years ago
      • Welcome to the community! - chucksteel 7 years ago
  • Did the trick for me, thank you! - dragonfligh 6 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ