zabbix监控sqlserver的过程详解
程序员文章站
2022-03-06 21:45:10
下面看下zabbix监控sqlserver。首先下载安装freetdswget -c http://ibiblio.org/pub/linux/alpha/freetds/stable/freetds...
下面看下zabbix监控sqlserver。首先下载安装freetds
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目录下。
#vim /etc/ld.so.conf /usr/local/freetds/lib
配置生效
#ldconfig
修改/usr/local/freetds/etc/freetds.conf
全局配置版本号tds version为8.0
#vim /usr/local/freetds/etc/freetds.conf [global] # tds protocol version ; tds version = 4.2 tds version = 8.0
连接测试
/usr/local/freetds/bin/tsql -h 192.168.31.158 -p 1433 -u sa -p 12345678
安装unixodbc unixodbc-devel
yum -y install unixodbc unixodbc-devel
修改配置
#vim /etc/odbcinst.ini [freetds] driver = /usr/local/freetds/lib/libtdsodbc.so.0
#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
测试连接
#isql -v sql1 sa 12345678 +---------------------------------------+ | connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ sql>
选择模板
到此这篇关于zabbix监控sqlserver的文章就介绍到这了,更多相关zabbix监控sqlserver内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!