Bot for the telegram that sends new messages from sshd/auth.log.
-
Build
gradle build
. -
There are two archives in the build/distributions/ folder, unarchive one of them.
-
Start bot
./bin/LogNotifierBot
. A file ~/.LogNotifyerBot/properties.xml will be created, edit it. In order to obtain token, write to the Bot Father, https://telegram.me/botfather. -
Run bot again and write smth to him in the Telegram. If he answers "access denied", you are not in the super users list (see properties.xml), else all OK.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<properties>
<bot>
<name>Auth Log Notifyer</name>
<token>BOT_TOKEN</token>
<messages>
<hello>The bot is started.</hello>
<accessdenied>Access denied.</accessdenied>
<accept>You're added to list.</accept>
<cancel>You're already in list.</cancel>
</messages>
</bot>
<superusers>
<username>YOUR_USERNAME</username>
</superusers>
<logs>
<logfile>
<parser>AuthLog</parser>
<filename>/var/log/auth.log</filename>
<processfilters>
<name>sshd</name>
</processfilters>
</logfile>
</logs>
</properties>