Ad Widget

Collapse

Template not linking to other template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tschwerz
    Junior Member
    • Oct 2017
    • 17

    #1

    Template not linking to other template

    Hi all

    I have a problem trying to apply a template to devices. The situation is as follows: We're monitoring a lot of network devices and have different templates for different customers and devices. We have been using the TEMPLATE_ICMP_PING as part of those templates until now, so we linked this template to our templates (among others). But now I want to make a few changes to the ICMP monitoring such as different triggers and also since it's not recommended to use the defaults template in production i'm trying to change the used template I took the following steps:
    • Clone the "TEMPLATE_ICMP_PING" template under a different name and not change any items
    • Go to one of our templates, unlink (without clearing) the "TEMPLATE_ICMP_PING" template
    • Linking the newly cloned template in its stead and click update



    What I intended to happen is that the items get then linked to the new template because it has the same items and actions and then I could adapt the new templates to our needs. I first tested this approach with a template which is just linked to a small number of hosts (about 10) and it worked perfectly as expected.
    The Problem: When I try to do the exact same thing for another template which is linked to more hosts (41 to be precise) it doesn't work. When I click on update zabbix loads for 2-3 seconds and then displays a blank page (see Screenshot). The template doesn't get linked no matter how long I wait or what I do.

    I don't think this approach should cause any issues since that's how templates are supposed to work and it doesn't make any sense if it's not working for only ~40 Hosts. I have some templates with way more hosts than that to which I want to do the same thing. Or am I wrong here?

    Does anybody have any experience with this issue?
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    Hi!

    I suggest you look at your webserver (apache?) error.log for any errors. Usually there are timeouts or not enough memory errors related to large update requests

    Regards,
    Kaspars

    Comment

    • tschwerz
      Junior Member
      • Oct 2017
      • 17

      #3
      Hi

      Thanks for your input. I had a look at the webserver logs (nginx) and I can't find anything usual. Here's the log outputs if I try to link the template and the two minutes afterwards:
      error.log
      access.log

      Comment

      • kaspars.mednis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2017
        • 349

        #4
        Hi,

        i found the following error in your error log

        2018/01/04 13:29:22 [info] 2606#2606: *2090240 client closed connection while waiting for request, client: 193.43.27.196, server: 0.0.0.0:443

        what are your php setings on:

        php_value max_execution_time
        php_value memory_limit
        php_value max_input_time
        php_value max_input_vars

        Comment

        • tschwerz
          Junior Member
          • Oct 2017
          • 17

          #5
          Hi, thanks for your help. These are the current parameters from /etc/httpd/conf.d/zabbix.conf:

          Code:
                  php_value max_execution_time 300
                  php_value memory_limit 128M
                  php_value post_max_size 16M
                  php_value upload_max_filesize 2M
                  php_value max_input_time 300
                  php_value always_populate_raw_post_data -1
          I can't find the "php_value max_input_vars" parameter in this file.

          Comment

          • kaspars.mednis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2017
            • 349

            #6
            You can specify it in this file

            Code:
            php_value max_input_vars 5000
            also you can increase memory limit for testing purpouses

            Code:
            php_value memory_limit 1024M
            Regards
            Kaspars

            Comment

            • tschwerz
              Junior Member
              • Oct 2017
              • 17

              #7
              I set the parameters according to your recommendation and then restarted the zabbix-server service and nginx but unfortunately I still get the same result on the web front-end and the same entry in the error.log
              Code:
              2018/01/04 15:39:38 [info] 2608#2608: *2096855 client closed connection while waiting for request, client: 172.23.130.251, server: 0.0.0.0:443

              Comment

              • kaspars.mednis
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2017
                • 349

                #8
                I still believe there can be some timeout or memory limit problem.
                Are your php errors logged somewhere ?

                Im not using nginx personally, but i have found some articles regarding php error logging with nginx


                redirect php-fpm output to nginx's error log. GitHub Gist: instantly share code, notes, and snippets.


                Maybe it helps

                Regards
                Kaspars

                Comment

                • tschwerz
                  Junior Member
                  • Oct 2017
                  • 17

                  #9
                  You might be right on that. I had a further look and found logs from php-fpm where I found this log-entry when I again tried to link the template:

                  [04-Jan-2018 16:03:37 Europe/Zurich] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /usr/share/zabbix/include/classes/debug/CProfiler.php on line 217

                  Comment

                  • kaspars.mednis
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Oct 2017
                    • 349

                    #10
                    Allowed memory size of 134217728 bytes exhausted
                    is because you have

                    php_value memory_limit 128M
                    just double it...

                    Code:
                     php_value memory_limit 256M
                    or even
                    Code:
                     php_value memory_limit 512M
                    until its enough...

                    Regards,
                    Kaspars

                    Comment

                    • aib
                      Senior Member
                      • Jan 2014
                      • 1615

                      #11
                      In addition, check "memory_limit" settings for php-fpm.
                      It can be somewhere like /etc/php5/fpm/php.ini
                      Use the same amount of memory as you configured in main php.ini
                      Code:
                      memory_limit = 512M
                      PS There is an article about increasing memory limit and checking that limits. https://tutorials.hostucan.com/how-t...-memory-limit/
                      Last edited by aib; 04-01-2018, 17:19.
                      Sincerely yours,
                      Aleksey

                      Comment

                      Working...