Ad Widget

Collapse

Databace Monitoring doesn't for Oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kanstantin_m
    Junior Member
    • Aug 2013
    • 6

    #1

    Databace Monitoring doesn't for Oracle

    Dear All

    I installed unixODBC and driver for Oracle, wrote parameters to tnsnames.ora,
    modifed /etc/odbcinst.ini and /etc/odbc.in, exported environment variables "LD_LIBRARY_PATH", "ORACLE_HOME" and "TNS_ADMIN", for user zabbix.
    So, "isql -v TEST" for user zabbix is OK.
    But, on web interface I see, that zabbix doesn’t check environment variables (Database item goes to not supported with error
    Code:
    “Cannot connect to ODBC DSN:[SQL_ERROR]:[01000][0][[unixODBC][Driver Manager]Can't open lib '/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1'”
    ).
    When I run “zabbix_get –s 127.0.0.1 –k system.run[set]” I also don’t see environment variables "LD_LIBRARY_PATH", "ORACLE_HOME" and "TNS_ADMIN".
    According to https://www.zabbix.com/wiki/non-engl...dbc_monitoring I tried to add export for variables in init script of zabbix_server and zabbix_agentd, but it didn’t help.
    I have zabbix 2.0.8 installed on CentOS 5.

    Is there any way to fix that?

    Thanks in advance.
    Last edited by Kanstantin_m; 24-08-2013, 15:14.
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    First zabbix_get is a command line utility for getting data from a remote Zabbix agent.

    I just setup one time ODBC for Oracle as an initial test.
    As far as I can remember I haven't set TNS_ADMIN & Co:
    Code:
    # tail -n3 /etc/odbcinst.ini
    [Oracle 10g ODBC driver]
    Description = Oracle ODBC driver for Oracle 10g
    Driver = /opt/instantclient_10_2/libsqora.so.10.1
    Code:
    # cat /var/lib/zabbix/.odbc.ini
    [MYDB]
    Driver = Oracle 10g ODBC driver
    DSN = MYDB
    ServerName = //host.example.com:1521/mydb.example.com
    UserID = scott
    Password = secret
    And finally restarted Zabbix proxy

    Edit:
    LD_LIBRARY_PATH has to be set of course anyway:
    Code:
    # cat /etc/sysconfig/zabbix
    LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
    export LD_LIBRARY_PATH
    Code:
    # grep -C2 sysconfig /etc/init.d/zabbix-proxy
    . /etc/rc.d/init.d/functions
    
    # Source sysconfig.
    . /etc/sysconfig/zabbix
    
    if [ -x /usr/sbin/zabbix_proxy ]; then
    Last edited by BDiE8VNy; 31-08-2013, 20:40.

    Comment

    • Kanstantin_m
      Junior Member
      • Aug 2013
      • 6

      #3
      Dear BDiE8VNy,

      Thanks for your help.
      I created /etc/sysconfig/zabbix with LD_LIBRARY_PATH.
      It resolved my problem.

      Just FYI
      Zabbix_get works for local agent as well as for remote agent.
      Please see https://www.zabbix.com/documentation...l/concepts/get
      Code:
      shell> ./zabbix_get -s [B]127.0.0.1[/B] -p 10050 -k "system.cpu.load[all,avg1]"
      Thanks again.

      Comment

      • BDiE8VNy
        Senior Member
        • Apr 2010
        • 680

        #4
        Sorry, I haven't read precisely enough. I thought you're trying to do odbc queries via agent by zabbix_get.

        My bad!

        Comment

        Working...