Ad Widget

Collapse

[Zabbkit] Push notifications on your smartphone

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wolf_ktl
    Junior Member
    • Mar 2016
    • 20

    #46
    After upgrading to 3.0 zabbix stopped working script

    Originally posted by sarsenal
    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.


    After upgrading to 3.0 zabbix stopped working script .. Zabbix writes everything is OK , but does not send

    Comment

    • wolf_ktl
      Junior Member
      • Mar 2016
      • 20

      #47
      Originally posted by sarsenal
      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.
      decision:
      5.6

      Comment

      • wolf_ktl
        Junior Member
        • Mar 2016
        • 20

        #48
        delete message
        Last edited by wolf_ktl; 05-04-2016, 13:25.

        Comment

        • wolf_ktl
          Junior Member
          • Mar 2016
          • 20

          #49
          delete message
          Last edited by wolf_ktl; 05-04-2016, 13:25.

          Comment

          • wolf_ktl
            Junior Member
            • Mar 2016
            • 20

            #50
            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 tracks
            Last edited by wolf_ktl; 31-03-2016, 13:07.

            Comment

            • sk3pp3r
              Junior Member
              • Nov 2015
              • 18

              #51
              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:truehttp

              Comment

              • yan
                Member
                • Mar 2013
                • 31

                #52
                Originally posted by sk3pp3r
                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:truehttp
                It looks like a lack of spaces between curl's parameters. Try to adjust your script.

                Comment

                • sk3pp3r
                  Junior Member
                  • Nov 2015
                  • 18

                  #53
                  Originally posted by yan
                  It looks like a lack of spaces between curl's parameters. Try to adjust your script.
                  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.log

                  Comment

                  • melluc
                    Junior Member
                    • Apr 2016
                    • 4

                    #54
                    You need to add space before options to solve this 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
                    but now in push_zabbkit.log I have following error:

                    16-04-27 12:47:32,56fbf6186cc4b414f06a6e9d,{"Message":"The request is invalid.","ModelState":{"value.triggerId":["An error has occurred."]}},,


                    Can anyone help me?

                    Comment

                    • daniel.belso
                      Junior Member
                      • Apr 2016
                      • 1

                      #55
                      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 advance

                      Comment

                      • wolf_ktl
                        Junior Member
                        • Mar 2016
                        • 20

                        #56
                        Originally posted by melluc
                        You need to add space before options to solve this 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
                        but now in push_zabbkit.log I have following error:

                        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", 0

                        Comment

                        • melluc
                          Junior Member
                          • Apr 2016
                          • 4

                          #57
                          my real script is:
                          Code:
                          #!/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
                          because I use a proxy to connect to internet

                          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 you

                          Comment

                          • shaya
                            Junior Member
                            • May 2016
                            • 1

                            #58
                            Is this script compatible with zabbix 3 ver ?

                            the script fail to deliver on uppon trigger - is there any ajustments need to be made for the new zabbix 3 ver for this to run ?

                            Comment

                            • Randomiser
                              Junior Member
                              • May 2016
                              • 9

                              #59
                              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.log
                              From the command line push notifications work (./zabbkit-push ID "test message" 0)

                              But when configured in a web interface zabbiks notification says that the message is sent but nothing comes and nothing in the log

                              Comment

                              • wolf_ktl
                                Junior Member
                                • Mar 2016
                                • 20

                                #60
                                Originally posted by Randomiser
                                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.log
                                From the command line push notifications work (./zabbkit-push ID "test message" 0)

                                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

                                Working...