Using Nagios or Icinga to get a Playstation 5
Okay, so maybe this is silly, but before a friend of mine pointed out Hotstock to me, I decided to use Selenium to track stock of Playstation 5s as it's so hard to get one. I wasn't enough of a jerk to try to make a bot to buy one, but I at least wanted to know so I could jump in. Currently, when they release I'm watching to see whether my plugin or Hotstock light up my phone first.
My home server runs a Nagios-compatible monitoring system called Icinga, and I have the free tier of OpsGenie set up to page my phone. I currently have this spawning every 3 minutes. It checks Amazon, BestBuy, Gamestop, Playstation Direct, Target and Walmart concurrently.
What it's found so far is interesting. It has caught actual restocks on BestBuy, Gamestop and Playstation Direct so far, all 3 of which I failed at actually buying one, but was notified in time to wait in line. Sometimes Hotstock beats it to the punch, but mine has been catching random ones in the wild; mainly, scalpers on Amazon. I've passed on sales without the disk drive, used units and various items over $500.
Some headaches along the way have been interesting. Captchas appearing at 1am aren't great. I have some buyers remorse about my Honeycomb LX2K. I compiled geckodriver for ARM64, had Icinga start spawning my check in a Docker container, and about once a day it would crash my server with an overheating message when my temperature graphs show no spikes. I was able to dig out the old AMD 5350 I had laying around, repurpose it only for this, and it has been rock hard stable. Not sure if it's issues with geckodriver on ARM or another quirk with this board.
The Grafana dashboard at the head of this article is pulling Icinga data about the host and the alert history. Firefox threads seem to be terminating just fine and the server is in good overall health despite getting blasted on all 4 cores every 3 minutes.
I still don't have a Playstation 5. Maybe automating the search for one is more fun.
The source code is available at https://github.com/blakehartshorn/get_ps5