Slackomatic – Send Slack messages from the command line!

Phew, it’s been quite a while since I updated this thing! I’ll get back into throwing stuff up here pretty regularly (maybe!).

I’ve been working on a script which you can find at my github repo here: https://github.com/danteali/Slackomatic

It is a pretty comprehensive tool for sending messages to Slack using their API – pretty much every API option has been implemented.

You’ll first need to register a Slack webhook from here: https://my.slack.com/services/new/incoming-webhook

Then simply need to grab a copy and stick it on your linux machine then make it executable…

[I haven’t tested this but it might also work in Windows now that you can install Ubuntu in Windows 10 – after all it is just a bash script and has no real dependencies]

Run the script without any command line arguments to get usage instructions. At a minimum you have to pass a username (-u) and some text (-t) to display. And also the Webhook you just registered (-w) but I would recommend editing the script and setting the WEBHOOK variable at the very top of the script.

You can now send messages directly from the command line or incorporate into any scripts etc that you want to receive notifications from. I use it to let me know about completed downloads, backups finished, server reboots, etc.

Usage instructions are here for info…

 

Leave a Reply

(email optional)