Skip to content

Latest commit

 

History

History
68 lines (39 loc) · 3.68 KB

README-ZBX.md

File metadata and controls

68 lines (39 loc) · 3.68 KB

Prerequisites

2. Upload or import spreadsheet (SurveyChatBot.xlsx) to Google Docs.

3. Under the parameters sheet, edit the following field:

4. Under the questions sheet, you can delete rows starting from 2 or just leave one question to identify user (eg.: text, What's your surname?)

5. Open the Script Editor

Open the Tools > <> Script editor

6. Upload .gs files.

a) Copy content of files and paste to new script. Rename. Create new + > Script. Repeat for another .gs file.

OR

b) Swtich to legacy mode and drug&drop file to editor (make sure you deleted default "function myFunction() { }". Repeat for another file.

7. Publish the script as a Web App - Deploy > New Deployment

type

Note: You must select the Anyone option for the "Who has access" dropdown or form responses will not be added to the spreadsheet!

8. Authorize the script to access your Google Sheet data on Google - Click Authorize access. Then under advanced click Go to..., And Allow.

Copy the web app URL to your clipboard / note pad.

9. Set the WebHook on Viber

You need to send POST request to Viber API.

a) In Linux: curl -s -X post https://chatapi.viber.com/pa/set_webhook -d '{"auth_token":"paste-your-token","url":"paste-your-web-app-URL-from-the-previous-step"}'

b) In Windows: curl -s -X post https://chatapi.viber.com/pa/set_webhook -d "{\"auth_token\":\"paste-your-token\",\"url\":\"paste-your-web-app-URL-from-the-previous-step\"}"

c) In Firefox: F12, Network, go to this page, select request with file "set_webhook", edit and send again, type POST as method, delete headers, put this in text: {"auth_token":"paste-your-token","url":"paste-your-web-app-URL-from-the-previous-step"} and send. Check new request > reply.

If "ok" - share bot with users & collect user ids. If not "ok" - see Error codes.

10. Download media_viber.

Go to Administration > Media types, and import .xml.

Script parameters: paste your token.

10b. For legacy zabbix (<4.4.4) - download Viber.sh on zabbix server.

Move it to /usr/local/share/zabbix/alertscripts (default, may be defined at zabbix_server.conf).

Make executeble: chmod +x /usr/local/share/zabbix/alertscripts/Viber.sh

You can test it by executing: /usr/local/share/zabbix/alertscripts/Viber.sh your-auth-token viberid test-subj test-mess

Also you need to dowload media_viber-legacy, go to Administration > Media types, and import .xml. > Limitations: you can't sent messages with symbols: ',!,".

11. Go to Administration > Users and under Media tab in some User paste viber id from spreadsheet.

Note: You may have to check Actions menu, so Report problems sends via all media / Viber.