Need to have a spread option on scheduled scripts

As we’re developing more involved scripts, we are starting to see the scripts failing to update the API, because of the 180 per IP per minute. We have some data collection scripts that are getting bit locker keys, etc. on a regular basis. We trigger an API to create a ticket at the onset of every script. If the script succeeds, the ticket is closed. if it fails, we record why it failed and change the ticket status. We need to have some sort of script distribution where it offsets the run time to allow the API to be called without triggering the limit.

Scripting wasn’t really designed to hammer the API by opening tickets for every script run in this fashion. What would be recommend here is only opening tickets on a failure state. This would also cause a massive amount of unneeded tickets in your instance, especially if you were running these scripts daily.

Is that a possibility for your use case?

Whether or not a ticket is created, these scripts are writing back to the asset through the API, either attaching log files, custom fields, etc… It could be done, and i guess i can re-write a function to handle this, but still, creating a ticket, creating a time entry, and changing status are 3 API calls, if we decide to attach a log file, modify a custom field, that’s 2 more per machine. Just running a script at a site with 50 agents, would pretty much eat up the API limit. having a mechanism that would say stagger scripts by x seconds would help minimize the issue altogether.

Could you put a random pause into your script before it does anything?

Something like:

$randPause = (get-random -Minimum 1 -Maximum 240)
start-sleep -Seconds $randPause

180 per minute is quite low.
It would be nice to have an option for partners to be able to purchase from SyncroMSP more API resources.

Like Jeremy suggested, we do this for large chocolatey app pushed to get around their rate limit. I don’t think I’ve hit the rate limit yet, but I have sites large enough it wouldn’t take much if the Syncro module is governed by the rate limit.