-
Notifications
You must be signed in to change notification settings - Fork 0
/
MeliPayamak
42 lines (31 loc) · 1.05 KB
/
MeliPayamak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
USERNAME=myUsername
PASS=abc123
FROM=500000
PHONE=${1}
MESSAGE=${2}
sudo apt install httpie -y
# This echo is only for my /var/run/zabbix/log/log.out script
echo "date +%H:%M:%: Sending SMS Text to $1"
#
# Posting the SMS via HTTP API
#
#
http "https://api.payamak-panel.com/post/Send.asmx/SendSimpleSMS2?username=$USERNAME&password=$PASS&to=$PHONE&from=$FROM&text=$MESSAGE&isflash=false"
echo "date +%H:%M:%: SMS Text sent to $1"
echo "MESSAGE: $2"
#Instructions
#How to add the script to Zabbix (Tested on Zabbix Server 3.4):
#Administration > Media Types
#Add a new "Script" media Type
# Name: ClickSend - SMS
# Type: Script
# Script name: send_sms.sh
# Script parameters:
# PARAMETER 1: {ALERT.SENDTO}
# PARAMETER 2: {ALERT.MESSAGE}
#Create an action and make sure it has the "SEND SMS" enabled on it.
#Copy the script send_sms.sh to your Zabbix server on: /usr/lib/zabbix/alertscripts
#Add permission to the file:
# chmod +x /usr/lib/zabbix/alertscripts/send_sms.sh
# chown zabbix:zabbix /usr/lib/zabbix/alertscripts/send_sms.sh