Ad Widget

Collapse

Discussion thread for official Zabbix Template Asterisk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • datacare
    Junior Member
    • Dec 2021
    • 22

    #91
    I like this template and have it working on Zabbix 6.0 with Freepbx just fine.

    My only question is can there be a way to show "calls processed" in a time like today instead of since asterisk restart. I would like to show the calls processed so far today. If anyone can help with modifying this item I would greatly appreciate it!!

    Rob

    Comment

    • zavvin
      Junior Member
      • Oct 2019
      • 2

      #92
      Hello, Zabbix 6.2.6, Freepbx15, Asterisk 15, the data element "Asterisk: Get Stats" returns an error "Cannot perform request: Received HTTP/0.9 when not allowed". Can I somehow fix it yourself? Thank you.

      Comment

      • defkev
        Junior Member
        • Dec 2022
        • 2

        #93
        Originally posted by zavvin
        Cannot perform request: Received HTTP/0.9 when not allowed
        Since i just ran into this myself, you are trying to connect to AMI using HTTP, which of course doesn't work.

        In addition to enabling the web manager in manager.conf (webenabled=yes) you also need to enable the embedded (mini) http server in http.conf, the bare minimum looks like:

        Code:
        [general]
        enabled = yes
        bindaddr = <your_asterisk_ipv4>
        Note you will have to update the {$AMI.URL} macro to http://<your_asterisk_ipv4>:8088/rawman because the default prefix is blank.

        Cheers​

        Comment

        • Gofaizen
          Junior Member
          • Apr 2022
          • 8

          #94
          Hello.....
          I have error message in zabbix_server.log after I have upgraded Zabbix server from 6.2.7 to 6.2.8 :

          1735820:20230309:173014.360 error reason for "sip:asterisk.get_stats" changed: Preprocessing failed for: HTTP/1.1 200 OK..Server: sip.samtelecom.ru..Date: Thu,
          09 Mar 2023 13:30:12 GMT..Cache-Control: n...
          1. Failed: Error: log exceeds the maximum size of 8388608 bytes.
          at [anon] (zabbix.c:84) internal
          at [anon] () native strict preventsyield
          at [anon] (function:10)
          at [anon] (function:256) preventsyield

          Everything worked fine before upgrade.

          Can anyone help in solving this problem ?

          Comment

          • basildane
            Junior Member
            • Apr 2022
            • 4

            #95
            I've been using this template for years and it worked great! I just upgrade Zabbix to 6.4, and now it is broken.
            Every item returns this error:

            Code:
            Preprocessing failed for: Preprocessing failed for: HTTP/1.1 200 OK..Server: Asterisk/19.8.0..Date: Fri, 10 Mar 2023 17:14:...
            1. Failed: cannot extract value from json by path "$.version": cannot convert value to string
            I also tested AMI manually http://server:8088/rawman?action=log...XXX&secret=XXX
            And it works normally.

            Any thoughts?

            Comment

            • cmartin510
              Junior Member
              • Mar 2023
              • 1

              #96
              I am having the same issue after upgrading to 6.4 as well. The issue stems from the JavaScript in the GetStats item. I tried to find what log size was being exceeded. After looking through the 6.4 manual regarding preprocessing and the JavaScript objects section (https://www.zabbix.com/documentation...script_objects) I noticed it says 'The total size of all logged messages is limited to 8 MB per script execution.'. So to test, I commented out the 3 places at the top of the script with 'Zabbix.log(...'. After that the script has run without error. I don't think of this as a solution, but a workaround until the actual cause of the log size being exceeded can be determined.

              Comment

              • micah.quinn
                Junior Member
                • Mar 2023
                • 1

                #97
                I can confirm the same behaviour after upgrading to 6.4 Removing the Zabbix.log lines in the Asterisk template prevent the preprocessing from erroring out and the subsequent problems. Before commenting out the log lines I tried increasing the maximum log size to 32M, but that did not help.

                Comment

                • elefuntik
                  Junior Member
                  • Apr 2023
                  • 1

                  #98
                  Hi everyone, I need help. I'm trying to set up asterisk template and I have a problem "Cannot perform request: Couldn't connect to server"



                  Zabbix-server 192.168.5.5
                  FreePBX 192.168.5.3



                  Zabbix-Server Version is​ 6.2.9


                  I'm using FreePBX-Distro with Asterisk 16
                  ​​


                  Status firewalld on zabbix-server​ inactive
                  Status iptables on freepbx-distro​ inactive



                  timedatectl

                  on Zabbix-server:

                  Code:
                  [root@zabbix62 ~]# timedatectl
                                 Local time: Wed 2023-04-05 11:17:27 +03
                             Universal time: Wed 2023-04-05 08:17:27 UTC
                                   RTC time: Wed 2023-04-05 08:17:24
                                  Time zone: Europe/Minsk (+03, +0300)
                  System clock synchronized: no
                                NTP service: n/a
                            RTC in local TZ: no​

                  on FreePBX-Distro:
                  Code:
                  [root@freepbx ~]# timedatectl
                        Local time: Wed 2023-04-05 11:03:58 +03
                    Universal time: Wed 2023-04-05 08:03:58 UTC
                          RTC time: Wed 2023-04-05 11:03:53
                         Time zone: Europe/Minsk (+03, +0300)
                       NTP enabled: no
                  NTP synchronized: no
                   RTC in local TZ: yes
                        DST active: n/a
                  
                  Warning: The system is configured to read the RTC time in the local time zone.
                           This mode can not be fully supported. It will create various problems
                           with time zone changes and daylight saving time adjustments. The RTC
                           time is never updated, it relies on external facilities to maintain it.
                           If at all possible, use RTC in UTC by calling
                           'timedatectl set-local-rtc 0'.​


                  /etc/asterisk/manager.conf

                  Click image for larger version

Name:	image.png
Views:	1577
Size:	70.6 KB
ID:	462504

                  From Zabbix-server to FreePBX-Distro

                  Click image for larger version

Name:	image.png
Views:	1569
Size:	55.8 KB
ID:	462505

                  Code:
                  [root@zabbix62 ~]# telnet 192.168.5.3 5038
                  Trying 192.168.5.3...
                  Connected to 192.168.5.3.
                  Escape character is '^]'.
                  Asterisk Call Manager/5.0.3​



                  Macros in Asterisk template:

                  Click image for larger version

Name:	image.png
Views:	1563
Size:	88.5 KB
ID:	462506
                  ​​​​​
                  Attached Files

                  Comment


                  • binlog
                    binlog commented
                    Editing a comment
                    Hi, elefuntik. Did you find a solution?

                  • kb9mfd
                    kb9mfd commented
                    Editing a comment
                    Was there a solution for this? I am having the exact same issue and cannot find a solution. I have everything correct and did the same tests and am getting the same results, I can connect from the zabbix server on the command line but zabbix says it cannot connect in recent data. Everything is a fresh install of the latest.

                  • kb9mfd
                    kb9mfd commented
                    Editing a comment
                    Ok, found the solution. Ran across this post - https://www.zabbix.com/forum/zabbix-...ports-from-gui - and found zabbix by default blocks all ports (except 22, 80, 443, 10050) and you have to do this command - "setsebool -P zabbix_can_network on" (Linux) to get it to allow all ports, after that it worked just fine.
                • support@semperco.fr
                  Junior Member
                  • Jun 2023
                  • 3

                  #99
                  Discovery of PJSIP Accounts and Alerting for No Connected Devices

                  Hello everyone,

                  I'm reaching out to discuss the official Zabbix Template Asterisk and its monitoring capabilities for PJSIP accounts. Currently, the template works well for monitoring overall Asterisk metrics, but I would like to extend its functionality to discover each PJSIP account and generate an alert if no devices are connected to it.

                  I've reviewed the existing template and noticed that it focuses on general Asterisk monitoring, but it doesn't provide detailed information about individual PJSIP accounts and their associated devices. I believe it would be beneficial to have a separate template or an enhancement to the existing template that allows listing the PJSIP accounts and their associated devices without overloading the current template.

                  My goal is to monitor each PJSIP account separately and generate an alert when no devices are connected. This would help me ensure that all PJSIP accounts have at least one active device connected, enabling proactive troubleshooting and ensuring the availability of the accounts.

                  I would greatly appreciate any insights, suggestions, or guidance on how to achieve this with Zabbix. If there are any existing templates or scripts that can help with this specific requirement, I would be grateful for the pointers.

                  Thank you in advance for your assistance and expertise.

                  Best regards,

                  Comment


                  • uplync
                    uplync commented
                    Editing a comment
                    Semperco-

                    Did you get any traction on your request to monitor individual PJSIP endpoints? I'm looking for the same thing. Thanks!
                • DeAngeloVickers
                  Junior Member
                  • Dec 2023
                  • 1

                  #100
                  Where do you find the Asterisk Manager API URL?

                  The /rawman one doesn't seem to work and I suspect that most of this thread is outdated...

                  I'm using FreePBX on AWS. I have the mini http server turned on (although I can't seem to curl it), and I have an AMI manager created.

                  I see people on here got it to work and I wonder how because there's absolutely no documentation on how to do it. This thread is the only thing that comes close and it's only because people can confirm it working for FreePBX .​

                  Comment

                  • Hamidz
                    Junior Member
                    • Aug 2024
                    • 1

                    #101
                    hello. what is this error ?
                    asterisk server is member of vicibox
                    • TypeError: cannot read property 'replace' of undefined at [anon] (duktape.c:60534) internal at escapeChars (function:215) at [anon] (function:181) preventsyield at forEach () native strict preventsyield at getIaxPeerList (function:184) at [anon] (function:295) preventsyield

                    Comment

                    • Megachip
                      Junior Member
                      • May 2025
                      • 16

                      #102
                      Originally posted by defkev

                      Since i just ran into this myself, you are trying to connect to AMI using HTTP, which of course doesn't work.

                      In addition to enabling the web manager in manager.conf (webenabled=yes) you also need to enable the embedded (mini) http server in http.conf, the bare minimum looks like:
                      This really should mentioned in template Cause its disabled by default and confusion user.

                      Also is it required to use web (8088) and ami (5038)?

                      Comment


                      • Megachip
                        Megachip commented
                        Editing a comment
                        Also which read rights are required? Template documentation only mentioned 2 writes.
                    • Megachip
                      Junior Member
                      • May 2025
                      • 16

                      #103
                      Originally posted by max.ch.88


                      Unfortunately, read permission is not enough. Asterisk requires "system" and "command" write permissions to get the AMI response for "CoreStatus" and "core show channels" requests.
                      Seems not be Enough

                      with
                      Code:
                      read = system,call,log,verbose,command,agent,user
                      write = system, command
                      i've got:
                      Code:
                        == HTTP Manager 'monitoring' logged on from 1.2.3.4
                        == HTTP Manager 'monitoring' timed out from 1.2.3.4
                        == Connect attempt from '1.2.3.4' unable to authenticate
                        == Connect attempt from '1.2.3.4' unable to authenticate
                        == HTTP Manager 'monitoring' logged on from 1.2.3.4
                      with write=all it works.

                      So which rights (read an write) are required for monitoring?

                      Comment

                      • Megachip
                        Junior Member
                        • May 2025
                        • 16

                        #104
                        Can we have pjsip show registrations and maybe pjsip show transport-monitors as an seperate item?
                        Last edited by Megachip; 02-07-2025, 14:18.

                        Comment

                        • shevchenkosia
                          Junior Member
                          • Jul 2025
                          • 2

                          #105
                          Hello everyone, does anyone use the official template template_tel_asterisk_http.yaml? I set it up with freepbx, I get data but I need to get the IAX trunk status. The manual says that Discovery should work but it doesn't work for me and I don't see any errors. What should I do? Does Discovery work for anyone?
                          I have 38 item and they work but new ones don't appear.

                          This XML file does not appear to have any style information associated with it. The document tree is shown below.

                          HTML Code:
                          ]<ajax-response>
                          <script/>
                          <response type="object" id="unknown">
                          <generic response="Success" eventlist="start" message="Peer status list will follow"/>
                          </response>
                          <response type="object" id="unknown">
                          <generic event="PeerEntry" channeltype="IAX2" objectname="iax_dtc_idp/iax_dtc_idp" chanobjecttype="peer" ipaddress="192.168.98.14" ipport="4569" dynamic="no" trunk="yes" encryption="(aes128,keyrotate)" status="OK (20 ms)" description=""/>
                          </response>
                          <response type="object" id="unknown">
                          <generic event="PeerEntry" channeltype="IAX2" objectname="iax_dtc_idp_test/iax_dtc_idp_test" chanobjecttype="peer" ipaddress="192.168.98.114" ipport="4569" dynamic="no" trunk="yes" encryption="(aes128,keyrotate)" status="UNREACHABLE" description=""/>
                          </response>
                          <response type="object" id="unknown">
                          <generic event="PeerEntry" channeltype="IAX2" objectname="iax_idp_avto_pbx02/iax_idp_avto_pbx02" chanobjecttype="peer" ipaddress="192.168.1.14" ipport="4569" dynamic="no" trunk="yes" encryption="(aes128,keyrotate)" status="OK (20 ms)" description=""/>
                          </response>
                          <response type="object" id="unknown">
                          <generic event="PeerlistComplete" eventlist="Complete" listitems="3"/>
                          </response>
                          </ajax-response>
                          I receive data from freepbx correctly
                          Attached Files
                          Last edited by shevchenkosia; 24-07-2025, 15:51.

                          Comment

                          Working...