ltg_push
Push log files' updates to Telegram
Use
- Install Rust
- Clone this
cargo build --release
- Write config
- Get chat ID
- Create bot
- Send any message to bot
ltg_push <custom path to config file> getChatID
- Put received chat id to config
ltg_push <custom path to config file>
Config
telegram:
bot: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 # bot token
chat_id: 123456789 # chat id (see Use.5)
files: # paths to watching files
- path: /var/some/log
match: "critical" # push updates only with this regex
- path: /var/awesome/other_log
Systemd service
- Copy
ltg_push.service
to/etc/systemd/system
systemctl daemon-reload
- Copy
ltg_push
to/usr/bin
- Copy config to
/etc/ltg_push.yml