Zabbix: Database Monitor Installation

本文档详细介绍了如何在Zabbix服务器上安装ODBC MSSQL连接器,并配置Zabbix来监控MSSQL数据库的过程。内容包括必要的软件安装、ODBC驱动配置、创建监控项、触发器及动作等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

  • 1.     Install ODBC MS SQL Connector On Zabbix Server   

https://support.zabbix.com/browse/ZBX-6839   comment1 --> mysql   comment2 --> PostgreSQL  comment3 -->  MSSQL

Install necessary packages FreeTDS:

  1. yum -y install freetds unixODBC unixODBC-devel
  2. Check if the installation is successful or not:

     

 tsql -S 10.1.9.59 –P 1433 -U loginname –P password

1> select top 1 id from jobsdb_hk.dbo.jobad;

2> go

 

  1. Update ODBC driver configuration file:

$ vi /etc/odbcinst.ini

 

  1. Update ODBC configuration file:
$ vi /etc/odbc.ini

 

2.     Create Host


 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. 3.     Create Item

 

 

User name: [Adloader Database Login ID]

Password: [Adloader Database Login Password]

SQL Query:

Select (Select L.CreatedTime, ErrorLogXml 
    From [Dev_DM_DB01]..SCM_Gateway_Log L With(NoLock) 
    Where Convert(Nvarchar(max), ErrorLogXml) <> '' 
    And DATEDIFF(D, CreatedTime, GETUTCDATE()) = 0 
    For XML RAW,TYPE) As ErrorLogFromAdloader, 
    (Select B.BatchID, B.CreateDate, BRJ.PostToJobsDB_ErrorInfo, BRJ.JobTitle
        From [Dev_DM_DB01]..SCM_ImportJob_Batch B With(NoLock) 
        Inner Join [Dev_DM_DB01]..SCM_ImportJob_BatchRecord_JobsDB BRJ With(NoLock) 
    On B.AccountID=BRJ.AccountID And B.EntityID=BRJ.EntityID And     B.BatchID=BRJ.BatchID 
        Where BRJ.PostToJobsDB_ErrorInfo Is Not Null 
        And DATEDIFF(MI, B.LastProcessTime, GETUTCDATE()) < 60
        For XML RAW, Type) As ErrorLogFromJobsDB
For XML RAW

 

  1. 4.     Create Trigger

  

 

  1. 5.     Create Action

     

Set action Condition: Matching by trigger name

 


Set action Operations: Send email to indicated user

转载于:https://www.cnblogs.com/dfg727/p/5833780.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值