Closed jliebich closed 2 months ago
Hi,
I will not implement telegram or other message system (discord/teams/irc...) but we can add a custom command (in the config file) to use instead of the mail
command.
This way you can use the command you want.
Good for you ?
IMHO the best would be to just trigger a configurable user script to run in case of OOM in the RAM disk. Something like:
ONERROR_USERSCRIPT="/path/to/my-script"
Providing a couple of arguments to the script call, could also be useful:
SIZE
, LOG_DISK_SIZE
or other)PATH_DISK
) on which the issue occurred.Then everyone can write his own script to either: send an email, send a message on Telegram, Pushover, etc... This would also allow to option to integrate with more structured monitoring systems (e.g. Zabbix, etc...).
I like xtvdata's suggestion because it allows everyone (including me) to craft their own customized solution!
On the other hand, it might be already possible to send messages leveraging other standard tools...
E.g.:
If you check rsyslog documentation and find an output module that fits your need it's a matter of writing a line of configuration for rsyslog.
The advantage of having an ONERROR_USERSCRIPT
is that it would be easier to extrapolate details via arguments, however an error catch somewhere in log2ram with a standardized line in syslog (with a documented structure easy to parse), may achieve the same result (or even better - since it would be more standard and with less code to maintain for @azlux ).
Add custom command here : https://github.com/azlux/log2ram/commit/d368260763935a9bae5d3ad2f16d0e30e127375b
I use log2ram on different Raspberry Pi's.
The feature I miss, is a support for Telegram instead of E-Mail for the error system message if there is not enough place on RAM.
My proposal would be to make it similar as in this project: https://github.com/framps/raspiBackup
Proposal:
Add this options to the config file:
If these options are not empty, send the error system message if there is not enough place on RAM via Telegram.
If you do not know how to send Telegram messages via Bash script, you may refer to
function sendTelegramMessage()
in https://github.com/framps/raspiBackup/blob/master/raspiBackup.sh or https://thecodersblog.com/sending-the-message-on-telegram-using-cUrl/