Running Veeam and snmptrapd / snmptt? Want Slack notifications from Veeam for jobs? This script does the following:
- For Jobs: Posts Success, Warning, or Failure messages to the configured Slack Channel
- For VMs: Posts Warning or Failure messages to the configured Slack Channel
- For any unknown messages or weird events, it'll post a generic message containing the pertinent info from the trap.
Traps work thusly (for Veeam / SNMPtrapd / SNMPtt):
- Veeam is configured in its settings to send traps to an IP/Port combination
- If a job is configured to send SNMP alerts, a trap will be sent for each VM completed, with the status and any relevant message
- Once an entire job completes, successfully or otherwise, if the Job is configured to send SNMP alerts, it sends a trap signifying the status
- Your SNMPtrapd handler will listen for and receive the trap, and perform some rudimentary processing, before handing it to
snmptt
- SNMPtt will do additional processing; translating values from MIBs, doing DNS lookups, logging the trap data, and taking any configured processing steps
- Per the included
veeam-snmptt.conf
, we define anEXEC
statement that gets executed for each defined event OID. - The
EXEC
statement fires the included ruby script, which mutates the trap values into Slack messages, and send them on to a webhook URL.
Obviously you need to have SNMPtrapd and SNMPtt running; and you need the slack-notifier
gem installed (gem install slack-notifier
)
Tested on Ruby 2.7, YMMV.
Contributions are welcome; but unfortuantely I can't offer support; you'll have to teach yourself enough to understand how to implement this and make it work.