Skip to content

A script to send message to matrix, usefull for cronjobs, monitoring, Fail2ban, logwatch..

License

Notifications You must be signed in to change notification settings

Oxbian/matrix-sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Matrix Sender


This script allows you to send simple unencrypted message & html to matrix. It can be usefull for logging / cronjobs error or monitoring.

Install

This script is dependent of jq & curl.

To install the script, just clone this repo:

git clone https://git.arka.rocks/Oxbian/matrix-sender

And if you want you can add it to the PATH or link it to the /bin folder.

sudo ln -s $(pwd)/matrix-sender /bin/matrix-sender

Usage

First you need to edit the script with your homeserver url & the roomID

After this you need to get your token

matrix-sender -t <username> <password>

Once all is setup, you can send messages:

  • Simple message
matrix-sender -s {<room-id>} <message>
  • or an HTML formatted message
matrix-sender -html {<room-id>} <message>

For help you can use:

matrix-sender -h

or

matrix-sender --help

Example

matrix-sender -s 'Hello world!'
matrix-sender -html '<h1 class="test"> t e s t </h1>'

Contributing

If you want to contribute, make a pull request with your contribution.

License

This project is under the GPLv3 license, you can use it in your project but not in closed sources ones. Sharing project is what make the world live, think about it.

About

A script to send message to matrix, usefull for cronjobs, monitoring, Fail2ban, logwatch..

Topics

Resources

License

Stars

Watchers

Forks