Alert script for sending SMS in Zabbix via Kavenegar APIs.
You need to make an account on Kavenegar from Here Then, you should pick API-KEY up from My Account section.
- Copy all files to Zabbix "alertscripts" folder, usually located in this path:
/usr/lib/zabbix/alertscripts/
- Set the "Read", "Write", and "Execute" permission (755) the "KavenegarSendSMS.php":
sudo chmod 755 /usr/lib/zabbix/alertscripts/KavenegarSendSMS.php
-
On Zabbix's side menu, open the Allerts > Media types and then click on Create media type button on top right corner.
- Set the Name
- On the Type, Select the "Script"
- On the Script name, enter this script: "KavenegarSendSMS.php"
- On the Script parameters add the parameters you need (same as screenshot). The parameters will be parsed to $argv[1], $argv[2], ... in KavenegarSendSMS.php, in the same order as they are added.
- After setting Message templates and Options, Click the Add button.
-
Now you can test the script by clicking the Test button.
- Enter test values for the parameters and then click the Test button.
- You can check the API Calls here: Developer/UserActivity.
-
You can also use "Send" or "SendArray" instead of "VerifyLookup" by editing KavenegarSendSMS.php according to the Kavenegar RESTful API Documentation.
Bug fixes, docs, and enhancements welcome! Please let us know [email protected]