Ad Widget

Collapse

ORA-01804 when trying to configure Oracle monitoring with Zabbix Agent 2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GasperDBA
    Junior Member
    • Aug 2021
    • 6

    #1

    ORA-01804 when trying to configure Oracle monitoring with Zabbix Agent 2

    Greetings,

    I have configured Zabbix Agent 2 with Template DB Oracle by Zabbix Agent 2 on multiple hosts. It works on first host, on second host I get an error:

    Code:
    Connection failed: ORA-01804: Error while trying to retrieve text for error ORA-01804
    Oracle support says that this is due to error in timezone information, possible causes are:

    1. The *.dat files are not present in the default location
    - I have checked it and files are present in default location on both servers.

    2. There permission problems on the files in $ORACLE_HOME/oracore/zoneinfo
    - Files have read permissions.

    3. The ORA_TZFILE environment variable (which can be used to change the default file in use) is pointing to a nonexistent
    file.
    - ORA_TZFILE is not set.

    4. The file that is currently in use (timezlrg.dat by default) is corrupt.

    SYS@oracle> select filename, version from v$timezone_file;

    FILENAME VERSION
    -------------------- ----------
    timezlrg_32.dat 32

    I have checked all four of them and everything looks ok. There is also no error in setting session's timezone:

    alter session set time_zone = 'Europe/Berlin';
    Session altered.

    Oracle is not complaining, but Zabbix is still reporting that error under Configuration/Hosts/Discovery rules/Info.

    Does anyone have any idea, how to solve that error? Is it possible to trace/debug it somehow?

    Thank you for help!





    Servers details:

    - Zabbix server:

    Code:
    Static hostname: zabbix.local
    Icon name: computer-vm
    Chassis: vm
    Machine ID: c263009914614af3a62fbabe3e160140
    Boot ID: add04d5336a446efb6e141de04b12936
    Virtualization: xen
    Operating System: Oracle Linux Server 7.9
    CPE OS Name: cpe:/o:oracle:linux:7:9:server
    Kernel: Linux 4.1.12-124.48.5.el7uek.x86_64
    Architecture: x86-64
    Code:
    zabbix_server (Zabbix) 5.0.9
    Revision 4d07aaafe2 22 February 2021, compilation time: Feb 22 2021 12:32:13
    - First Oracle server:

    Code:
    Static hostname: oracle1.local
    Icon name: computer-vm
    Chassis: vm
    Machine ID: 64e580fc72174b90b1452aeca12b9348
    Boot ID: b0049786022b459194d94de215b6c51d
    Virtualization: xen
    Operating System: Oracle Linux Server 7.9
    CPE OS Name: cpe:/o:oracle:linux:7:9:server
    Kernel: Linux 4.14.35-2025.401.4.el7uek.x86_64
    Architecture: x86-64
    Code:
    zabbix_agent2 (Zabbix) 5.0.13
    Revision c218b76dad 28 June 2021, compilation time: Jun 28 2021 12:26:03
    Code:
    Oracle Version
    ----------------------------------------------------------------------
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.8.0.0.0
    Code:
    Environment variables:
    LD_LIBRARY_PATH=:/oracle/app/oracle/product/19.0.0/dbhome_1/lib
    ORACLE_HOME=/oracle/app/oracle/product/19.0.0/dbhome_1
    - Second Oracle server:

    Code:
    Static hostname: oracle2.local
    Icon name: computer-vm
    Chassis: vm
    Machine ID: 64e580fc72174b90b1452aeca12b9348
    Boot ID: f5f0ca0564424e0e97e4f4fbcb119018
    Virtualization: xen
    Operating System: Oracle Linux Server 7.7
    CPE OS Name: cpe:/o:oracle:linux:7:7:server
    Kernel: Linux 4.14.35-1902.6.6.el7uek.x86_64
    Architecture: x86-64
    Code:
    zabbix_agent2 (Zabbix) 5.0.13
    Revision c218b76dad 28 June 2021, compilation time: Jun 28 2021 12:26:03
    Code:
    Oracle Version
    ----------------------------------------------------------------------
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.8.0.0.0
    Code:
    Environment variables:
    LD_LIBRARY_PATH=:/oracle/app/oracle/product/19.0.0/dbhome_1/lib
    ORACLE_HOME=/oracle/app/oracle/product/19.0.0/dbhome_1
  • GasperDBA
    Junior Member
    • Aug 2021
    • 6

    #2
    I have enabled DebugLevel=5 and got some more information:

    Code:
    2021/08/20 14:29:29.470837 [1] processing update request (1 requests)
    2021/08/20 14:29:29.470851 [1] adding new request for key: 'oracle.archive.info["tcp://oracle2.local:1521","zabbix","<password>","<service_name>"]'
    2021/08/20 14:29:29.470859 [1] created direct exporter task for plugin 'Oracle' itemid:0 key 'oracle.archive.info["tcp://oracle2.local:1521","zabbix","<password>","<service_name>"]'
    2021/08/20 14:29:29.470897 executing direct exporter task for key 'oracle.archive.info["tcp://oracle2.local:1521","zabbix","<password>","<service_name>"]'
    2021/08/20 14:29:29.471347 [Oracle] Connection failed: ORA-01804: Error while trying to retrieve text for error ORA-01804.
    2021/08/20 14:29:29.471359 failed to execute direct exporter task for key 'oracle.archive.info["tcp://oracle2.local:1521","zabbix","<password>","<service_name>"]' error: 'Connection failed: ORA-01804: Error while trying to retrieve text for error ORA-01804.'
    2021/08/20 14:29:29.471410 sending passive check response: ZBX_NOTSUPPORTED: 'Connection failed: ORA-01804: Error while trying to retrieve text for error ORA-01804.' to '<zabbix_server_IP>'
    2021/08/20 14:29:29.473259 received passive check request: 'vfs.file.contents[/sys/block/xvdal/stat]' from '<zabbix_server_IP>'
    Now I am wondering where is the difference? Why it works on first server and says not supported on second one?

    Comment

    • GasperDBA
      Junior Member
      • Aug 2021
      • 6

      #3
      Found out that libociicus.so was missing. I have installed Oracle Instant Client, recompiled libociicus.so file, moved it to $ORACLE_HOME/lib folder and restarted the zabbix-agent2.

      Code:
      root@oracle2:tmp # rpm -Uvh oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm
      root@oracle2:tmp # rpm -Uvh oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
      Code:
      root@oracle2:tmp # yum list installed | grep instant
      oracle-instantclient19.8-basic.x86_64
      oracle-instantclient19.8-sqlplus.x86_64
      Code:
      mkdir -p $ORACLE_HOME/rdbms/install/instantclient/light
      cd $ORACLE_HOME/rdbms/lib
      make -f ins_rdbms.mk igenlibociicus
      # The newly regenerated libociicus.so is placed in the ORACLE_HOME/instantclient/light directory.

      Code:
      cp $ORACLE_HOME/rdbms/install/instantclient/light/libociicus.so $ORACLE_HOME/lib
      Code:
      service zabbix-agent2 stop
      service zabbix-agent2 start
      service zabbix-agent2 status
      Now zabbix-agent2 is monitoring both Oracle servers. I still do not know, how did it get the information without Oracle Instant Client installed in the first place.

      Anyway.. it works now.

      Regards,

      Gasper

      Comment

      • GasperDBA
        Junior Member
        • Aug 2021
        • 6

        #4
        After installing Oracle Instant Client, sqlplus reports an error:

        Code:
        SP2-0667: Message file sp1<lang>.msb not found
        SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
        To fix that, I had to move libsqlplusic.so to $ORACLE_HOME/lib directory:

        Code:
        oracle@oracle2:dbhome_1 $ pwd
        /oracle/app/oracle/product/19.0.0/dbhome_1
        oracle@oracle2:dbhome_1 $ cd bin
        oracle@oracle2:bin $ sqlplus / as sysdba
        Error 6 initializing SQL*Plus
        SP2-0667: Message file sp1<lang>.msb not found
        SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
        oracle@oracle2:bin $ env | grep ORACLE_HOME
        ORACLE_HOME=/oracle/app/oracle/product/19.0.0/dbhome_1
        oracle@oracle2:bin $ cd ../instantclient/
        oracle@oracle2:instantclient $ ls
        libsqlplusic.so
        oracle@oracle2:instantclient $ cp libsqlplusic.so ../lib
        oracle@oracle2:instantclient $ sqlplus / as sysdba
        
        SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 24 11:09:10 2021
        Version 19.8.0.0.0
        
        Copyright (c) 1982, 2019, Oracle. All rights reserved.
        
        Connected to:
        Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
        Version 19.8.0.0.0
        
        SQL> select * from dual;
        
        D
        -
        X
        And environment variables:
        Code:
        oracle@oracle2:bin $ env | grep 'LD_LIBRARY_PATH\|ORACLE_HOME'
        LD_LIBRARY_PATH=/oracle/app/oracle/product/19.0.0/dbhome_1/lib
        ORACLE_HOME=/oracle/app/oracle/product/19.0.0/dbhome_1
        Regards,

        Gasper

        Comment

        Working...