We need servers at Online, but there is no availability! So they came to ask me if I didn’t have a magic solution…
A little bash
… a notify
in this case Slack
and here we go!
As usual sources are available.
Dirty way
*To be alerted via slack you have to create an incoming-webhook which will generate a link.
For an XC 2016 series server:
text="DISPO : https://www.online.net/fr/serveur-dedie/dedibox-xc"; json="{\"channel\": \"#infra\", \"text\": \"$text\"}" ; while true ; do curl --silent https://www.online.net/fr/serveur-dedie | grep '<button class="btn btn--primary js-order-dedibox"' | grep -i 'xc 2016' | grep -i 'victime' || curl -s -d "payload=$json" "https://hooks.slack.com/services/XXX/XXXX/XXXX/XXXX" ; sleep 5 ; done
Curl will be done only if one server is available.
Clean way
Just code formating :
|
|
You can also push the vice further by filtering on the region and the disc types.
Pig mode
Because… why not ?
|
|
Next step, simulate an order ?