Code Monkey home page Code Monkey logo

zabbix-discord's Introduction

Zabbix-Discord Alertscript

This script allows you to post status updates from Zabbix to a webhook.

Installation

  1. Get and Install Discord.sh
  2. Clone this repository in your alertscript folder.
  3. Edit zabbix-discord.sh and fill out those variables: -- discordsh_path = the full path to the discord.sh script -- webhook_url = the webhook url for the channel to post into -- monitor_url = the url to a monitor website like statuspage or cachet. You can also fill in a link to your website.
  4. Setup a new media type in Zabbix 4.1 Name: Whatever you want 4.2 Type: Script 4.3 Script name: zabbix_discord.sh 4.4 Script parameters: 4.4.1 {ALERT.MESSAGE} 4.4.2 {ALERT.SUBJECT}
  5. Add a new Action in Zabbix. Now this is important, to be able to give the script enough parameters, the message needs to be a json string. Here a few examples:

Operations

Subject: Problem: {EVENT.NAME}

Message: {"msg":"Problem started at {EVENT.TIME} on {EVENT.DATE}\nProblem name: {EVENT.NAME}\nHost: {HOST.NAME}\nSeverity: {EVENT.SEVERITY}\n\nOriginal problem ID: {EVENT.ID}\n{TRIGGER.URL}","ack":"{EVENT.ACK.STATUS}","sev":{TRIGGER.NSEVERITY},"status":"{TRIGGER.STATUS}"}

Recovery operations

Subject: Resolved: {EVENT.NAME}

Message: {"msg":"Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}\nProblem name: {EVENT.NAME}\nHost: {HOST.NAME}\nSeverity: {EVENT.SEVERITY}\n\nOriginal problem ID: {EVENT.ID}\n{TRIGGER.URL}","ack":"{EVENT.ACK.STATUS}","sev":{TRIGGER.NSEVERITY},"status":"{TRIGGER.STATUS}"}

Update operations

Subject: Updated problem: {EVENT.NAME}

Message: {"msg":"{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.\n{EVENT.UPDATE.MESSAGE}\n\nCurrent problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.","ack":"{EVENT.ACK.STATUS}","sev":{TRIGGER.NSEVERITY},"status":"{TRIGGER.STATUS}"}

Additional informations

This script is licenced under GNU General Public License v3.0

About us:

Website: https://www.Aperture-Development.de Discord: https://discordapp.com/invite/JpDPa6w

zabbix-discord's People

Contributors

aperturedevelopment avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.