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

    #61
    Originally posted by thesNu

    Thanks for reply, i've set all permissions, now CoreStatus shows


    Response: Success
    CoreStartupDate: 2021-02-11
    CoreStartupTime: 16:28:40
    CoreReloadDate: 2021-05-20
    CoreReloadTime: 16:15:05
    CoreCurrentCalls: 26

    but Asterisk: has been reloaded (uptime < 10m) problem still presents
    Are you sure that you have the same system DateTime on Zabbix server and Asterisk?
    This is an expression to calculate item asterisk.uptime_reload : (Date.now() - Date.parse(coreStatus.CoreReloadDate + " " + coreStatus.CoreReloadTime)) / 1000
    You have a negative value of asterisk.uptime_reload. It seems Zabbix server system time is less than Asterisk system time. I guess Zabbix server timezone is +0.

    Comment

    • thesNu
      Junior Member
      • May 2021
      • 5

      #62
      i've checked first of all

      zabbix
      timedatectl
      Local time: Fri 2021-05-21 13:15:20 +10
      Universal time: Fri 2021-05-21 03:15:20 UTC
      RTC time: Fri 2021-05-21 03:15:20
      Time zone: Asia/Vladivostok (+10, +1000)
      System clock synchronized: yes
      NTP service: n/a
      RTC in local TZ: no

      asterisk
      timedatectl
      Local time: Fri 2021-05-21 13:14:47 +10
      Universal time: Fri 2021-05-21 03:14:47 UTC
      RTC time: Fri 2021-05-21 03:14:49
      Time zone: Asia/Vladivostok (+10, +1000)
      NTP enabled: yes
      NTP synchronized: no
      RTC in local TZ: no
      DST active: n/a

      maybe function Date.now or CoreReloadDate doesn't take Time zone setting, it seems so

      Expression from template last(/Asterisk by HTTP/asterisk.uptime_reload)<10m
      Last edited by thesNu; 21-05-2021, 07:22.

      Comment

      • thesNu
        Junior Member
        • May 2021
        • 5

        #63
        Yes, Date.now() function returned UTC time without offset

        updated code works for me:

        var localDate = new Date(Date.now());

        if (typeof coreStatus.CoreReloadDate !== 'undefined') {
        asterisk.uptime_reload = ((localDate.getTime()-localDate.getTimezoneOffset()*60000) - Date.parse(coreStatus.CoreReloadDate + " " + coreStatus.CoreReloadTime)) / 1000;
        }
        Last edited by thesNu; 24-05-2021, 05:17.

        Comment

        • dedy
          Senior Member
          • Sep 2018
          • 203

          #64

          Help me please. In what format should the macro be specified to define the trunks? For example, I indicated ^(\d{4}) but nothing works.

          Comment

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

            #65
            Originally posted by dedy
            Help me please. In what format should the macro be specified to define the trunks? For example, I indicated ^(\d{4}) but nothing works.
            This ^\\d{4} works

            Comment

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

              #66
              Originally posted by thesNu
              Yes, Date.now() function returned UTC time without offset

              updated code works for me:

              var localDate = new Date(Date.now());

              if (typeof coreStatus.CoreReloadDate !== 'undefined') {
              asterisk.uptime_reload = ((localDate.getTime()-localDate.getTimezoneOffset()*60000) - Date.parse(coreStatus.CoreReloadDate + " " + coreStatus.CoreReloadTime)) / 1000;
              }
              Calculating of Uptime item changed in task https://support.zabbix.com/browse/ZBX-19344.

              Comment

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

                #67
                Originally posted by jrsemler

                max.ch.88 Here is the response that I get:

                Code:
                root@zabbix-srv:~# curl -I http://[B]ZABBIX_IP[/B]:8088/rawman?action=login&userman=zabbix&secret=SuperSecret
                [1] 15794
                [2] 15795
                root@zabbix-srv:~# HTTP/1.1 200 OK
                Server: Asterisk/17.9.3
                Date: Wed, 19 May 2021 13:19:02 GMT
                Cache-Control: no-cache, no-store
                Content-type: text/plain
                Set-Cookie: mansession_id="0a915a0b"; Version=1; Max-Age=60
                Pragma: SuppressEvents
                Content-Length: 51
                Hello. Probably you have enabled PJSIP driver without PJSIP endpoints. Please, try the latest version of the template. https://git.zabbix.com/projects/ZBX/...Frelease%2F5.0

                Comment

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

                  #68
                  Originally posted by shdwlynx
                  Glad to hear that the Zabbix team has updated the template. Our SIP provider does not limit active channels per trunk. Instead, they have an overall total limit, hence why we needed a data value (and, more importantly, triggers/macros) to monitor that sum of active channels across all trunks. We did test it, varying the number of active channels per trunk, but changing the total active channels across all trunks together, and it worked like a charm.
                  Please, try the latest version of the template. https://git.zabbix.com/projects/ZBX/...Frelease%2F5.0
                  Your items and triggers have been added.

                  Comment

                  • shdwlynx
                    Junior Member
                    • Apr 2021
                    • 4

                    #69
                    Originally posted by max.ch.88

                    Please, try the latest version of the template. https://git.zabbix.com/projects/ZBX/...Frelease%2F5.0
                    Your items and triggers have been added.
                    Ah, I see the changes now. Nicely done and thanks for adding our bits!

                    Comment

                    • Giacomo
                      Junior Member
                      • Dec 2020
                      • 14

                      #70
                      Hi All,

                      I've installed the latest version of the template.
                      On "latest data" I see 28 items.
                      I see "trunk active channels" (SIP, IAX, PJSIP) but nothing about Trunk Status.

                      Any hint?

                      Thank you!

                      Comment

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

                        #71
                        Originally posted by Giacomo
                        Hi All,

                        I've installed the latest version of the template.
                        On "latest data" I see 28 items.
                        I see "trunk active channels" (SIP, IAX, PJSIP) but nothing about Trunk Status.
                        Hi. As a trunk is considered any peer which contains the value of {$AMI.TRUNK_REGEXP} macro in self-name. By default {$AMI.TRUNK_REGEXP} equal 'trunk'.

                        Comment


                        • Giacomo
                          Giacomo commented
                          Editing a comment
                          It works now!
                          Thank you very much!

                        • Giacomo
                          Giacomo commented
                          Editing a comment
                          Hi!
                          I can see now the status of the Trunk as "peer", but not if it's registered (e.g. from sip show registry).
                          Is there a way to have such feedback?
                      • luanpontes100
                        Junior Member
                        • Aug 2021
                        • 1

                        #72
                        Hi, I'm trying to use this template to many hosts I have, but everytime I have to change the macro {$AMI.URL} with the dns name, I tried to use {HOST.DNS} to avoid changing but it does not work. How do I proceed? Or is there no way to do this?

                        Comment

                        • sysboss_
                          Junior Member
                          • Nov 2021
                          • 1

                          #73
                          Hi!
                          Everything is working fine, with the exception of discovery.
                          Only Queue items are being discovered.
                          Checking the LOG, I saw that Asterisk is responding correctly to discovery requests.

                          Can anyone give me a clue?

                          Comment

                          • jolsoto
                            Junior Member
                            • Feb 2022
                            • 1

                            #74
                            Originally posted by max.ch.88

                            Hi. As a trunk is considered any peer which contains the value of {$AMI.TRUNK_REGEXP} macro in self-name. By default {$AMI.TRUNK_REGEXP} equal 'trunk'.
                            The same problem, i tried with 'trunk', 'peer' and some regex but not trunk status data.
                            Could you help me please?

                            Comment

                            • roundst
                              Junior Member
                              • Apr 2022
                              • 1

                              #75
                              Morning All

                              I have 3 asterisk boxes that I would like to monitor. I have it working on 1 due to changing the template to have the IP of that box. ({$AMI.URL} - http://192.168.16.8:8088/rawman)

                              I suspect it is possible to change the IP address to a variable to monitor multiple boxes, but I tried leaving it at asterisk which came back with 'could not resolve host'. I also tried {host.host}

                              Can anyone advise, or point me in the right direction of the variable.

                              Thanks

                              Chris

                              Comment

                              Working...