Custom Automation For Asset Discovery

I’m trying to automate asset discovery scans so that it will run every third tuesday of the month but bigfix doesn’t have that configuration option. Once an asset discovery is successful and complete i want it to wait until next month’s third tuesday to run again. If it fails i want it to rescan until the sunday of that week. Any ideas for the best way to do this?

We should be able to achieve this with relevance. Check out @brolly33’s Relevance musing blog post on a similar subject for some more details and ideas, but perhaps something like the following might work (please note that I haven’t tested this):

(current date >= (first tuesday of current month_and_year) + (3 * week)) AND (current date <= (first tuesday of current month_and_year) + (3 * week + 5 * day))

The portion to the left of the AND should effectively ask if the current day is or is after the 3rd Tuesday of the month, and the portion to the right of the AND asks if the current day is or is before the following Sunday after the 3rd Tuesday of the current month.

1 Like

if this gets executed, it would be relevant the third Tuesday of the month until Sunday , so if the scan is successful on the third Tuesday of the month then it will still be relevant the next day until the sunday of that week. What i want it to do is once it is successful on the third Tuesday, i want it to wait until next month’s third tuesday to run again.

You can use the “Reapply while relevant, waiting 7 days between applications” option in the Take Action dialog to ensure it doesn’t execute again until the next scan window.

Or emulate the same in relevance by adding a clause
not exists (last active time of action) whose (now - it < 7 * day)

2 Likes

Hey jason,

If i use the relevance statement that you mentioned , then i will need to have set it to “whenever it becomes relevant again” correct?

It should work either way.

Under the hood, the ‘Reapply while relevant’ option actually works by embedding a very similar relevance in the action, causing it to become non-relevant for the specified time period.

Using the custom relevance allows more granular control of the time period.

You can also specify both ‘Reapply while relevant waiting X time between reapplication’ along with ‘Reapply whenever it becomes relevant again’.

Using the relevance on the fixlet itself does help to guard against another operator running the action and failing to set the reapply delay.

So you have several options there from which you can choose what works best for your environment.

do you know if “last active time of action” gives the date and time when the action starts or when it completes? Because i want to enable “Retry 4 times while waiting 1 day” in case it fails, but im wondering if "not exists (last active time of action) whose (now - it < 7 * day) " will prevent it from retrying in case it fails.