Содержание

Script for users notification about the measurement status

The Bot sends notifications about measurement errors by e-mail and/or telegram channel. Information about errors is extracted from the measurement protocol. Moreover, users can send any messages from measurement scripts using the following code:

from bot import messangers
messangers.send_message("<message text>")

Structure

The Bot consists of the three modules and configuration file.

Modules

The package consists form the following modules:

Configuration file

configuration file in json format:

  1. mail - e-mail configuration:
    1. user - user for e-mail authentication;
    2. password - password for e-mail authentication;
    3. port - e-mail server port;
    4. server - e-mail server ip or domain name;
    5. recipients - e-mail recipients list.
  2. telegram - telegram configuration:
    1. bot-id - the id of the bot sending messages;
    2. channel-id - the id of the channel for sending messages.

Configuration file example:

  1. {
  2. "mail": {
  3. "user": "sonix-bot",
  4. "password": "your_password",
  5. "port": 25,
  6. "server": "smtp.nf.jinr.ru",
  7. "recipients": [
  8. "somebody@mail_address",
  9. "another_if_neccessary@mail_addres"
  10. ]
  11. },
  12. "telegram": {
  13. "bot-id": "your_telegram_bot_id",
  14. "channel-id": "telegram channel_id"
  15. }
  16. }

Bot installation on instrument

Bot installation on instruments consists of the following steps: