Skip to content

Instantly share code, notes, and snippets.

@23Pstars
Last active October 5, 2021 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 23Pstars/50278fdbc8188f46408e7ce7bc1661c8 to your computer and use it in GitHub Desktop.
Save 23Pstars/50278fdbc8188f46408e7ce7bc1661c8 to your computer and use it in GitHub Desktop.
apache logs to telegram notifications
type=Single
ptype=RegExp
pattern=\[php7\:
desc=$0
action=shellcmd /path/to/dir/tg-send.sh "$0"
#!/bin/bash
sec -conf=/path/to/dir/php7err.conf -input=/path/to/apache2/error.log -detach
#!/bin/bash
CHAT_ID={{channel-id}}
TOKEN={{telegram-token}}
curl -s "https://api.telegram.org/bot$TOKEN/sendMessage?chat_id=$CHAT_ID" --data-urlencode "text=[domain.com] $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment