蛛形纲动物的cabot电报警报插件
cabot_alert_telegram的Python项目详细描述
基于:https://github.com/lblasc/cabot-alert-slack
这是cabot服务监视工具的警报插件。它允许您使用Telegram聊天室提醒用户。
安装
进入Cabot虚拟环境:
$ pip install cabot_alert_telegram $ foreman stop
或:
$ pip install git+git://github.com/codesyntax/cabot_alert_telegram.git $ foreman stop
编辑conf/*.env:
CABOT_PLUGINS_ENABLED=cabot_alert_telegram=0.4 ... TELEGRAM_BOT_TOKEN=bot_token TELEGRAM_CHAT_ID=id of the chat where messages will be sent
将cabot_alert_电报添加到设置中已安装的应用程序。py:
$ foreman run python manage.py syncdb $ foreman start
手动添加警报插件的实例(有时不会自动添加):
$ ssh ubuntu@server $ source venv/bin/activate $ cd cabot $ foreman run -e conf/production.env python manage.py shell # point to the correct production.env file Python 2.7.3 (default, Dec 18 2014, 19:10:20) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from cabot_alert_telegram.models import TelegramAlert >>> ta = TelegramAlert() >>> ta.title = u'Telegram' >>> ta.save() >>> (Ctrl-D to exit)
电报机器人
您需要创建一个用于向用户发送消息的telegram bot。要创建一个新的电报机器人,请查看https://core.telegram.org/bots
你需要创建一个新的群组聊天,将所有用户添加到聊天室,并在那里添加机器人。
若要获取聊天ID,请打开https://telegram.me,然后选择先前创建的群聊天。检查url,它将如下:
https://web.telegram.org/#/im?p=g99999999
不需要p参数(g9999999)的值,并用-交换g:-9999999
这有点老套,但我不知道其他任何方法来获取组ID。
0.6(2018-05-29)
- 包括迁移[ex0ns]
0.5(2016-11-07)
- 更简单的警报消息[garaolaza]
0.4(2016-01-21)
- 重新编写自述文件[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 删除不需要的松弛测试[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 添加空白使链接可以正确单击[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 文档电报安装[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 机器人文档[Mikel Larreategi<;mlarreategi@codesyntax.com>;]
- 删除[mikel larreategi<;mlarreategi@codesyntax.com>;]
0.3(2015-07-02)
- 凹凸[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 警报文本更改[mikel larreategi<;mlarreategi@codesyntax.com>;]
0.2(2015-07-02)
- 记录机器人[Mikel Larreategi<;mlarreategi@codesyntax.com>;]
- 重新格式化消息[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 重新格式化[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 文档[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 合并远程跟踪分支“origin/master”[mikel larreategi<;mlarreategi@codesyntax.com>;]
- 更新readme.md[aitzol<;anaberan@codesyntax.com>;]
0.1(2015-07-02)
- 历史![Mikel Larreategi<;mlarreategi@codesyntax.com>;]
- 版本[mikel larreategi<;mlarreategi@codesyntax.com>;]