Principle: Connect SQL Server via ODBC and send the data queried by SQL statements to the ZABBIX server for analysis.
Description of the configuration steps:
1. Install FreeTDS, UnixODBC, unixodbc-devel on Zabbix server so that it can access the SQL Server database.
2. Configure ODBC to access the SQL Server database.
3. Custom SQL statements
4. Add the Monitoring database item to the Zabbix management interface.
Operation Process:
1. Install FreeTDS, UnixODBC, unixodbc-devel on Zabbix server
#yum Install unixODBC unixodbc-devel
Note: FreeTDS is usually not in the Yum source and needs to be downloaded for compilation and installation
Baidu Cloud Address: Http://pan.baidu.com/s/1cb09tW
#wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
#tar-ZXVF freetds-stable.tgz
#cd freetds-0.91/
#./configure--prefix=/usr/local/freetds--with-tdsver=8.0--enable-msdblib
#make
#make Install
2. Configure ODBC access to the SQL Server database
A. Finding the location of the libtdsodbc.so.0 drive
#locate libtdsodbc.so.0
If there is no locate command, the installation mlocate executes
#yum Install mlocate && updatedb
After locating the libtdsodbc.so.0 file, copy its path to make a soft connection
#ln-S/usr/local/freetds/lib/libtdsodbc.so.0/usr/lib64/libtdsodbc.so.0
B. Modifying/etc/odbcinst.ini adding a row
#vim/etc/odbcinst.ini
[FreeTDS]
Driver =/usr/lib64/libtdsodbc.so.0
C. Configuring ODBC connection information
#vim/etc/odbc.ini #写入以下配置文件
[DBNAME] #定义的一个标识名
Driver = FreeTDS
Server = [SQL Server IP]
PORT = 1433
Tds_version = 8.0
D. Connect to the database test
#isql-v DBNAME(defined in Odbc.ini) database account password
Connect to the database and execute the SQL test
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8B/5C/wKiom1hKWjPgKeZFAAAWQq6got0375.png "title=" 11.PNG "alt=" Wkiom1hkwjpgkezfaaawqq6got0375.png "/>
3. Custom SQL statements vary according to requirements.
4. Add the Monitoring database item to the Zabbix management interface.
Locate the monitored SQL Server main clause, add item 650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/M02/8B/5C/wKiom1hKXp7ik0MrAAAtoRMb Ays646.png "title=" 2222.PNG "alt=" Wkiom1hkxp7ik0mraaatormbays646.png "/>
The data collected by the Zabbix. Consistent with the SQL query above.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8B/5C/wKiom1hKYSbDmB6iAAADMBURzWY466.png "title=" 333. PNG "alt=" Wkiom1hkysbdmb6iaaadmburzwy466.png "/>
This article from "Dance Demon" blog, reproduced please contact the author!
Zabbix Monitoring SQL Server databases