@if(post) {
{{ t('Telegram') }} {{ t('Configuration') }}
{{ t('Telegram bot token') }}
{{ t('If this option is activated, this openITCOCKPIT instance must be accessible via the Internet.') }}
{{ t('By using the two-way webhook integration, interactions in Telegram are sent directly to this openITCOCKPIT instance. Otherwise these can only be queried every minute. Please read the documentation to make this setup successful.') }}
@if(post.two_way) {
{{ t('Enter the externally accessible domain name of this openITCOCKPIT instance.') }}
{{ t('The webhook will be automatically set up for the bot based on the given bot token.') }}
{{ t('API Key used by Telegram for authentication against openITCOCKPIT.') }}
}
{{ t('Determine if the ') }} {{ t('configured proxy') }} {{ t(' should be used.') }} {{ t('Determine if the configured proxy should be used.') }}
}
@if(contacts.length > 0) {
{{ t('Authentication codes for Telegram notification contacts') }}
{{ t('Generate authentication codes for openITCOCKPIT Contacts to use them to authenticate yourself in the Telegram chat using the connected Telegram bot.') }}
{{ t('As soon as a chat has been authenticated, the key can be deleted to prevent misuse.') }}
@for (contact of contacts; track contact.uuid) {
{{ contact.name }}
@if (!isContactAccessKeyGenerated(contact.uuid)) { } @if (isContactAccessKeyGenerated(contact.uuid)) { {{ isContactAccessKeyGenerated(contact.uuid) }} }
}
} @if (chats.length > 0) {
{{ t('Registered Telegram chats') }}
@for (chat of chats; track chat) {
{{ t('Contact') }}: {{ getContactForUuid(chat.contact_uuid)?.name }} {{ getContactForUuid(chat.contact_uuid)?.name }}  | {{ t('Telegram user') }}: {{ chat.started_from_username }}
}
}

{{ t('Telegram module - HowTo') }}

{{ t('Configuration') }}

  • {{ t('Open') }} BotFather {{ t('in Telegram.') }}
  • {{ t('Run') }} /newbot
    • {{ t('define e.g. openITCOCKPIT as name') }}
    • {{ t('define e.g. oitcTGBot as username (use a custom unique username for your bot)') }}
  • {{ t('Your new bot is now located at') }} t.me/oitcTGBot.
  • {{ t('Copy the HTTP API token which was generated by the BotFather.') }}
  • {{ t('Keep your token secure and store it safely, it can be used by anyone to control your bot!') }}
  • {{ t('Open the openITCOCKPIT Telegram configuration, enter the copied bot token and save the configuration.') }}
  • {{ t("Add the 'host-notify-by-telegram' and 'service-notify-by-telegram' commands to your notification contact.") }}
  • {{ t("To apply the changed notification contact (with the Telegram notification commands), run an export in openITCOCKPIT.") }}
{{ t('If your openITCOCKPIT is reachable from the Internet:') }}

  • {{ t('Open the openITCOCKPIT Telegram configuration and check the optional field "Enable two-way webhook integration".') }}
  • {{ t('Make sure the configured "External webhook domain" is correct and openITCOCKPIT is reachable from the Internet using this domain.') }}
  • {{ t('Create a new openITCOCKPIT API Key for your user and insert it into the "Webhook api key" field.') }}
  • {{ t('Save the changes and try it out.') }}
    {{ t('openITCOCKPIT automatically set up the webhook for the bot with the given token.') }}
    {{ t('This connection can be removed by saving with an unchecked "Enable two-way webhook integration" field.') }}

{{ t('Usage') }}

  • {{ t('Notifications sent by the openITCOCKPIT Telegram Module can be received by any chat with a real telegram user or by channels.') }}
  • {{ t('A Telegram chat gets only the notifications for a defined openITCOCKPIT contact. (identified by custom authentication codes)') }}
  • {{ t('To start the interaction, search the bot username in the Telegram global search field and start a chat with your bot.') }}
  • {{ t('After starting the chat you need to authorize yourself with an authentication code for a openITCOCKPIT Contact, that can be manually generated in the openITCOCKPIT Telegram configuration for Contacts containing a Telegram notification command. (type') }} /auth xxx {{ t('in the chat with your key as xxx)') }}
  • {{ t('If the authorization was successful, use the bot control command') }} /start {{ t('to enable openITCOCKPIT notifications. Otherwise you will not receive any notifications.') }}
  • {{ t('With enabled two-way integration issues can be acknowledged by simply clicking the button for an action provided by the bot message.') }}
  • {{ t('If your openITCOCKPIT is reachable from the Internet and you configured the two-way webhook integration, interactions with the bot are processed within seconds.') }}
  • {{ t('If your openITCOCKPIT is not reachable from the Internet, the built-in basic one-way integration calls up interactions cached by Telegram and processes them every minute. (Therefore, interactions with the bot can take up to a minute to process!)') }}
  • {{ t('Run') }} /help {{ t('in bot chat to get more information about how to control the bot.') }}

{{ t('Troubleshooting') }}

  • {{ t("If you aren't using the two-way integration or switching from two-way to one-way, it could happen that the cronjob is not going to be executed by openITCOCKPIT.") }}
    • {{ t('That problem should be solved after running it once manually:') }} oitc cronjobs -f -t TelegramProcessUpdates
    • {{ t('Note that the cron job is not needed if you use a two-way setup of this plugin') }}