Third party notification not working (discord)

  • I've setup mail notification correctly and i receive mails and i've read the documentation about third party notification.

    I've used this script that i've put in /usr/share/openmediavault/notification/sink.d/20discord


    script:


    When i hit the test button i receive the notification correctly both on discord and on email while the other daily notifications only arrive via email.


    Nothing strange in the logs that I attach anyway

    I had installed the flashmemory plugin but I uninstalled it


    journalctl -u postfix@-.service


    omv-salt deploy run postfix



    DL20 gen10 xeon e-2124, openmediavault 7.x baremetal

  • macom

    Approved the thread.
  • If i remove this line everything works but in this way i don't have the details of the notification.

    Someone have some advice?

    "description": "$(cat ${OMV_NOTIFICATION_MESSAGE_FILE})",

    DL20 gen10 xeon e-2124, openmediavault 7.x baremetal

  • bikeb

    Added the Label resolved
  • bikeb

    Added the Label OMV 7.x
  • Solved.

    If you want to show the output of a file or stdin in bash, and your file includes special characters such as backticks (`) and ", then you can't simply cat filename. You will need to properly escape special characters.

    One of the easiest methods to output properly escaped text from a file is to use jq, cut, and rev

    Prerequisites

    • jq - Character escaping
    • cut - Cut characters from string (part of coreutils, included by default on most systems)
    • rev - Reversing of characters (part of util-linux, included by default on most systems)

    Usage (contents of file)

    1. Simply pass filename to the following command to escape the file contents to stdout:
    Code
    jq -Rs . <filename | cut -c 2- | rev | cut -c 2- | rev


    So the working bash script to put in /usr/share/openmediavault/notification/sink.d/20discord is here:


    DL20 gen10 xeon e-2124, openmediavault 7.x baremetal

  • bikeb

    Changed the title of the thread from “Third party notification not working” to “Third party notification not working (discord)”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!