【发布时间】:2015-08-17 22:33:06
【问题描述】:
我想用 Nagios 监控 Azure Paas 数据库。我正在使用https://github.com/MsOpenTech/WaMo 上提供的这个插件
当我尝试检查数据库时: ./check_azure_sql.py -u -p -d -k top5queries
我收到此错误消息:
('08001', '[08001] [unixODBC][FreeTDS][SQL Server]无法连接到数据源 (0) (SQLDriverConnect)') 连接数据库时出错
已安装所有依赖项(在 GitHub 插件站点中列出)。
在这里你可以看到我的 /etc/odbcinst.ini:
[ODBC]
Trace = Yes
TraceFile = /tmp/odbc.log
[FreeTDS]
Description = ODBC For TDS
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
UsageCount = 1
在这里你可以看到我的/etc/freetds/freetds.conf:
# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
; tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0
# A typical Microsoft server
[egServer70]
host = ntmachine.domain.com
port = 1433
tds version = 7.0
而我的 /etc/odbc.ini 是空的。
有人知道吗?
【问题讨论】:
-
嗨,凯文,我想了解您到底想做什么?如果您实际上是在尝试使用 python 连接到 Azure SQL DB/SQL Server,那么有一种更简单的方法(使用 pymmsql)
-
Hello meet-bhagdev,简单来说,我正在尝试使用 nagios 监控 Sql 数据库 Azure Paas。 github.com/MsOpenTech/WaMo 提供的插件不是我编写的。对于 nagios 管理员,我只需要从 debian linux cli 执行命令 ./check_azure_sql.py -u (username) -p (password) -d (database) -k (key) (check_azure_sql.py 用 python 编写)。因此,当我执行上面的命令时,我收到错误消息 ('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)') 连接数据库时出错。谢谢你的帮助。
标签: azure odbc azure-sql-database nagios freetds