24 September, 2025
0 Comments
2 categories
Email Alerts
- Menu: Alert > Media types
- Configure email settings: Type -> Email, Provider -> Generic smtp
- Test email
- Menu: Alerts > Actions > Trigger actions
- Enable Report problems to Zabbix administrators
- Menu: Users > Users
- Select Admin
- Tab: Media
- Button: Add
- Type: <mail profile from step 2>
- Choose: Use if severity
- Save, update, close, … etc
On the host i have to choose for specific items triggers with the severity i choose in step 11
Telegram
Configure telegram
- Install telegram
- Search for bot father
- Start chat and type /newbot
- Add name and username (username ends with _bot)
- Copy API id
- Open file scripts for zabbix (see below) and paste Bot API token
- Create a telegram group and add the bot to the group
- Find the group chat ID (https://neliosoftware.com/content/help/how-do-i-get-the-channel-id-in-telegram/)
- Paste it to the scipt (see below)
Telegram scipt for zabbix
#!/bin/bash
# Telegram Bot API Token and Chat ID
BOT_TOKEN="Bot API token"
CHAT_ID="Chat ID"
# Message from Zabbix
MESSAGE=$1
# Send message via Telegram API
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-d chat_id="${CHAT_ID}" \
-d text="${MESSAGE}" \
-d parse_mode="Markdown"
Add telegram script to Zabbix
- SSH to the Server (zabbix server)
- Create a new file to the following location: pico /usr/lib/zabbix/alertscripts/tele.sh
- Paste the above script to the created file
- Make the script executable
Configure Zabbix
- Log on to the zabbix
- Menu: Alerts > Media Types >Create Media Type
- Add Name: Chris Telegram
- Media type: Script
- Script name: tele.sh (the above script name)
- Scipt parameters: {ALERT.MESSAGE}
- Go to message templates
- Add Problem:
- Problem started at {EVENT.TIME} on {EVENT.DATE}
- Problem name: {EVENT.NAME}
- Host: {HOST.NAME}
- Severity: {EVENT.SEVERITY}
- Operational data: {EVENT.OPDATA}
- Original problem ID: {EVENT.ID}
- {TRIGGER.URL}
- Add Problem Recovery:
- Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
- Problem name: {EVENT.NAME}
- Problem duration: {EVENT.DURATION}
- Host: {HOST.NAME}
- Severity: {EVENT.SEVERITY}
- Original problem ID: {EVENT.ID}
- {TRIGGER.URL}
- Save Media Type and test it
Assign Media type to User
- Menu: Users > User
- Media > Add
- Media type: Chris Telegram
- On the Send to, add the Telegram goup id you created
- Select the severity you like
- Save and close
- Go to menu: User settings > Profile
- Click on Frontend Notifications
- Enable: Frontend notification
- Click Update
Add trigger
- Add a trigger to the host
- Menu Actions > Trigger actions
- Click on: Report problems to Zabbix administrators
- Conditions > Add
- Type: Trigger
- Selecte the trigger name you created before from the selected host
- Add button and select Operations tab
- Add operation and Recovery operation for the user Admin. Use media type Chris Telegram (you created in the previous phases)
- Click update
Links
- https://www.youtube.com/watch?app=desktop&v=CoQNV0ll_tA
- https://neliosoftware.com/content/help/how-do-i-get-the-channel-id-in-telegram/
- https://www.zabbix.com/integrations/telegram
Category: Linux, Zabbix Monitoring Tool