下面看下zabbix监控sqlserver。首先下载安装freetds
1
2
3
4
5
|
wget -c 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 && makeinstall
|
FreeTDS默认安装在/usr/local/freetds目录当中,库文件在相应的lib目录下。
1
2
|
#vim /etc/ld.so.conf
/usr/local/freetds/lib
|
配置生效
1
|
#ldconfig
|
修改/usr/local/freetds/etc/freetds.conf
全局配置版本号tds version为8.0
1
2
3
4
5
|
#vim /usr/local/freetds/etc/freetds.conf
[global]
# TDS protocol version
; tds version = 4.2
tds version = 8.0
|
连接测试
1
|
/usr/local/freetds/bin/tsql -H 192.168.31.158 -p 1433 -U sa -P 12345678
|
安装unixODBC unixODBC-devel
1
|
yum -y install unixODBC unixODBC-devel
|
修改配置
1
2
3
|
#vim /etc/odbcinst.ini
[FreeTDS]
Driver = /usr/local/freetds/lib/libtdsodbc .so.0
|
1
2
3
4
5
6
7
8
9
10
11
12
|
#vim /etc/odbc.ini
[sql1]
Driver = FreeTDS
Server = 192.168.31.158
PORT = 1433
TDS_Version = 8.0
[sql2]
Driver = FreeTDS
Server = 192.168.31.159
PORT = 1433
TDS_Version = 8.0
|
测试连接
1
2
3
4
5
6
7
8
9
10
|
#isql -v sql1 sa 12345678
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
|
选择模板
到此这篇关于zabbix监控sqlserver的文章就介绍到这了,更多相关zabbix监控sqlserver内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!
原文链接:https://www.cnblogs.com/gkmin/p/15427716.html