Ad Widget

Collapse

Discussion thread for official Zabbix Template Asterisk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • max.ch.88
    Senior Member
    • Oct 2018
    • 206

    #16
    Originally posted by benjicx

    Morning,

    Zabbix 5.2.1 and from https://www.zabbix.com/integrations/asterisk which led me to https://git.zabbix.com/projects/ZBX/.../asterisk_http

    It was the feedback section at the bottom of that page that led me to this forum post.
    Please, take the template from the branch for your version

    Comment

    • max.ch.88
      Senior Member
      • Oct 2018
      • 206

      #17
      Originally posted by Turbid

      all endpoints - offline = online?
      Perhaps. Will it be a useful item? I'm not sure.

      Comment

      • Nosferato
        Junior Member
        • Nov 2020
        • 6

        #18
        Originally posted by max.ch.88

        Please, take the template from the branch for your version
        https://git.zabbix.com/projects/ZBX/...Frelease%2F5.2

        error reason for "502ee1e6-434d-4e98-2bdf-caeaec4f09cd:asterisk.get_stats" changed: Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk/13.23.1..Date: Fri, 13 Nov 2020 10:59:03 GMT..Cache-Control: no...
        1. Failed: Request failed with message Follows. Check debug log for more information.

        Comment

        • max.ch.88
          Senior Member
          • Oct 2018
          • 206

          #19
          Originally posted by Nosferato


          error reason for "502ee1e6-434d-4e98-2bdf-caeaec4f09cd:asterisk.get_stats" changed: Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk/13.23.1..Date: Fri, 13 Nov 2020 10:59:03 GMT..Cache-Control: no...
          1. Failed: Request failed with message Follows. Check debug log for more information.
          Look at the Zabbix server log

          Comment

          • bot123
            Junior Member
            • Apr 2016
            • 2

            #20
            Originally posted by max.ch.88

            Look at the Zabbix server log
            From my Zabbix server debug log:
            Code:
            13192:20201117:143543.821 [ Asterisk ] Received response with status code 200
            Response: Error
            Message: No endpoints found
            
            
            
            13192:20201117:143543.821 End of zbx_es_execute():FAIL Request failed with message Error. Check debug log for more information.
            13192:20201117:143543.821 worker_preprocess_value(): HTTP/1.1 200 OK
            Server: Asterisk/16.8.0
            Date: Tue, 17 Nov 2020 11:36:13 GMT
            Cache-Control: no-cache, no-store
            Content-type: text/plain
            Set-Cookie: mansession_id="c2bcab22"; Version=1; Max-Age=60
            Pragma: SuppressEvents
            Content-Length: 55
            
            
            13192:20201117:143543.821 worker_preprocess_value: FAIL Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk/16.8.0..Date: Tue, 17 Nov 2020 11:36:13 GMT..Cache-Control: no-...
            1. Failed: Request failed with message Error. Check debug log for more information.

            I added pjsip extention and it worked!

            In another installation of an asterisk, I get this error:
            Code:
            20734:20201117:151833.855 [ Asterisk ] Sending request: http://192.168.10.3:8088/rawman?action=command&command=core%20show%20channe ls
            20734:20201117:151833.859 [ Asterisk ] Received response with status code 200
            Response: Follows
            Privilege: Command
            Channel Location State Application(Data)
            0 active channels
            0 active calls
            229 calls processed
            --END COMMAND--
            
            
            20734:20201117:151833.859 End of zbx_es_execute():FAIL Request failed with message Follows. Check debug log for more information.
            I edited the template:
            if (match !== null && match[1] !== 'Success' && match[1] !== 'Goodbye' && match[1] !== 'Follows') {
            And it worked!
            Last edited by bot123; 17-11-2020, 18:29.

            Comment

            • benjicx
              Junior Member
              • Nov 2020
              • 4

              #21
              Originally posted by max.ch.88

              Please, take the template from the branch for your version
              https://git.zabbix.com/projects/ZBX/...Frelease%2F5.2
              Ah! Thank you - might be worth the Zabbix people updating that page as master still has version 5.2 in the template.

              Still not got it to work, but different error now which I'll work through.

              Seems to be disliking the CoreSettings call. (despite the user having full permissions to AMI) Asterisk version 16.
              Last edited by benjicx; 17-11-2020, 17:57.

              Comment

              • benjicx
                Junior Member
                • Nov 2020
                • 4

                #22
                Originally posted by benjicx
                Seems to be disliking the CoreSettings call. (despite the user having full permissions to AMI) Asterisk version 16.
                SOLVED
                For anyone finding this and being a freepbx user, you will need to specify the user in manager_custom.conf as the freepbx GUI doesn't given the "all" permission to the Manager user.

                Comment

                • Nosferato
                  Junior Member
                  • Nov 2020
                  • 6

                  #23
                  Originally posted by bot123

                  And it worked!
                  Thx! Worked me to.

                  Comment

                  • Conftvty
                    Junior Member
                    • Nov 2020
                    • 1

                    #24
                    I configured the asterisk and template according to the manual, and I get a response from the zabbix cli:

                    curl "http://pbxip:8088/asterisk/rawman?action=login&username=zabbix&secret=passwor d"
                    Response: Success
                    Message: Authentication accepted

                    but nothing works except "Service response time" and "Service status", but this is just a port check and works regardless of the template settings

                    there is an error in the zabbix logs:

                    1275:20201118:194043.423 error reason for "PBX:asterisk.get_stats" changed: Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk/16.13.0..Date: Wed, 18 Nov 2020 16:40:38 GMT..Cache-Control: no...
                    1. Failed: ReferenceError: identifier 'HttpRequest' undefined
                    at [anon] (duktape.c:81729) internal
                    at [anon] (function:6) preventsyield

                    What's wrong?

                    Comment

                    • Step.Alexander
                      Junior Member
                      • Nov 2020
                      • 3

                      #25
                      Originally posted by Conftvty
                      but nothing works except "Service response time" and "Service status", but this is just a port check and works regardless of the template settings
                      Have the same problem. But I do not have any errors in logs.
                      Did you solve the problem?

                      Comment

                      • jonathanp
                        Junior Member
                        • Nov 2020
                        • 3

                        #26
                        I haven't had any luck getting an external zabbix server to monitor a freepbx box. I'm getting the "problem": Asterisk: Failed to fetch AMI page (or no data for 30m)

                        I have opened the firewall ports. Excluded the zabbix server public ip from the freepbx firewall.

                        I set the following in the /etc/asterisk/manager.conf & /etc/asterisk/manager_custom.conf

                        webenabled = yes
                        [zabbix]
                        secret = password
                        read = system,call,log,verbose,command,agent,user,origina te
                        write = system,call,log,verbose,command,agent,user,origina te

                        My zabbix server is running 5.2.1

                        I'm using the template from: zabbix-feature-DEV-1559-5.2@c8f25bf6661

                        I have the 4 macros in the ZABBIX host set :

                        {$AMI.PORT} : 8088

                        {$AMI.SECRET} : password

                        {$AMI.URL} : http://asterisk.server.com:8088/asterisk/rawman

                        {$AMI.USERNAME} : zabbix

                        Any help would be appreciated.

                        Comment

                        • jonathanp
                          Junior Member
                          • Nov 2020
                          • 3

                          #27
                          curl "http://pbxip.com:8088/asterisk/rawman?action=login&username=zabbix&secret=passwor d"
                          <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
                          <html><head>
                          <title>404 Not Found</title>
                          </head><body>
                          <h1>Not Found</h1>
                          <p>The requested URL was not found on this server.</p>
                          <hr />


                          curl "http://pbxip.com:8088/rawman?action=login&username=zabbix&secret=passwor d"
                          Response: Success
                          Message: Authentication accepted

                          After changing: 8088/asterisk/rawman to 8088/rawman I was able to get the Success response back. I updated the macro:
                          {$AMI.URL} : http://asterisk.server.com:8088/rawman

                          Unfortunately still getting: Asterisk: Failed to fetch AMI page (or no data for 30m)

                          What "Interface" should be setup for the host? SNMP or Agent? I thought this version doesn't require the zabbix agent to be installed on the freepbx box.

                          Comment

                          • jonathanp
                            Junior Member
                            • Nov 2020
                            • 3

                            #28
                            After deleting the template and using this version it appears to be working: https://git.zabbix.com/projects/ZBX/...Frelease%2F5.2

                            Comment

                            • Step.Alexander
                              Junior Member
                              • Nov 2020
                              • 3

                              #29
                              Originally posted by jonathanp
                              After deleting the template and using this version it appears to be working: https://git.zabbix.com/projects/ZBX/...Frelease%2F5.2
                              When I use this vertion of template works only "Service response time", "Service status"
                              And I have an error "Response code "404" did not match any of the required status codes "200""
                              Also in Zabbix I have: Asterisk: Failed to fetch AMI page (or no data for 30m)

                              I get response from zabbix and freepbx server
                              curl "http://address:8088/asterisk/rawman?action=login&username=Zabbix&secret=passwd"

                              404 Not Found

                              P.S. the firewall is turn off....
                              Last edited by Step.Alexander; 25-11-2020, 09:26.

                              Comment

                              • Step.Alexander
                                Junior Member
                                • Nov 2020
                                • 3

                                #30
                                The problem was solved.
                                I turned on mini-HTTP Server in freepbx through GUI. But forgot to add "webenabled=yes" to "manager.conf"

                                Comment

                                Working...