Background: I’m putting together a demo for PagerDuty to show off how easy CORS makes our configuration API, so I threw together a quick script and originally just set it to sleep a minute and loop.
IronWorker is probably a better solution though, since I really want this to run quietly in the background forever. It was impressively easy to get started, even after I skipped out of the walkthrough.
- gem install iron_worker_ng
- create “trigger_pd.worker”
- iron_worker upload trigger_pd
- Schedule the task to run every minute through the UI1
And bam! my script runs happily every minute. It does some quick heuristics to figure out the probability of my imaginary service triggering an incident and randomly triggers an incident or doesn’t. You can click here to see the results.