Ad Widget

Collapse

MS SQL 2012 integration with Zabbix 5.4.6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kwzabbixlearner
    Junior Member
    • Oct 2021
    • 11

    #1

    MS SQL 2012 integration with Zabbix 5.4.6

    Hello;

    My Zabbix is running with version 5.4.6 on Oracle linux distribution verion 8.x, how can I start to integrate the MS SQL 2012 monitoring with Zabbix? How to start? I would like to monitor the SQL performance, I saw a template for Zabbix 5.6.4 but it is tested in MS SQL 2017 and 2019. Does it work for 2012 and 2014?

    How can I get the start up guide for running it on Oracle Linux?
  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hey there!

    Ok, you have a few questions here.

    how can I start to integrate the MS SQL 2012 monitoring with Zabbix?
    You mean monitor the data in a MSSQL or the hardware?
    Data you can use FreeTDS (https://www.zabbix.com/documentation...unixodbc_mssql) as unixODBC driver, and create the items for your queries
    Hardware, you have a few template options. Here is one from zabbix: https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4


    How to start?
    This is how I would start: list everything you need to monitor in a database. If its data, start on working out the queries (with your dba, with internet's help, or on your own). If its hardware, what exactly do you need (CPU, memory, etc etc) and get a template that covers most of what you need, and adjust for the environment you have (frequency of checks, if everything on the template is really needed. If not, disable.)

    I would like to monitor the SQL performance, I saw a template for Zabbix 5.6.4 but it is tested in MS SQL 2017 and 2019. Does it work for 2012 and 2014?
    Most likely. You would have to post what exctly they are doing, but usually they are retro compatible

    How can I get the start up guide for running it on Oracle Linux?
    This can help you: https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4

    Comment

    • kwzabbixlearner
      Junior Member
      • Oct 2021
      • 11

      #3
      thank you for the feedback. This is my first try to use Zabbix, I expect to monitor the process on SQL, for example; how busy of the SQL running, if a lot of jobs runs in SQL ?

      Comment

      • niveastn
        Member
        • Oct 2021
        • 82

        #4
        Hey there!
        What you could do: I found this query that list running jobs on your instance:
        SELECT ja.job_id, j.name AS job_name, ja.start_execution_date, ISNULL(last_executed_step_id,0)+1 AS current_executed_step_id, Js.step_name FROM msdb.dbo.sysjobactivity ja LEFT JOIN msdb.dbo.sysjobhistory jh ON ja.job_history_id = jh.instance_id JOIN msdb.dbo.sysjobs j ON ja.job_id = j.job_id JOIN msdb.dbo.sysjobsteps js ON ja.job_id = js.job_id AND ISNULL(ja.last_executed_step_id,0)+1 = js.step_id WHERE ja.session_id = (SELECT TOP 1 session_id FROM msdb.dbo.syssessions ORDER BY agent_start_date DESC) AND start_execution_date is not null AND stop_execution_date is null;

        Is that what you need? (in this case you will create an db.odbc.get item)

        Comment

        • kwzabbixlearner
          Junior Member
          • Oct 2021
          • 11

          #5
          Hello;

          I am following this article https://git.zabbix.com/projects/ZBX/...at=release/5.4 to start my setup. I got loss in step 2 "Set the username and password in host macros ({$MSSQL.USER} and {$MSSQL.PASSWORD})." Where can I find the host macros for updating the user name and the password of zbx_monitor sql user? Does it on Zabbix server? Also, if I am using FreeTDS with the unixODBX driver on Zabbbix server, do I need follow the instruction for installing odbc driver on Zabbix https://docs.microsoft.com/en-us/sql...-server-ver15?

          Comment

          • niveastn
            Member
            • Oct 2021
            • 82

            #6
            Hello again!

            First you have to create an user with read access to your database.
            Then, you are going to have to put those credentials here: Host > <your-host> > macros > Inherited and host macros > look for those two macros and change it.

            About the TDS, you would have to install sql driver. Than you just need to set the location of the mssql libs on /etc/odbcinst.ini

            Comment

            • kwzabbixlearner
              Junior Member
              • Oct 2021
              • 11

              #7
              thx!

              1. the Host > <your-host> > macros > Inherited and host macros > is in Zabbix server
              2. template, I have to copy the contents of this template "template_db_mssql_odbc.yaml" and importing to Zabbix server, right?
              3. I have installed the FreeTDS and the unixODBC on Zabbix server, anything else?

              Comment

              • kwzabbixlearner
                Junior Member
                • Oct 2021
                • 11

                #8
                Hi;

                also where can I find the value of {$MSSQL.DSN} ? Or, do I need to create a ODBC connection from my Zabbix after install unixODBC and the FreeTDS?

                To monitor the SQL server, if the sql server must use Zabbix agent?
                Last edited by kwzabbixlearner; 17-11-2021, 20:58.

                Comment

                Working...