Ad Widget

Collapse

zabbix 7 image upload limit

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • neorejdv76
    Junior Member
    • Nov 2021
    • 15

    #1

    zabbix 7 image upload limit

    Hi,
    I am using zabbix 7.07 with Niginx, postgress, and timescaleDB.
    I want to upload an image to zabbix what has got a size of appox. 7Mb.
    (administration=>general=>images=> switch from icon to images.

    But in the upload process i am getting the error:
    Cannot add image: Image size must be less than 1 MB.

    I have looked for a solution and found serveral.
    They all do not allow me to upload files larger then te 1Mb.

    What i have tried sofar:
    - set the client_max_body_size 20M in the nginx.conf
    - set the value php_value[memory_limit] = 256M in /etc/zabbix/php-fpm.conf and /etc/php/8.2/fpm/php-fpm.conf
    - set the value php_value[post_max_size] = 20M in /etc/zabbix/php-fpm.conf and /etc/php/8.2/fpm/php-fpm.conf
    - set the valuw php_value[upload_max_filesize] = 20M in /etc/zabbix/php-fpm.conf and /etc/php/8.2/fpm/php-fpm.conf​
    - restart nginx,php8.2-fpm,zabbx-server services
    - restart the whole server

    Anyone a tip how to overcome the 1Mb limit in zabbix7?
  • Answer selected by neorejdv76 at 13-05-2025, 11:35.
    spaceboy
    Junior Member
    • Apr 2025
    • 2

    This was how i resolved mine, open the defines.inc.php file in a text editor.
    The file is usually located here: /usr/share/zabbix/ui/include/defines.inc.php
    Use nano (or your preferred editor): sudo nano /usr/share/zabbix/ui/include/defines.inc.php
    Find the line that defines the image size limit
    Press Ctrl + W and search for: ZBX_MAX_IMAGE_SIZE
    You’ll see something like this: define('ZBX_MAX_IMAGE_SIZE', ZBX_MEBIBYTE);
    Comment it out by adding // at the beginning of the line.

    Then add a new line with your desired limit in bytes. For example, for 30MB:
    // define('ZBX_MAX_IMAGE_SIZE', ZBX_MEBIBYTE);
    define('ZBX_MAX_IMAGE_SIZE', 31457280); // 30MB
    Press Ctrl + X, then Y to confirm changes, and Enter to save.

    Try uploading your image again
    Go back to the Zabbix UI and try uploading the image — it should now accept up to 30MB.

    Comment

    • Blevar
      Member
      • Jan 2025
      • 68

      #2
      You could try editing the MIN_PHP_UPLOAD_MAX_FILESIZE in the /usr/share/zabbix/ui/include/classes/setup/CFrontendSetup.php

      Comment

      • neorejdv76
        Junior Member
        • Nov 2021
        • 15

        #3
        Tried editing the file:
        /usr/share/zabbix/include/classes/setup/CFrontendSetup.php

        Unfortunately is does not bypasses the upload limit.

        Comment

        • fabricioagliardi
          Junior Member
          • Jan 2025
          • 10

          #4
          I'm looking for a solution too, zabbix 6.4 here

          Comment

          • neorejdv76
            Junior Member
            • Nov 2021
            • 15

            #5
            I still have not overcome this problem, Any one a (new) suggenstion?

            Comment

            • spaceboy
              Junior Member
              • Apr 2025
              • 2

              #6
              This was how i resolved mine, open the defines.inc.php file in a text editor.
              The file is usually located here: /usr/share/zabbix/ui/include/defines.inc.php
              Use nano (or your preferred editor): sudo nano /usr/share/zabbix/ui/include/defines.inc.php
              Find the line that defines the image size limit
              Press Ctrl + W and search for: ZBX_MAX_IMAGE_SIZE
              You’ll see something like this: define('ZBX_MAX_IMAGE_SIZE', ZBX_MEBIBYTE);
              Comment it out by adding // at the beginning of the line.

              Then add a new line with your desired limit in bytes. For example, for 30MB:
              // define('ZBX_MAX_IMAGE_SIZE', ZBX_MEBIBYTE);
              define('ZBX_MAX_IMAGE_SIZE', 31457280); // 30MB
              Press Ctrl + X, then Y to confirm changes, and Enter to save.

              Try uploading your image again
              Go back to the Zabbix UI and try uploading the image — it should now accept up to 30MB.

              Comment

              • neorejdv76
                Junior Member
                • Nov 2021
                • 15

                #7
                @spaceboy!
                I confirmed you awnser. It works. Thank you!

                Comment

                Working...