Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgin committed May 29, 2018
1 parent d5a735f commit a20e394
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
Sendgrid Zabbix Alert
=====================
Work in progress, basically an alertscript called by Zabbix server
that uses sendgrid to send a message
Evolving work in progress,

Alertscript called by Zabbix server that uses the Sendgrid API to send a message

Check for errors, can log debug information, sending failure information back to zabbix to be implemented next.

Requirements:
-------------

### Software

* curl
* zabbix server
* zabbix_server
* bash
* zabbix_sender ( to report errors )

### Sendgrid API key

* https://sendgrid.com/

### Configuration file

Configuration is sourced from /etc/zabbix/sendgrid_zabbix_alert.conf
to set MAILFROMADDR, MAILFROMNAME and SENDGRID_API_KEY. See
sendgrid_zabbix_alert.conf.example for more information
The configuration is sourced from `$HOME/.sendgrid_zabbix_alert.conf`
or `/etc/zabbix/sendgrid_zabbix_alert.conf` to set MAILFROMADDR,
MAILFROMNAME and SENDGRID_API_KEY. See `sendgrid_zabbix_alert.conf.example`
for more information. It is also possible to set these values in the configuration
file for testing.

### Zabbix configuration

Normally alert scripts are here /usr/lib/zabbix/alertscripts
AlertScriptsPath can be set to a location for custom alert scripts
in zabbix_server.conf
`AlertScriptsPath` can be set to a location for custom alert scripts
in `zabbix_server.conf`

The script need to be installed and have permissions set so that Zabbix is able to execute it.

Check the Zabbix documentions for Custom alert scripts.
Check the Zabbix documention for Custom alert scripts.

When calling the alertscript, Zabbix sets the following parameters
```
MAILTO=$1
MAILSUBJECT=$2
MAILBODY=$3
```

Parameters can be customized. (See custom alert scripts)

Expand All @@ -37,9 +52,10 @@ Parameters can be customized. (See custom alert scripts)
Assuming default settings:

Set variables in
/etc/zabbix/sendgrid_zabbix_alert.conf
`/etc/zabbix/sendgrid_zabbix_alert.conf`

Copy `sendgrid_zabbix_alert.sh` to `/usr/lib/zabbix/alertscripts`

Copy sendgrid_zabbix_alert.sh to /usr/lib/zabbix/alertscripts
There is also a short script that will help see what zabbix is sending.

There is also a file to help debug your alert parameters
test_zabbix_alert.sh
`test_zabbix_alert.sh`

0 comments on commit a20e394

Please sign in to comment.