Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To set up a Telegram group for a major incident, do the following:

On the Administrator's computer

  1. Set up a MID account and a MID agent with a hash IP and ID. Read the article Infrastructure Agent to learn more.
  2. Download Simple MID Server.
  3. Create three scripts in Python and place them inside the folder downloaded in Step 2:
    • createGroup – to create a group,
    • cancelGroup – to restrict commenting upon the completing of the incident and changing its state to Completed.
    • deleteGroup – to delete a Telegram group.


  4. Run the first script "createGroup" manually. The system will require the user's authorization, do it.
  5. A "Router Session On" file is created.

On the SimpleOne instance

  1. Go to the your instance, go to the System Properties (sys_property) table, set the value true for the itsm.telegram.swarming property.
  2. Create a new server in the MID Server (MID_server) table.
  3. Create a script to create a group in Telegram in the MID Scripts (MID_script) table. To do so, click :
    • Click New and in the new
    script form add
    • Script Form.
    • Add a name of the script (for example, createTelegram)
    and in the Script field add
    • .
    • Add the path to the script on your computer
    , created at the Step 3
    • in the Script field.

  4. Repeat the Step 8 previous step to add the scripts to close and delete a group.
  5. Go to System Properties (sys_property) table and add the IDs of the three created scripts to the corresponding properties as their values.
  6. Go to a major incident form. Now there appears a Start Swarming buttonClick it for the first time, and a record with a corresponding name appears in the MID Queue (sys_mid_queue) table. 

    Field
    The Request filed contains a Bot User ID
    Description
    RequestBotUserId, the incident name and the first message content that is sent to the Swarming Session participants
    .
    The Server filed is filled with the server name, for example,
    ServerTgBotMIDServer.
    ScriptThe
    Script filed contains the
    name of the executed script
    .
    The
    Response
    filed contains a
    A chat ID created and a lint to the group. The chat ID is stored in the Telegram Chat Bindings with Incident table.
    StateDone when executed
    Processed atDate and time of the execution


  7. A closeGroup record in the MID Queue (sys_mid_queue) table appears when the incident state is changed to Done. Commenting in the group is unavailable, but the participants can read the messages.

    FieldDescription
    The
    Request
    filed contains a chatId parameter
    The Server filed is filled with the server name, for example,

    ServerTgBotMIDServer.
    ScriptThe
    Script filed contains the
    name of the executed script
    .
    The Response field is empty.
    ResponseNo response
    StateDone when executed
    Processed atDate and time of the execution


  8. A deleteGroup record in the MID Queue (sys_mid_queue) table is executed automatically after a set time period in the corresponding Server Script. When the deleteGroup record is in the state Done, the telegram group is deleted.

    The Request filed contains a


    FieldDescription
    Request

    A chatId parameter

    The Server filed is filled with the server name, for example,
    ServerTgBotMIDServer.
    ScriptThe
    Script filed contains the
    name of the executed script
    .
    The Response field is empty.
    ResponseNo responce
    StateDone when executed
    Processed atDate and time of the execution