Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 
hacks/forward-email-to-slack-webhook
John G G 32b86f0d54 Use python stdlib instead of requests (#1) pirms 5 gadiem
..
Makefile add email_to_webhook pirms 5 gadiem
README.md readme pirms 5 gadiem
email_to_webhook Use python stdlib instead of requests (#1) pirms 5 gadiem
install.sh multi arg command in .forward needs quotes pirms 5 gadiem

README.md

send emails to root to slack

slack side

First you must go here and create a new slack app and choose a channel and get a webhook URL.

mkdir -p /etc/environment.d
echo 'https://hooks.slack.com/services/XXXXXX/XXXXXXX/xxxxxxxxxxxxxxxx' >
    /etc/environment.d/SLACK_WEBHOOK_URL

prerequisites

export DEBIAN_FRONTEND=noninteractive
apt update
apt -y install git python3 make postfix daemontools

install helper

mkdir -p /etc/environment.d
git clone https://github.com/sneak/hacks.git /tmp/hacks && \
    cd /tmp/hacks/forward-email-to-slack-webhook && \
    make install

example usage

apt install -y smartmontools

Now you'll get a slack notification when your disk is going to die, because smartmontools emails root by default when it detects problems.