This commit is contained in:
Jeffrey Paul 2019-03-27 09:13:16 -07:00
parent 67fc2168c2
commit bfe590a2a6
1 changed files with 23 additions and 9 deletions

View File

@ -1,10 +1,25 @@
# send emails to root to slack
# prerequisites
## slack side
`apt update && apt -y install git python3 make postfix`
First you must go [here](https://api.slack.com/incoming-webhooks) and create
a new slack app and choose a channel and get a webhook URL.
# install
```
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
@ -13,10 +28,9 @@ git clone https://github.com/sneak/hacks.git /tmp/hacks && \
make install
```
and
## example usage
```
mkdir -p /etc/environment.d
echo 'https://hooks.slack.com/services/XXXXXX/XXXXXXX/xxxxxxxxxxxxxxxx' >
/etc/environment.d/SLACK_WEBHOOK_URL
```
`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.