M
M
mrbaskus2016-01-25 15:36:20
Command line
mrbaskus, 2016-01-25 15:36:20

SMS notifications via custom script in Zabbix?

Tell me, please, how can I set up sending SMS through a script in Zabbix?) I have a hard time with programming)
There is Zabbix on Debian, there is a script for sending SMS

curl -X POST -d '{"PhoneNumber": "", "Text": ""}'  -H "Content-Type: application/json" http://site.com/api/

I made a script for zabbix:
#!/bin/bash
PhoneNumber="$1"
subject="$2"
Text="$3"
curl -X POST -d '{"PhoneNumber": "$1", "Text": "$3"}'  -H "Content-Type: application/json" http://site.com/api/

But it doesn't work. SMS does not come. In Zabbix itself, of course, everything is turned on

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talik, 2016-01-25
@Talik0507

Is there anything written in the logs?
I can’t say with all confidence, but something tells me that the request body line needs to be formed beforehand (Make sure that the parameters passed to the script really fall into place).
if this is a problem, check the script permissions of the owner and non-owner of the file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question