Unusual implementation: TicketDuty

unusual

(Eric Sigler) #1

Every year, I try to make it to PAX West. And every year, the tickets sell out in a matter of minutes. So for the past few years, a couple of us in PagerDuty have set up a service and escalation policy to get notified whenever there are changes to the website. Here’s this year’s script, which has been set up on cron to run once a minute (cleaned up a touch for posting):

#!/bin/bash
curl -s http://west.paxsite.com | grep "PAX West 2017 Registration is not yet open" 2>&1 > /dev/null

if [[ $? != 0 ]]
then
  curl -H "Content-Type: application/json" \
   -X POST \
   -d '{"service_key": "DONT_PUBLISH_YOUR_SERVICE_KEYS","event_type": "trigger","description": "PAX West Website Has Changed","details": {},"client": "PAX Site","client_url": "http://west.paxsite.com","contexts":[]}' \
   https://events.pagerduty.com/generic/2010-04-15/create_event.json
fi

It could be better (additional retries / backoff if the site is down, for example), but gets the job done.


(Ryan Hoskin) #2

That’s fantastic Eric!


#3

Thanks for sharing! I’m going to take this and use it to monitor at least one vendor site. :grin: