Git Product home page Git Product logo

veeamdiscordnotifications's Introduction

Veeam Backup & Replication Notifications for Discord

VeeamDiscordNotifications has been replaced by VeeamNotify.

This repository is now archived.


Send Veeam Backup & Replication session summary notifications to Discord, detailing session result and statistics and optionally alerting you via mention when a job finishes in a warning or failed state.

Notification Example

Installing

  • Option 1 - Install script. This option will also optionally configure your any supported jobs to send Discord notifications.

    1. Download Installer.ps1.
    2. Open PowerShell (as Administrator) on your Veeam server.
    3. Run the following commands:
      PS> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
      PS> Unblock-File C:\path\to\Installer.ps1
      PS> C:\path\to\Installer.ps1
      Installer Example
  • Option 2 - Manual install

Looking for volunteers

If you enjoy this project and would like to help out, please do so. If you're interested in helping out, contact me on Discord - tigatack#7987

As much as I love this project, free time is hard to find and some work is needed to add functionality for more types of jobs, add more optional detail to outputs, and to bring this project in-line with recent changes in Veeam Backup & Replication (VBR) and VBR's PowerShell module.

Supported Job Types

  • VM Backup
  • VM Replication
  • Agent jobs managed by backup server

Agent job caveats

Due to limitations caused by the way some types of Veeam Agent jobs are executed, only Agent jobs of type "Managed by backup server" support post-job scripts.
Such jobs will show up as follows:

  • In Veeam Backup & Replication Console, with type "Windows/Linux Agent Backup".
    If you see "Windows/Linux Agent Policy", this job is not supported.
  • In Veeam Backup & Replication PowerShell module, with type "EpAgentBackup".
    If you see "EpAgentPolicy", this job is not supported.

You can read about the difference between these two Agent job types here.

Unfortunately, even Agent job sessions managed by the backup server, while supported, are limited in data output.
As much relevant information as I've been able to discover from such job sessions is included in the Discord embed, but I welcome any suggestions for improvement in this area.

Configuration options

Configuration can be found in C:\VeeamScripts\VeeamDiscordNotifications\config\conf.json

Name Type Required Default Description
webhook string True null Your Discord webhook URL.
thumbnail string False See example above Image URL for the thumbnail shown in the report embed.
userid string False null Your Discord user ID. Required if either of the following two options are true.
mention_on_fail boolean False False When true, you will be mentioned when a job finishes in a failed state. Requires that userid is set.
mention_on_warning boolean False False When true, you will be mentioned when a job finishes in a warning state. Requires that userid is set.
debug_log boolean False False When true, the script will log to a file in ./log/
notify_update boolean False True When true, the script will notify (but not mention) you on Discord if there's a newer version available.
self_update boolean False False When true, the script will update itself if there's a newer version available.

Credits

MelonSmasher//TheSageColleges for the project on which this is (now loosely) based.
dantho281 for various things - Assistance with silly little issues, the odd bugfix here and there, and the inspiration for and first works on the Updater.ps1 script.
Lee_Dailey for general pointers and the first revision of the ConvertTo-ByteUnit function.
philenst for the DeployVeeamConfiguration.ps1 script.
s0yun for the Installer.ps1 script.

Thank you all.

veeamdiscordnotifications's People

Contributors

philenst avatar s0yun avatar stefanelul2000 avatar tigattack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

veeamdiscordnotifications's Issues

Add option(s) for custom content.

Footer?
Description?
Header?
1+ custom fields in the body?
Use vars to build own content? e.g. customise header with "$jobName ", appearing as normal but with custom content appended.

[FEAT] Query on use of "mention_on_fail"

I see a mention in conf.json of "mention_on_fail" and "userid".

Can this be used, and if so using what syntax; particularly for userid? Can it suppor the use of mentioning more than one user?

Move notification process to own module.

Move the process of building and sending a message to a separate module to clean up the alert sender and update scripts. At least ~50 lines in each are being used up by building the embed.

  • Move embed process to own module.

  • Accept flags to configure each part of the module.

Generate HTML report with additional info.

Generate a HTML report with all backup info (example) and create a hyperlink in the footer, or similar, of the embed.

This will be useful in the case of failure as the report isn't capable of showing in-depth failure reasons without using a lot of space, or if someone just wanted to view more details of the job than provided in the embed.

Improve logging

  • Write-Output at each step.

  • Investigate logging options for PowerShell.

  • Implement logging for each step.

Add Time of Completion to notification

When many notifications are sent at once, Discord hides the time of messages.

As a user, I would like to be able to see the time at which my Job completed and possibly started, in order to give more context to the time taken metric.

DoD:
Add "Time Completed" to Discord Notification
Stretch:
Add "Time Started" to Discord notification

Improve duration field in backup report.

Improve duration field in backup report by reporting in in hh mm ss only if all values !=0, else omit anything =0.

Example 1: Time is 1h 30m 0s, report as 1h 30m.
Example 2: Time is 0h 17m 21s, report as 17m 21s.

Failure detection in the update script.

  • Detect failure of each step of the process.

  • Improve the way a failure is reverted. There are numerous issues with the current method.

  • Report failure reason(s) to Discord if unable to continue.

[BUG] Notifications aren't sent

Describe the bug
Discords notifications are not being sent by all backup jobs.

To Reproduce
Setup multiple jobs in Veeam and setup them to send notifications.

Expected behavior
Every job should send a notification.

Relevant part of log/debug.log
Don't have it right now, will post it a bit later.

RemoteDesktopManagerFree_9Ql4yxxE3A

This backup sends notifications without any issue.

RemoteDesktopManagerFree_Er5Z4ZssHb

This backup does not send any notification at all.

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.