Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-6285

Oracle initial scheme creating and image loading in to the BLOB fields

    XMLWordPrintable

    Details

    • Team:
      Team C
    • Sprint:
      Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021)
    • Story Points:
      2

      Description

      When installing a ZABBIX server independent from Oracle RDBMS (not on a single server) - you will face the inconvenience of deploying the Zabbix database and the offered SQL files for creating an Oracle schema which comes with data and image data that is need to copy all images to the Oracle server fileystem (../misc/images/png_modern/* .png) to run this procedure later which loads the contents to the BLOB field from the filesystem files.

      CREATE OR REPLACE PROCEDURE LOAD_IMAGE (IMG_ID IN NUMBER, IMG_TYPE IN NUMBER, IMG_NAME IN VARCHAR2, FILE_NAME IN VARCHAR2)
      IS
              TEMP_BLOB BLOB := EMPTY_BLOB();
              BFILE_LOC BFILE;
      BEGIN
              DBMS_LOB.CREATETEMPORARY(TEMP_BLOB,TRUE,DBMS_LOB.SESSION);
              BFILE_LOC := BFILENAME('IMAGE_DIR', FILE_NAME);
              DBMS_LOB.FILEOPEN(BFILE_LOC);
              DBMS_LOB.LOADFROMFILE(TEMP_BLOB, BFILE_LOC, DBMS_LOB.GETLENGTH(BFILE_LOC));
              DBMS_LOB.FILECLOSE(BFILE_LOC);
              INSERT INTO IMAGES VALUES (IMG_ID, IMG_TYPE, IMG_NAME, TEMP_BLOB);
              COMMIT;
      END LOAD_IMAGE;
      /
      
      BEGIN
              LOAD_IMAGE(1,1,'Cloud_(128)','png_modern/Cloud_(128).png');
              LOAD_IMAGE(2,1,'Cloud_(24)','png_modern/Cloud_(24).png');
              ....
      

      Instead I suggest loading the contents of the BLOB fields from the CBLOB (created from the BASE64 string that contains the PNG image data).

      base64encode.sql
      base64decode.sql

      Or then create a column with text information (CLOB, VARCHAR2) which contains only BASE64 content, which can later be converted in the Zabbix UI using PHP to the displayed image.

      This is just to reduce the inconvenience and time saving. Even more a such a thing already exists in MySQL and PGSQL Zabbix provided source SQL files (images.sql) - and that is only natural

        Attachments

        1. BEGINNING_OF_DIFF.png
          BEGINNING_OF_DIFF.png
          90 kB
        2. END_OF_DIFF.png
          END_OF_DIFF.png
          91 kB
        3. map_error.gif
          map_error.gif
          1.82 MB

          Issue Links

            Activity

              People

              Assignee:
              ak Andrejs Kozlovs
              Reporter:
              radix Gatis Rumbens
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: