Ad Widget

Collapse

Discussion thread for official Zabbix Template Asterisk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sergio_arm
    Junior Member
    • Nov 2020
    • 2

    #31
    Good day,members of the forum, I can’t understand - when creating a node - where does the Asterisk template take over HTTP the ip address (Agent, jmx, snmp)? I managed to put the ip in the properties of the "Asterisk by HTTP" template itself, but it still doesn't work. Clean new asterisk, clean zabbiks. Any ideas? I re-read the forum thread, it did not help ...
    I am using zabbix 5.2 + asterisk 17.7.0.
    My config:

    [general]
    enabled=yes
    bindaddr=0.0.0.0
    enablestatic=yes
    bindport=8088

    [general]
    enabled = yes
    bindaddr = 0.0.0.0
    webenabled =yes


    [zabbix]
    secret = zabbix
    read = all
    write = all
    ----------------------------------------------------------
    Asterisk by HTTP > Zabbix raw items > Asterisk: Get stats

    When testing a data item 'Asterisk: Get stats'
    in mode get the value "now"
    i get answer -
    HTTP/1.1 200 OK
    Server: Asterisk/17.7.0
    Date: Mon, 30 Nov 2020 07:40:34 GMT
    Cache-Control: no-cache, no-store
    Content-type: text/plain
    Set-Cookie: mansession_id="5d071a12"; Version=1; Max-Age=60
    Pragma: SuppressEvents
    Content-Length: 55


    But when receiving data from an asterisk -

    ReferenceError: identifier 'HttpRequest' undefined
    at [anon] (duktape.c:81729) internal
    at [anon] (function:6) preventsyield

    Comment

    • sergio_arm
      Junior Member
      • Nov 2020
      • 2

      #32
      I am using zabbix 5.2 + asterisk 17.7.0.
      My config:

      [general]
      enabled=yes
      bindaddr=0.0.0.0
      enablestatic=yes
      bindport=8088

      [general]
      enabled = yes
      bindaddr = 0.0.0.0
      webenabled =yes


      [zabbix]
      secret = zabbix
      read = all
      write = all
      ----------------------------------------------------------
      Asterisk by HTTP > Zabbix raw items > Asterisk: Get stats

      When testing a data item 'Asterisk: Get stats'
      in mode get the value "now"
      i get answer -
      HTTP/1.1 200 OK
      Server: Asterisk/17.7.0
      Date: Mon, 30 Nov 2020 07:40:34 GMT
      Cache-Control: no-cache, no-store
      Content-type: text/plain
      Set-Cookie: mansession_id="5d071a12"; Version=1; Max-Age=60
      Pragma: SuppressEvents
      Content-Length: 55


      But when receiving data from an asterisk -

      ReferenceError: identifier 'HttpRequest' undefined
      at [anon] (duktape.c:81729) internal
      at [anon] (function:6) preventsyield


      but when i changed the link to http: //my.server-ip:8088/rawman
      and removed then added the template https://git.zabbix.com/projects/ZBX/...risk_http.yaml



      everything worked wonderfully!

      Comment

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

        #33
        Originally posted by Turbid
        1. Does not work while modules chan_sip, chan_iax2 or app_queue.so are unloaded:

        Code:
        12661:20201028:134603.129 error reason for "pbx:asterisk.get_stats" changed: Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk..Date: Wed, 28 Oct 2020 10:46:02 GMT..Cache-Control: no-cache, ...
        1. Failed: Request failed with message Error: Invalid/unknown command: QueueSummary. Use Action: ListCommands to show available commands.. Check debug log for more information.
        12660:20201028:134703.649 item "pbx:asterisk.get_stats" became supported
        Although only pjsip is used on my system.

        p.s. chan_sip is now depricated: https://www.asterisk.org/deprecating...0-rc2-release/

        2. Only unavailable endpoints in PJSIP peers graph. Why not online?
        Hello. All issues have resolved in https://support.zabbix.com/browse/ZBX-18658.

        Comment


        • Turbid
          Turbid commented
          Editing a comment
          Thank you. I checked it - it seems to work as expected.
      • NIk Che
        Junior Member
        • Jan 2021
        • 2

        #34
        When using this template, when trying to force a poll "Execute now" through the "discovery rule", the web interface constantly gives an error:

        What could be the cause of this problem? Information can be obtained only about active calls, but I would like to monitor the status of the trunks.
        i'm using Zabbix 5.2.3 and FreePBX 13.0.191.11(Asterisk 13.19.1)

        Comment

        • MagicLink
          Junior Member
          • Feb 2021
          • 2

          #35
          Hi,

          i test this template and it works fine. One thing i don't understand is item "active channel by SIP trunk" is always 0 for 2 servers (gateway with asterisk version 13.22). I also have 4 servers for users with asterisk 16.9 and the same item show me right number of active call by SIP trunk. These 4 servers are interconnected to the two gateway.
          Any idea of how can i debug this issue ? I tried to see if there were any difference between the version and the script but no luck, maybe i'm not good enough
          Here are two capture from zabbix lastest data of these items from those ipbx

          Thank you

          Comment

          • dijb988
            Junior Member
            • May 2017
            • 3

            #36
            Hi, i am using this template and its working fine but i am not getting the SIP peers in Asterisk: Get stats. The Json does not have the information. I have to do something more in the asterisk to get it?

            Comment

            • bes
              Junior Member
              • Mar 2021
              • 1

              #37
              Originally posted by c4.gabriel
              Any ideas on how can I debug why i am not getting any info ?
              This template (Asterisk by HTTP) get info by HTTP Agent from zabbix server and from AMI port directly (accessed from zabbix server).
              $AMI.URL should be accessed from zabbix server (without auth, because js that process data not honor auth even if you set it in asterisk.get_stats)
              $AMI.PORT should be accessed from zabbix server because it check it directly by tcp
              zabbix 5.2 still can't do it through zabbix-agent
              To debug. Connect template to host, set macros values, open item get_stats, test button at end, get value and test value



              Comment

              • Amagkh7
                Junior Member
                • Mar 2021
                • 2

                #38
                Hello! why does not it work templare Asterisk HTTP

                1) Enable web manager
                /etc/asterisk/manager.conf

                Code:
                [general]
                enabled = yes
                webenabled = yes
                httptimeout = 600
                port = 5038
                bindaddr = 0.0.0.0

                [zabbix]
                secret = zabbix
                deny=0.0.0.0/0.0.0.0
                permit=127.0.0.1/255.255.255.0
                permit= 192.168.1.11/255.255.255.255
                permit= 192.168.1.3/255.255.255.255
                read = all
                write = all
                displayconnects=no


                2) Reload Asterisk Manager

                Code:
                asterisk -rx "manager reload"



                Code:
                http://my_local_ip:8088/rawman?actio...&secret=zabbix
                ​​​​​​​
                Response: Success
                Message: Authentication accepte

                4) Applied the Asterisk HTTP template

                5) I assigned the Template to my server and set the following

                Code:
                {$AMI.SECRET} zabbix
                {$AMI.URL} http://192.168.1.12:8088/rawman
                {$AMI.USERNAME} zabbix
                {$AMI.PORT} 8088
                I am using a Zabbix Proxy not sure if that is useful info.


                Zabbix Server 5.0.9
                ZAbbix Agent 5.0.9

                ERROR:
                Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk..Date: Sat, 13 Mar 2021 14:23:42 GMT..Cache-Control: no-cache, ...
                1. Failed: Request failed with message Error. Check debug log for more information.



                Comment

                • rsafin
                  Junior Member
                  • Mar 2021
                  • 4

                  #39
                  Hello Support team!
                  I have Asterisk 11.25 version, which monitored by zabbix 5.2 server using template_tel_asterisk_http. And everything is fine, but in my network I have E1 channels and I should to monitor them. Monitoring logically and physically state of this entities. Manually I make the following commands "ss7 show channels" and "dahdi show status" - for checking physically status of E1 cards.
                  Could you advise how I can monitor it in zabbix ? Or can I change or customize Asterisk template, cause I have no PJSIP and IAX and i could replace them.
                  Thank you in advance.

                  Comment

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

                    #40
                    Originally posted by dijb988
                    Hi, i am using this template and its working fine but i am not getting the SIP peers in Asterisk: Get stats. The Json does not have the information. I have to do something more in the asterisk to get it?
                    Do you have active SIP peers? What does the command sip show peers show?

                    Comment

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

                      #41
                      Originally posted by Amagkh7
                      Hello! why does not it work templare Asterisk HTTP

                      ERROR:
                      Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk..Date: Sat, 13 Mar 2021 14:23:42 GMT..Cache-Control: no-cache, ...
                      1. Failed: Request failed with message Error. Check debug log for more information.
                      Did you permit access from the Zabbix server to Asterisk in the Asterisk server config and on firewalls between servers?

                      Comment

                      • shdwlynx
                        Junior Member
                        • Apr 2021
                        • 4

                        #42
                        First, I'd like to thank everyone over the years who posted to this forum. While the Zabbix documentation is very useful, seeing actual real-life examples in context really helps.

                        To that end, I modified the 5.2 template to add a new value. In our case, we need to know not just how many channels are active per SIP trunk, but the sum total of all active channels across all SIP trunks.
                        Added new data value: "Asterisk: SIP all trunks active channels" (asterisk.sip.all_trunks_active_channels)
                        Added two new triggers (and Macros) for above, both a warning threshold and a max threshold.

                        In the process, I also addressed a minor issue that only affects those of us foolish mortals who use SIP trunk names that are longer than 16 characters. The "fix" is only useful if your SIP trunk names do not have unique characters at the end of them because the "core show channels" command used by the template to get a list of active channels only provides the first 16 characters.

                        I've attached the YAML if anyone is interested (just do a compare/diff vs. the 5.2 YAML to see what I changed/added). I had to zip it up so that the forum would allow me to attach it.
                        Attached Files

                        Comment

                        • shaun_loureiro
                          Junior Member
                          • Mar 2021
                          • 1

                          #43
                          Hey Guys.

                          So i am having problems getting this template to work. I have a test Zabbix server thats running 5.4.0beta1.(Will this template work with 5.4?) The guys that run the Asterisk box say they cant create a user (zabbix) as shown in the instructions. We can only use the admin user. Is this a problem? If i try the get_stats item i am just getting a "404 response code?" Does this mean that the config on the Asterisk side is wrong? This is the URL (http://IPADDRESS:8088/asterisk/rawman)? Any help would be much appreciated.

                          Comment

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

                            #44
                            Originally posted by shaun_loureiro
                            Hey Guys.

                            So i am having problems getting this template to work. I have a test Zabbix server thats running 5.4.0beta1.(Will this template work with 5.4?) The guys that run the Asterisk box say they cant create a user (zabbix) as shown in the instructions. We can only use the admin user. Is this a problem? If i try the get_stats item i am just getting a "404 response code?" Does this mean that the config on the Asterisk side is wrong? This is the URL (http://IPADDRESS:8088/asterisk/rawman)? Any help would be much appreciated.
                            Yes, the template works with 5.4. You can use the admin user at one's own risk.
                            At least you should enable the mini-HTTP Server, add the option webenabled=yes in the general section of the manager.conf file

                            Comment

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

                              #45
                              Originally posted by rsafin
                              Hello Support team!
                              I have Asterisk 11.25 version, which monitored by zabbix 5.2 server using template_tel_asterisk_http. And everything is fine, but in my network I have E1 channels and I should to monitor them. Monitoring logically and physically state of this entities. Manually I make the following commands "ss7 show channels" and "dahdi show status" - for checking physically status of E1 cards.
                              Could you advise how I can monitor it in zabbix ? Or can I change or customize Asterisk template, cause I have no PJSIP and IAX and i could replace them.
                              Thank you in advance.
                              Hello. Could you share the AMI output of commands "ss7 show channels" and "dahdi show status"? Your collaboration would help to improve the template. Thanks.

                              Comment

                              Working...