Ad Widget

Collapse

Zabbix and enviroment variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Viggi
    Junior Member
    • Jul 2016
    • 3

    #1

    Zabbix and enviroment variables

    Hi, I'm new to Zabbix as I've installed Zabbix 3.0 for the first time on a Centos distribution. The problem is that I want to monitor some Oracle database, so I set up unixODBC and Oracle client software.
    I can connect to my db with ODBC (isql -v connects), but when i configure an item it give an error: cannot connect to ODBC DSN ... Can't open lib /usr/lib/oracle/11.2/client64/lib/libsqora.so: file not found.

    Since I had the same error when I was configuring my installation, and the issue was that I haven't the right environment variables set, I was trying to set that variables for the zabbix server service, but I'm not familiar with linux so I'm struck.

    I've put the export of the variables in a zabbix-server file in /etc/sysconfig, but it seems to not to do any good. The file is processed, I think, because when I've mistaken the syntax or something Zabbix encountered problems.
    But I can't manage to have the LD_LIBRARY_PATH, that I think is the variable that I need, to show in the ENV of the Zabbix server service (I've created an item to report this).

    The zabbix_server file is quite simple:
    export ORACLE_HOME=/usr/lib/oracle/11.2/client64
    export PATH=/usr/lib/oracle/11.2/client64/bin:$PATH
    export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
    export TNS_ADMIN=/etc

    I'm sure I miss something easy... I don't know if this is the right way, or the problem is truly that.

    If someone has any idea, thank you.
  • mortuletti
    Member
    • May 2016
    • 76

    #2
    Hi!
    Problem can be related to permissions for user under which Zabbix is running. Check permissions or run Zabbix under root account (just for test). It can be done by modifying zabbix_server.conf file:
    AllowRoot=1
    User=root

    As well can check configuration according to instruction and pictures below. Example is for MySQL, but idea is the similar.

    1. check list of available ODBC drivers in the /etc/odbcinst.ini file. On attached example we have [MySQL] - this is name of ODBC driver.
    2. create file /etc/odbc.ini and it must contain (example attached):

    [dsnname] - this name will be used in Zabbix as DSN
    Driver = MySQL - driver name from odbcinst.ini file
    Server = 127.0.0.1 - where to connect
    Port = 3306
    Database = DBname

    If everything is ok, database should be available by running "isql dsnname" command and
    "dsnname" can be used for item configuration.

    Hope this information was useful.

    Br, Alexander
    Attached Files

    Comment

    • Viggi
      Junior Member
      • Jul 2016
      • 3

      #3
      I've finally found!
      The problem was different, it was selinux that blocked access on remote database.
      I've found some instructions on the web on how to resolve selinux problems, using sealert to find errors and fix them.

      Thank you for your help anyway.

      Comment

      • Viggi
        Junior Member
        • Jul 2016
        • 3

        #4
        The link that helped me was this: http://www.serverlab.ca/tutorials/li...entos-red-hat/
        The part "SELinux Alerts".
        Last edited by Viggi; 13-07-2016, 12:17.

        Comment

        • mortuletti
          Member
          • May 2016
          • 76

          #5
          Hi Viggi!
          Thank you for info!
          Br, Alexander

          Comment

          • DiViNe
            Member
            • Feb 2015
            • 30

            #6
            Centos7 and env problems

            Heya!

            I'm using CentOS 7 and I do have the same problem.

            Zabbix server doesen't get my enviorement variable even though I've put it in .bash_profile of the zabbix user.
            strings -a /proc/<zabbix pid>/environ
            LANG=en_US.UTF-8
            PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
            CONFFILE=/etc/zabbix/zabbix_server.conf

            SELinux is disabled.

            Here are more infos:

            Comment

            Working...