[GUIDE] Use Telegram as notification service.

    • Official Post

    Using Telegram as a notification service

    What you need

    - OpenMediaVault 3.x (Latest version)
    - Remote ssh access
    - curl (apt-get install curl)

    Since version 3.0.5 openmediavault implemented the execution of scripts any time postfix processes a notification email that is generated by any system services sending five specific environment variables, not arguments. For this to work is compulsory that you configure an email notification account in the relevant section of OpenMediaVault.
    Note: Emails will still be send, there is no workaround in the moment, postfix needs to be configured. If you have a gmail account you can send it to a username alias so that later on you can create a filter rule in the gmail panel (ex: jon.snow+omv@gmail.com).

    In the case of using Telegram for a notification service you need to create a bot.


    Those familiar with telegram bots know that you need to create them chatting with the botfather to get the api token

    Once you get your token you need to get a chatid. Chatid's are generated once you establish a direct conversation with the bot. So in the application start talking with the bot and send any text as command. Like "/talk"

    On any terminal with curl installed you can run

    curl 'https://api.telegram.org/botREPLACETOKENHERE/getUpdates?offset=0'

    The output will look something like this


    The value for key "id" is the one we need to use (112632459)

    We create our script

    nano /usr/share/openmediavault/notification/sink.d/20telegram

    We paste this contents

    Save it and change it to executable

    chmod +x /usr/share/openmediavault/notification/sink.d/20telegram

    you can now run the test send mail in notification section of the web control panel

    Questions / Problems / Discussions

    Use Telegram as notification service Q&A

Participate now!

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