Hello everyone,
I have problems with alert script located in /usr/lib/zabbix/alertscripts:
I can call this script with Media type/Test and it works fine(sends SMS over SMS server) if last row echo.... is commented.
If not I got permission denied to write in log, but SMS is sent .
Owner of -R /usr/lib/zabbix is zabbix user.
Please what I need to do to complete the script?
Kind regards,
Sosisoft
I have problems with alert script located in /usr/lib/zabbix/alertscripts:
Code:
#!/bin/bash
sendto="$1"
message="$2"
username="sender"
password="some pwd"
provider="Orange"
directory=$(pwd)
# JSON data
data="{"auth":{"username":"$username","pass word":"$password"},"provider":"$provider",\ "number":"$sendto","content":"$message" }"
response=$(curl -sS -X POST [URL]http://smsserver/goip/sendsms/[/URL] -H "Content-Type: application/json" -d "$data")
log_file="sms_server_response.log"
timestamp=$(date +"%d.%m.%Y %H:%M:%S")
echo "$timestamp $response" >> "$directory/$log_file"
If not I got permission denied to write in log, but SMS is sent .
Owner of -R /usr/lib/zabbix is zabbix user.
Please what I need to do to complete the script?
Kind regards,
Sosisoft
Comment