Skip to content

green-api/whatsapp-zabbix-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

whatsapp-zabbix-script

Full version of the article on the GREEN-API blog available at the link. You can find a video version of the instructions on our YouTube channel.

whatsapp-zabbix-script - a script for integrating notifications from Zabbix into WhatsApp using GREEN-API.

Preparing equipment

To implement the integration, you will need Zabbix, a WhatsApp account linked to the GREEN-API instance, and a WhatsApp group, in case notifications are received in the group.

Detailed instructions for registering an account in GREEN-API can be found here. For free use, use the "Developer" tariff.

To receive messages in a WhatsApp group, you need to know the ID of this group. You can learn more about it from the full version of the article or from our documentation.

Integration of Zabbix and WhatsApp

All configuration is done in the Zabbix web interface:

  1. Go to the AdministrationMedia types tab.

  2. Click on Create media type in the upper right corner and create a notification method named WhatsApp (Name - WhatsApp), select the Webhook type for it (Type - Webhook).

  3. Add the following parameters to the Parameters of the created method, specified in the format Name : Value (if the Value field contains -, the field remains empty):

ApiURL : "insert ApiURL"

apiTokenInstance : "insert apiTokenInstance"

HTTPProxy : -

IdInstance : "insert IdInstance"

Message : {ALERT.MESSAGE}

ParseMode : -

Subject : {ALERT.MESSAGE}

ChatId : "insert chat ID or client ID"

The values ​​for ApiURL, apiTokenInstance and IdInstance are taken from the GREEN-API console. In chatId we insert the ID of the chat to which we are sending notifications, or the WhatsApp client ID. You can read about generating WhatsApp identifiers for a personal chat or group in the full version of the article or in the documentation.

  1. In the Script field, paste the script provided in the repository, the Zabbix version for which the script is written is indicated in its name. You can make changes for the version you are using yourself, in accordance with the official Zabbix documentation.

  2. Next, go to the Message templates tab and add standard message templates: Problem, Problem recovery, Problem update, Discovery, Autoregistration. The text in Template can be left unchanged, or edited to your taste.

  3. The Options tab can be left unchanged. It contains notification processing settings. The parameters provided there will be identical for all message types.

  4. Save the created "WhatsApp" notification method.

Testing the script

To test the created notification method, go back to the Media types tab and see the added "WhatsApp" method. You can test it by clicking Test on the right side of the screen on the line with this method.

As an example, in the Message value, we will put Trigger message, and in SubjectTrigger fired.

If everything was done correctly, then after clicking Test, the Response value will display OK.

You should also check whether the notification was delivered to the chat WhatsApp.

Additionally

This method allows you to set up any notifications from Zabbix to WhatsApp for free using GREEN-API, within the framework of the "Developer" plan.

If you have any questions about our service or purchasing a paid plan, you can contact us in the following ways:

+7-999-333-12-23 for communication in Russia

+7-727-312-23-66 for communication in Kazakhstan

+44-745-803-80-17 our international number

E-Mail: support@green-api.com

Support channel WhatsApp

About

Zabbix scripts for integration with green-api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published