zoukankan      html  css  js  c++  java
  • Zabbix: Database Monitor Installation

     

    • 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

  • 相关阅读:
    [hackerrank]The Love-Letter Mystery
    *[hackerrank]Algorithmic Crush
    [hackerrank]Palindrome Index
    [hackerrank]Closest Number
    [hackerrank]Even Odd Query
    *[hackerrank]Consecutive Subsequences
    Permutation Sequence(超时,排列问题)
    Set Matrix Zeroes
    python requests的安装与简单运用(转)
    字符串指针数组,指向指针的指针
  • 原文地址:https://www.cnblogs.com/dfg727/p/5833780.html
Copyright © 2011-2022 走看看