Ad Widget
Collapse
Howto - WhatsApp Zabbix notifications with Mudslide
Collapse
X
-
markfree i generate the QR code in zabbix server , but when i try to connect the QR code with my device via whatsapp always i have an error message (could not connect) -
Team,
Thanks for the above post.
But recently I am facing a problem to send Zabbix WhatsApp alert to WhatsApp group using group id. It says "No session". Seems to be its blocked by WhatsApp.
Any other solution will be helpful.
/snapshot/dist-ncc/index.js:139006
throw new errors.SessionError("No sessions");
^
SessionError: No sessions
at Object.200712462020669.53 [as awaitable] (/snapshot/dist-ncc/index.js:139006:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async _asyncQueueExecutor (/snapshot/dist-ncc/index.js:138707:29)Leave a comment:
-
I expect the API is more stable, but you'd need to pay for that. Mudslide does logout from time to time and needs to be re-linked to the account.Hi inqwaynej
Actually at this time, I also looking for best way to send alert from Zabbix into whatsapp
some youtobe videos seems good, but need to fulfill the requirement, like use their whatsapp API / webhook
This video share how to send zabbix chart to whatsapp group
I'm still stuck how to replicate it using another whatsapp API gateway, the one I've tried using WAHACode:https://www.youtube.com/watch?v=CH67ePM1NJA
Another Whatsapp API Gateway using this oneCode:https://waha.devlike.pro
Script in zabbix alertscriptsCode:https://github.com/aldinokemal/go-whatsapp-web-multidevice
Glad If somebody have better way to sending zabbix alert into whatsappCode:cat alert_zabbix.sh URL="http://whatsapp-api:3000/send/message" PHONE="phone number" TITLE="$2" MESSAGE="$TITLE$3" curl --location --request POST "$URL" \ --header 'Content-Type: application/json' \ --data-raw "{ \"phone\": \"${PHONE}\", \"message\": \"${MESSAGE}\" }"
Thanks
Mudslide can send messages to groups. You just need to find the group id. You can see which groups (with the group id) the account is a member of with "mudslide groups"
For charts, Mudslide can send images and attachments. There are example on the Github readme https://github.com/robvanderleek/mud...-an-image-file
Leave a comment:
-
Thanks for pointing that out Victor, can't figure out how to edit the original post though.Leave a comment:
-
Hi inqwaynej
Actually at this time, I also looking for best way to send alert from Zabbix into whatsapp
some youtobe videos seems good, but need to fulfill the requirement, like use their whatsapp API / webhook
This video share how to send zabbix chart to whatsapp group
I'm still stuck how to replicate it using another whatsapp API gateway, the one I've tried using WAHACode:https://www.youtube.com/watch?v=CH67ePM1NJA
Another Whatsapp API Gateway using this oneCode:https://waha.devlike.pro
Script in zabbix alertscriptsCode:https://github.com/aldinokemal/go-whatsapp-web-multidevice
Glad If somebody have better way to sending zabbix alert into whatsappCode:cat alert_zabbix.sh URL="http://whatsapp-api:3000/send/message" PHONE="phone number" TITLE="$2" MESSAGE="$TITLE$3" curl --location --request POST "$URL" \ --header 'Content-Type: application/json' \ --data-raw "{ \"phone\": \"${PHONE}\", \"message\": \"${MESSAGE}\" }"
ThanksLeave a comment:
-
Good day,
Please add to point 5, "Add media type to Zabbix":
Script parameters: {ALERT.SENDTO}
Script parameters: {ALERT.MESSAGE}
Thank you very much for the information.
Greetings
Victor PalmarLeave a comment:
-
Howto - WhatsApp Zabbix notifications with Mudslide
First post from a long time Zabbix user.
I've been looking for a while for a way to send Zabbix notifications from WhatsApp. I struggled to find a simple solution that still worked on Debian 11. I eventually stumbled on a project called Mudslide. I was initially put off by the need for docker/NPM, which I'm not familiar with, but I found pre-compiled binaries which I was able to use. I thought I'd share some notes for anyone who may be interested. Below are my notes using Mudslide with Zabbix 6.4 on Debian 11.
1. Download the pre-compiled binary for mudslide
From https://github.com/robvanderleek/mud...tform-binaries
2. Make executable and move to /usr/local/binCode:wget https://github.com/robvanderleek/mudslide/releases/download/0.25.1/mudslide-linuxstatic-x64
3. Create alert script.Code:chmod +x mudslide-linuxstatic-x64 mv mudslide-linuxstatic-x64 /usr/local/bin/mudslide
Our alert script is more complex in order to filter out some notifications. The script hasn't been tested, but it should work.
Code:vi /usr/lib/zabbix/alertscripts/whatsapp
Code:#!/bin/bash mudslide -c /tmp/mudslide-cache send $1 "$2"
4. Login to WhatsAppCode:chmod +x /usr/lib/zabbix/alertscripts/whatsapp
Command below displays a QR code to login as a linked device.
5. Add media type to ZabbixCode:sudo -u zabbix mudslide -c /tmp/mudslide-cache login
Add media type to Zabbix from the WebUI. Alerts > Media types. I cloned the SMS media type and changed the following:
6. Adding media to usersCode:Name: WhatsApp Type: Script Script name: whatsapp
Use the full number with country code for "Send to" when adding media for a user. No preceding 0's or "+". e.g. 442079460000 (UK), 12065550100 (US)
Messages can also be sent to groups. Use the group ID in "Send to". Group IDs can be found from CLI with:
This will fetch the groups the account is currently a member of.Code:sudo -u zabbix mudslide -c /tmp/mudslide-cache groups
Note on the cache folder:
The Zabbix user on our system does not have a home folder, so we use /tmp/mudslide-cache for the cache folder. The cache contains login information. /tmp is cleared on reboot so you'll need to login on each reboot or change the cache folder. The cache folder does need to be writeable by the Zabbix user. I work around this I sync the folder to another location with cron:
Code:vi /usr/local/bin/mudslide-cache-sync.sh
Code:#!/bin/bash # This script syncs the mudslide cache from /tmp to /var/cache. This is to work around the cache being cleared every time the server is rebooted. # First rsync files from the backup to the cache. "-u" prevents overwriting newer files. This will also recreate the folder if it has been removed. rsync -quazvh --copy-as=zabbix:zabbix /var/cache/mudslide/* /tmp/mudslide-cache/ # Then sync any updated files from the cache to the back-up. rsync -qazvh /tmp/mudslide-cache/* /var/cache/mudslide/
Hope this has been useful.Code:chmod +x /usr/local/bin/mudslide-cache-sync.sh cd /etc/cron.hourly ln -s /usr/local/bin/mudslide-cache-sync.sh mudslide-cache-sync
Tags: None👍 1
Leave a comment: