OVAL Scan Smart Labels
The first query looks for all machines that have not had a successful scan in the past month, and the second query looks for all machines that have never had a successful scan. I created a Smart Label for each query and then use both Smart Labels in my OVAL schedule. I can then set my OVAL scan schedule to be some short period, like once every five hours, but it will only scan those computers that have not already had a successful scan in the past month. This could be further improved by excluding any computer that cannot have an OVAL scan performed, but in our case that would not exclude too many computers so I'm not worried enough about it to try to improve it in that way.
*****First Query*****************************************************************************
SELECT DISTINCT
MACHINE.*
FROM
KBOT,
KBOT_LOG,
MACHINE
WHERE
KBOT.ID = KBOT_LOG.KBOT_ID
AND MACHINE.ID = KBOT_LOG.MACHINE_ID
AND KBOT.NAME = 'OVAL Test Runner'
AND KBOT_LOG.STATUS = '1'
GROUP BY MACHINE.ID
HAVING MAX(KBOT_LOG.START_TIME) < DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
*****Second Query*****************************************************************************
SELECT
*
FROM
MACHINE
WHERE
(MACHINE.ID NOT IN (SELECT
MACHINE.ID
FROM
KBOT,
KBOT_LOG,
MACHINE
WHERE
KBOT.ID = KBOT_LOG.KBOT_ID
AND MACHINE.ID = KBOT_LOG.MACHINE_ID
AND KBOT.NAME = 'OVAL Test Runner'
AND KBOT_LOG.STATUS = '1'))
<a href="http://www.wikipedia.com">wikipedia</a> - sethgodfrey 9 years ago