Ad Widget
Collapse
[Zabbkit] Push notifications on your smartphone
Collapse
X
-
decision:I can send push from command line as zabbix user. I then had the output from the script go to a file when zabbix runs the push script. I have a shell defined. It runs. But doesn't pass {Id:'$1', text:'$2', triggerId:'$3'} the variables.
So it will not complete. Anyone else having this issue? I can't get jabber or even email to work either. I haven't troubleshooted those yet to figure out why. Everything else seems to work just fine. The EZText works just fine.
Any help would be appreciated.
5.6
Comment
-
Best script:
#!/bin/bash
STRING=`curl -X POST\
-H "Content-type:application/json"\
-d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\
http://zabbkit.inside.cactussoft.biz/api/messages`
echo $(date +"%d-%m-%y %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit-$(date +%d-%m-%y).log
the script keeps a log tracksLast edited by wolf_ktl; 31-03-2016, 13:07.Comment
-
i got error "curl: (6) Could not resolve host"
ping zabbkit.inside.cactussoft.biz - O.K.
(iPhone)
[1/4]: Id:'570fb60a6cc4b413fc56bd00'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: Id:'570fb60a6cc4b413fc56bd00'http
[2/4]: text:'test message'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: text:'test message'http
[3/4]: triggerId:'0'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: triggerId:'0'http
[4/4]: playSound:truehttp://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: playSound:truehttpComment
-
It looks like a lack of spaces between curl's parameters. Try to adjust your script.i got error "curl: (6) Could not resolve host"
[1/4]: Id:'570fb60a6cc4b413fc56bd00'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: Id:'570fb60a6cc4b413fc56bd00'http
[2/4]: text:'test message'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: text:'test message'http
[3/4]: triggerId:'0'http://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
curl: (6) Could not resolve host: triggerId:'0'http
[4/4]: playSound:truehttp://zabbkit.inside.cactussoft.biz/api/messages --> <stdout>
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: playSound:truehttpComment
-
My Script :
Code:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.logComment
-
You need to add space before options to solve this error
but now in push_zabbkit.log I have following error:Code:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.log
16-04-27 12:47:32,56fbf6186cc4b414f06a6e9d,{"Message":"The request is invalid.","ModelState":{"value.triggerId":["An error has occurred."]}},,
Can anyone help me?Comment
-
Server url is invalid on WP
Hi,
Unfortunately we cannot connect to a server on WP. We get the following error message when try to add a server:
"The specified "Zabbix" server url is invalid"
We tried with an iPhone on the same network which work without any issue.
Could you please help?
Thank you in advanceComment
-
You need to add space before options to solve this error
but now in push_zabbkit.log I have following error:Code:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.log
16-04-27 12:47:32,56fbf6186cc4b414f06a6e9d,{"Message":"The request is invalid.","ModelState":{"value.triggerId":["An error has occurred."]}},,
Can anyone help me?
So messages come ? /zabbkit-push YOUR-ID-FROM-STEP-1 "test message", 0Comment
-
my real script is:
because I use a proxy to connect to internetCode:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ -x user:password@proxy:port http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.log
If I run the script manually I have:
./zabbkit-push 56fbf6186cc4b414f06a6e9d "test" 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 116 100 41 100 75 100 183 --:--:-- --:--:-- --:--:-- 183
and in push_zabbkit.log I have:
16-04-27 14:33:40,56fbf6186cc4b414f06a6e9d,{"trackingId":"5 720b1a46cc4b40f64edc06d"},test,0
But if zabbix launch the script as an action I have:
16-04-29 08:22:49,56fbf6186cc4b414f06a6e9d,{"Message":"The request is invalid.","ModelState":{"value.triggerId":["An error has occurred."]}},{TRIGGER.STATUS}: {TRIGGER.NAME},{HOST.NAME1}
(in the log there are real trigger and host names)
Thank youComment
-
Script:
From the command line push notifications work (./zabbkit-push ID "test message" 0)Code:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.log
But when configured in a web interface zabbiks notification says that the message is sent but nothing comes and nothing in the logComment
-
Script:
From the command line push notifications work (./zabbkit-push ID "test message" 0)Code:#!/bin/bash STRING=`curl -X POST\ -H "Content-type:application/json"\ -d "{Id:'$1', text:'$2', triggerId:'$3', playSound:true}"\ http://zabbkit.inside.cactussoft.biz/api/messages` echo $(date +"%y-%m-%d %T"),$1,$STRING,$2,$3 >> /var/log/zabbix/push_zabbkit.log
But when configured in a web interface zabbiks notification says that the message is sent but nothing comes and nothing in the log
decision:
5.6
Comment
Comment