Instalación de ODBC para Zabbix

From Zabbix-ES
Jump to navigation Jump to search

Instalacion de ODBC en Zabbix

# yum -y install unixODBC unixODBC-devel

Instalamos los drivers que necesitemos

Nota: En la siguiente URL tenemos todos los drivers disponibles. http://www.unixodbc.org/drivers.html
# yum list *-odbc
# yum install mysql-connector-odbc
# yum install postgresql-odbc

Configuramos los drivers [odbcinst.ini]

# vi /etc/odbcinst.ini
# Driver from the postgresql-odbc package
# Setup from the unixODBC package
[PostgreSQL]
Description     = ODBC for PostgreSQL
Driver          = /usr/lib/psqlodbcw.so
Setup           = /usr/lib/libodbcpsqlS.so
Driver64        = /usr/lib64/psqlodbcw.so
Setup64         = /usr/lib64/libodbcpsqlS.so
FileUsage       = 1


# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description     = ODBC for MySQL
Driver          = /usr/lib/libmyodbc5.so
Setup           = /usr/lib/libodbcmyS.so
Driver64        = /usr/lib64/libmyodbc5.so
Setup64         = /usr/lib64/libodbcmyS.so
FileUsage       = 1

Configuramos el datasource [odbc.ini]

# vi /etc/odbc.ini
[DBTest]
Description = MySQL test database
Driver      = MySQL
Server      = 127.0.0.1
User        = root
Password    =
Port        = 3306
Database    = zabbix
[zbxssoodb]
Driver     = PostgreSQL
Servername = 127.0.0.1
Port       = 5432
Database   = zabbix
Username   = zabbix
Password   = MiPassword
# chmod 600 /etc/odbc.ini 

Verificamos la configuracion

# odbcinst -j

Probamos el Driver

# isql zbxssoodb
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit