Zabbix Microsoft SQL Server monitoring: agent 2 plugin vs ODBC

The MSSQL by Zabbix agent 2 and MSSQL by ODBC templates both cover the same SQL Server checks, so the choice comes down to how your hosts connect and who maintains the collection path. This page explains the trade-offs, the monitoring login and the build sequence.

On this page

Choosing how Zabbix monitors SQL Server 2017, 2019 and 2022

If your team runs SQL Server 2017, 2019 or 2022 and wants Zabbix to watch database state, backup age, availability groups and SQL Agent jobs, use the official MSSQL by Zabbix agent 2 template when Zabbix agent 2 can run on the database host or a host with network reach to it, and use MSSQL by ODBC when you want the collection to run from a Zabbix server or proxy through an ODBC connection. Both templates require Zabbix 7.4 and were tested on SQL Server 2017, 2019 and 2022, so the SQL Server version does not decide the choice. The decision turns on where collection should run, who owns the agent on the database host and how your security team wants the monitoring connection handled.

The two templates cover the same ground. Both track per-database state, log usage and log full conditions, and full, differential and log backup age. Both also check availability groups, replicas, database mirroring, WSFC quorum and the status of SQL Agent jobs. Because the coverage is the same, compare the operating model rather than the feature list. The agent 2 template needs the MSSQL loadable plugin version 7.4.0 or later installed separately on the agent host, so plan that package into your deployment and patch cycle. The ODBC template needs an ODBC driver and a data source definition on the machine that runs the collection, so confirm which driver your SQL Server build and Zabbix host operating system support and who maintains it.

Whichever template you choose, create a dedicated monitoring login before you import anything. Check the Zabbix Microsoft SQL integration page for the exact grants: on SQL Server 2022 the login needs VIEW SERVER PERFORMANCE STATE, on 2017 and 2019 it needs VIEW SERVER STATE, and it also needs VIEW ANY DEFINITION and read access to the SQL Agent job tables in msdb. Test the login from the collection host, confirm that every availability group replica and backup check returns data, and record which backup and job checks you intend to alert on. Confirm with your DBA team which backup schedules and job names are expected, because the template reports age and status but cannot know your intended maintenance windows. Zabbix Microsoft SQL integration lists the template details to verify against your environment.

What you need before installing either MSSQL template

Both MSSQL templates share the same foundation: a supported Zabbix version, a collection path, a read-only monitoring login and a network route to the instance. The choice between agent 2 and ODBC changes which of these pieces you install, so check each one before you open the template import.

Zabbix 7.4 as the baseline

Both the MSSQL by Zabbix agent 2 template and the MSSQL by ODBC template require Zabbix 7.4, and both were tested on SQL Server 2017, 2019 and 2022. If your server or proxies run an older line, plan the upgrade first, because the templates will not import cleanly. Confirm the exact template versions shipped with your 7.4 build before you copy them into a production group. Check every proxy that will collect from SQL Server, not only the central server.

Zabbix MSSQL integration

MSSQL loadable plugin for agent 2

The agent 2 template depends on the MSSQL loadable plugin, which is installed separately from agent 2 itself. The plugin must be version 7.4.0 or later to match the template. Ask your team how plugins are packaged for your operating system and whether your package manager pulls the plugin in automatically or whether it has to be installed by hand. Record the plugin version on every host that runs agent 2.

ODBC driver and data source

The ODBC path needs a Microsoft SQL Server ODBC driver on the host that runs the check, plus a data source name (DSN) that points to the instance. The DSN and its driver are host-level settings, so each collector needs its own copy. Confirm with your operating system vendor and the driver's documentation which driver version works with your SQL Server builds and TLS settings. Keep the DSN configuration under change control, since a mismatch fails silently at item level.

Monitoring login with scoped permissions

Create a dedicated SQL login for Zabbix and avoid reusing an administrator account. The login needs VIEW SERVER PERFORMANCE STATE on SQL Server 2022, or VIEW SERVER STATE on 2017 and 2019, plus VIEW ANY DEFINITION. It also needs read access to the SQL Agent job tables in msdb, so job status checks work. Confirm each grant against the template's item list in your own test instance, since some checks fail quietly when a permission is missing.

MSSQL template details

Network path from collector to instance

The collector, which is the agent 2 host or the ODBC-capable host, or a Zabbix proxy that serves it, must reach the SQL Server instance on the port it listens on. Named instances, dynamic ports and availability group listeners each change the address you configure, so confirm the exact endpoint before you write the host macros. Check firewall rules in both directions and any TLS requirement the instance enforces. Test the connection with the same login and DSN that Zabbix will use.

Decide where the collector runs

Each SQL Server host needs a collector, and that collector can be an agent on the database server or a proxy on a separate monitoring network. Running collection on the database host keeps the path short but adds load and a second component to patch on a production server. A proxy centralizes credentials and keeps database servers simpler, but it becomes a dependency for every host it serves. Ask your database team which model they will support before the build starts.

Agent 2 plugin or ODBC: which path fits your estate

The agent 2 path runs the MSSQL plugin inside Zabbix agent 2 on a host that can reach the SQL Server instance. The plugin is a loadable component, so it is installed separately from agent 2 and must match a compatible version, which the official template requires to be Zabbix 7.4 or later with plugin 7.4.0 or later. The ODBC path runs no SQL-specific code on the monitored side. Instead, the Zabbix server or a proxy connects through a configured ODBC driver and data source name. That placement decides which network path must be open and which host carries the driver.

  • Agent 2 host placement: the collector sits on or near the SQL Server host, so the connection to the instance is usually local or short-hop.
  • ODBC host placement: the driver lives on the Zabbix server or proxy, which may be a shared, central system.
  • Network paths: agent 2 needs the agent-to-server channel open; ODBC needs the database port open from the Zabbix side.
  • Credential location: agent 2 stores connection details in its own configuration; ODBC stores them in the data source definition on the Zabbix side.
  • Operator question: confirm which host your change control treats as the trusted place to hold SQL logins.

Before choosing, map which network segment each SQL Server instance sits in and which hosts are allowed to open connections to it.

How to configure the monitoring login and templates in sequence

This sequence gives you a least-privilege SQL Server login, a working collection path for either the agent 2 plugin or ODBC, and verified data in Zabbix before any alert is turned on. Each step closes with a check so problems surface where they are cheapest to fix.

  1. Create the dedicated monitoring login

    A DBA creates a SQL Server login used only by Zabbix, with SQL authentication or a service account according to your identity policy, and sets a strong password stored outside the Zabbix configuration files. Do not reuse an administrator or application account. The step is done when the DBA can sign in to the instance with that login from the Zabbix collector host and nothing else, which you confirm with a simple connection test from that host.

  2. Grant server state permissions for your version

    The DBA grants VIEW SERVER PERFORMANCE STATE on SQL Server 2022 or VIEW SERVER STATE on SQL Server 2017 and 2019, which the Zabbix Microsoft SQL integration page lists as the required server-level permission for each version. Confirm the exact permission name against your SQL Server build before granting. The step is done when a query against a server state view returns rows for the monitoring login.

  3. Grant definition and SQL Agent read access

    The DBA grants VIEW ANY DEFINITION at server level and read access to the SQL Agent job tables in msdb, so job status checks can run without granting broader rights. Keep write and administrative roles off this login. The step is done when the login can read job status rows in msdb and cannot run any change statement, which you verify with a read query and a deliberately denied write test on a non-production instance.

  4. Install the agent 2 plugin or ODBC driver

    On the monitored Windows or Linux host, the Zabbix administrator chooses the path. For agent 2, install the MSSQL loadable plugin at version 7.4.0 or later alongside Zabbix 7.4 components. For ODBC, install a supported SQL Server ODBC driver on the Zabbix server or proxy that will run the checks. The step is done when the plugin or driver version is recorded and the component starts without errors in its log.

  5. Set connection macros and test items

    The Zabbix administrator sets the connection macros on the host, such as the connection string or agent 2 session details and the monitoring login credentials in a secret macro. Then create one or two test items, for example a per-database state item, and confirm they return values. The step is done when the test items show current values in Latest data, not unsupported or authentication errors.

  6. Link the MSSQL template and check discovery

    Link the MSSQL by Zabbix agent 2 template or the MSSQL by ODBC template to the host, which is Zabbix 7.4 content tested on SQL Server 2017, 2019 and 2022. Let low-level discovery run for databases, backups, replicas and jobs, then review the discovered items. The step is done when discovered entities match what the DBA sees on the instance, with no unexpected databases or jobs included.

  7. Verify each collected area before enabling triggers

    Check per-database state, log usage, full, differential and log backup age, availability group or mirroring state, and SQL Agent job status one area at a time against values from SQL Server Management Studio or T-SQL. Compare a known backup timestamp and a known job outcome with the Zabbix values. Only after each area matches should the team enable the related triggers and notifications. The step is done when every checked value agrees with the source and the triggers are enabled area by area.

How the login, collector and Zabbix server fit together

The flow starts at the Zabbix server or a proxy, which schedules checks for the MSSQL template. Those checks reach SQL Server through one of two collectors: the MSSQL by Zabbix agent 2 plugin, which must be installed separately as a loadable plugin, or an ODBC driver. Both connect with the same monitoring login, which holds only the view permissions and msdb read access that the templates need. Before you deploy, confirm that the login can reach every replica in the availability group, because the templates read replica and quorum state from each instance they are pointed at.

Collector options connect to SQL Server through one monitoring login.

Which SQL Server objects feed which Zabbix items and triggers

This table maps each monitored SQL Server area to the object it reads from and the Zabbix item or trigger it feeds. Use it to check that every area you care about has a collection path, a permission it depends on and a named owner for the threshold. The main takeaway is that the monitoring login and the backup, availability and job checks each need their own confirmation before you trust the alerts.

AreaSQL Server sourceZabbix item or triggerWhat the reader must confirm in their environment
Per-database stateDatabase state metadata visible to the monitoring loginDatabase state items and triggers in the MSSQL templatesWhich databases should alert when offline, suspect or restoring, and which are expected to be in those states
Log usage and log fullTransaction log usage per databaseLog usage items and log full triggerThresholds that match your log growth pattern and whether log backups run often enough to keep the log from filling
Full backup ageBackup history recorded in msdbFull backup age item and triggerYour backup schedule, the recovery model of each database and whether backups are taken by a tool that writes to msdb
Differential and log backup ageBackup history recorded in msdbDifferential and log backup age items and triggersWhether each database uses differentials or log backups at all, so that databases without them do not raise false alerts
Availability groups and replicasAvailability group and replica health viewsReplica state and synchronization triggersWhich replicas are primary and secondary, the expected sync mode and which replica owns the alert route
MirroringDatabase mirroring stateMirroring state items and triggersWhether mirroring is still in use in your estate, since it is superseded in many environments by availability groups
WSFC quorumWindows Server Failover Clustering quorum state, read through SQL ServerQuorum state item and triggerWhether the quorum data is visible to the monitoring login in your build and who responds to a quorum change
SQL Agent job statusJob history and job tables in msdbJob status items and failed job triggersWhich jobs are critical, how long each should run and whether job owners want alerts for every failure or only repeated failures

How availability groups and backup age checks behave in practice

The availability group and backup checks in the MSSQL templates answer different questions, and both depend on where the collector connects. The templates cover availability group replicas, mirroring and WSFC quorum, so the replica and cluster state they report is what the instance you point them at can see. An availability group is a view across several nodes, but a connection to one node reports that node's own role and the health it knows about. Before you trust a green dashboard, confirm which instance each monitored host name resolves to, whether the listener is in the monitoring target, and whether each replica is monitored separately. If you connect through a listener, a failover can move the collector's view without any change on your side, so alerts should name the replica and the database, not just the listener.

Backup age triggers for full, differential and log backups should follow the schedule your team actually runs, not a generic one. A full backup every night, a differential every few hours and log backups every 15 minutes need three different age thresholds, each set a little above its expected interval plus your normal run time. Set the thresholds in the template macros rather than editing the trigger expressions, so the values stay visible to the people who own the backup jobs. For a database in simple recovery, log backup age is not meaningful, so exclude it explicitly. Confirm with your DBA which databases are in full, bulk-logged or simple recovery model before you accept the default coverage.

The backup age checks read backup history from msdb, so the answer depends on how long that history is kept. Confirm the retention period your maintenance plans or backup tooling apply to msdb history, and whether any cleanup job runs on a schedule that could remove the most recent backup records. If history is pruned aggressively, the check can report a backup as missing when the backup exists. Also confirm that the monitoring login can read the relevant msdb tables, since the permissions described earlier in this page are what make the backup and job data visible at all.

Securing the monitoring login and the collection path

The monitoring login, the connection to SQL Server and the people who can change Zabbix templates all sit on the same collection path. Securing them together keeps the monitoring account from becoming a privileged route into your database estate.

Least-privilege monitoring login

Create a dedicated SQL login for monitoring and grant only the server-level state permission the template needs: VIEW SERVER PERFORMANCE STATE on SQL Server 2022, or VIEW SERVER STATE on 2017 and 2019. Add VIEW ANY DEFINITION and read access to the SQL Agent job tables in msdb, and nothing more. Confirm the exact grants against the official integration page before you script them.

Zabbix MSSQL integration

Keep sysadmin off the monitoring account

Do not reuse an administrator account or add the monitoring login to the sysadmin role to get past a failing check. A sysadmin login can read and change every database and can stop services, so a leaked Zabbix macro would expose the whole instance. If a check fails after tightening, find the missing permission and grant that single permission instead.

Store credentials in macros or a vault

Keep the login and password in Zabbix user macros marked as secret, or in an external vault that Zabbix can read, and never in the template body or a shared script. Check who can view host-level macros, because a macro readable by a broad role exposes the same secret as a plain text field. Record which macro holds the credential so rotation does not miss a host.

Restrict which hosts reach SQL Server

Allow the SQL Server listener port only from the Zabbix server, the proxy or the agent 2 host that performs the collection, and deny other sources at the host firewall or network segment. The agent 2 plugin and the ODBC path both open connections from the collector, so the collector's address is the one to allow. Confirm the instance port and any named instance port with your DBA before writing the rule.

Encrypt the connection to SQL Server

Require encrypted connections to SQL Server for the monitoring login, so credentials and query results do not cross the network in clear text. Decide whether the collector trusts the server certificate or validates it against a known root, and set the ODBC driver or plugin options to match. Test the chosen mode from the actual collector host, since a mismatch often shows up only as a failed login.

Limit who can edit templates and macros

Assign Zabbix user roles so that most operators can view problems but only a small group can edit the MSSQL templates, host macros and item keys. Editing a template changes the checks on every linked host, so a single unreviewed change can silence alerts for a whole estate. Review role membership after each upgrade, and log changes to templates in your audit trail.

Why SQL Server items go unsupported after setup

This table lists the failures that most often leave MSSQL items unsupported or empty after setup, with the cause and fix for each. Check the rows in order, since the first two cover most template-level problems before you look at the database itself. Use it as a troubleshooting checklist on either the agent 2 plugin or the ODBC path.

SymptomLikely causeFix
Agent 2 items show unsupportedThe MSSQL loadable plugin is missing or older than 7.4.0Install the MSSQL loadable plugin at 7.4.0 or later, matching your Zabbix 7.4 server and agent 2, then restart agent 2 and confirm the plugin loads in its log
ODBC items show unsupportedThe ODBC driver is not installed, or the data source name does not match the one in the host macrosInstall a Microsoft ODBC driver on the proxy or agent host, confirm the DSN name and driver with an ODBC test tool, and align the DSN with the template macros
Connection errors on a named instanceThe instance name in the connection string or macro does not match the actual SQL Server instanceCompare the instance name with what SQL Server reports for the service, include the instance name exactly, and test the connection from the same host that runs the check
Permission denied on server state itemsThe monitoring login lacks VIEW SERVER STATE on 2017 and 2019, or VIEW SERVER PERFORMANCE STATE on 2022Grant the permission matching your SQL Server version to the monitoring login, then confirm the login can read the performance and state views with a test query
Job status items return nothingThe monitoring login has no read access to SQL Agent job tables in msdb, or VIEW ANY DEFINITION is missingGrant the required read access in msdb and VIEW ANY DEFINITION at server level, then wait for the next polling cycle and check that job items populate
Availability group items empty on one nodeThe check runs on a secondary replica that does not expose the same availability group data as the primaryConfirm which replica reports the group, link the host to the instance that is primary or set discovery to the expected replica, and verify the template on each node you monitor

Questions teams ask before building SQL Server monitoring in Zabbix

What drives the cost of building SQL Server monitoring in Zabbix?

The main drivers are the number of SQL Server instances, the collection path you choose, how much change control your organization requires, and how many templates need tuning. Each instance adds login setup, discovery checks, trigger review and testing. The agent 2 path needs the separately installed MSSQL loadable plugin on each monitored host, while the ODBC path needs a driver and connection setup per target. Ask any partner for a written quote that lists instances, the collection path, the templates in scope and the change process, since those items set the fee. One-time work covers design, build and handover. Recurring work covers template updates and reviews after Zabbix upgrades.

What do we need to provide before the work starts?

You need DBA access to the instances in scope, a monitoring login approved by your security team, and a Zabbix 7.4 environment, because both official MSSQL templates require that version. Also prepare a list of instances, their SQL Server versions (2017, 2019 or 2022), the Availability Group topology, and the msdb and backup retention details your team already uses. Security approval should cover the exact permissions the login receives: VIEW SERVER PERFORMANCE STATE on 2022 or VIEW SERVER STATE on 2017 and 2019, plus VIEW ANY DEFINITION and read access to the SQL Agent job tables in msdb. Confirm these requirements against the current Zabbix integration page before the review.

Can our internal team build SQL Server monitoring in Zabbix alone?

Yes, if your team has Zabbix administration skills, SQL Server knowledge and time to test. The templates are official and documented, so a capable team can import them, create the monitoring login and tune triggers. The harder parts are usually the Windows Server Failover Cluster and Availability Group checks, backup age thresholds that match your recovery policy, and proving that the monitoring login cannot change data. Teams that lack one of these skills often choose a partner for design review and a written test plan, then keep operations in-house. Decide early which parts you will own after handover.

How long does SQL Server monitoring in Zabbix take to set up?

Duration depends on scope: the number of instances, whether Availability Groups and failover clusters are included, how many templates you tune, and how fast security approves the monitoring login. There is no fixed duration in this guide. A written plan should state the phases, the instances covered in each phase, the test window and the handover date. Ask for those dates and the dependencies that could move them, such as access approvals, change windows and Zabbix 7.4 availability.

Should we use the agent 2 plugin or the ODBC template for SQL Server?

Choose agent 2 when you want the agent on the SQL Server host to collect data and you can install the MSSQL loadable plugin, version 7.4.0 or later, on that host. Choose ODBC when the monitoring server should connect directly to the instance and you can manage ODBC drivers and connection strings. Both templates cover per-database state, log usage, backup age, Availability Groups, replicas, mirroring, WSFC quorum and SQL Agent job status. The decision therefore turns on network paths, host management rules and how your team already handles agents and drivers.

What breaks most often in SQL Server monitoring after go-live?

The most common problems are permission gaps after a SQL Server patch or new database, backup alerts that fire because a database was added without a backup schedule, and Availability Group checks that report differently after a failover. Agent 2 setups can also fail when the plugin version falls behind the agent or when the host firewall blocks the path. ODBC setups often break when drivers or credentials change. Build a test that runs after each change, and document who owns each alert so that noise does not hide real failures.

Does DeployOpen issue a compliance certification for our monitoring?

No. DeployOpen prepares systems, controls and evidence for compliance assessments, including documented monitoring configuration, access records and test results. Independent auditors and certification bodies issue any audit reports or attestations. Ask your assessor early which evidence they expect for database monitoring and backup age, then agree on that evidence in the written scope.

What a DeployOpen SQL Server monitoring engagement covers

A DeployOpen engagement for SQL Server monitoring is a fixed-scope piece of work, and its deliverables are set in writing before any work starts. The first deliverable is an agreed instance list: each SQL Server instance, its SQL Server version (2017, 2019 or 2022), whether it sits in an availability group or mirroring setup, and the Zabbix host that will represent it. The second is the chosen collection path, either the MSSQL by Zabbix agent 2 route with the separately installed MSSQL loadable plugin, or the MSSQL by ODBC route, with the reasoning recorded against your network and host constraints. Confirm with your team which path your Zabbix version and patch level support before the scope is signed.

The third deliverable is the monitoring login script. It creates a dedicated login with the permissions the templates need: VIEW SERVER PERFORMANCE STATE on SQL Server 2022 or VIEW SERVER STATE on 2017 and 2019, VIEW ANY DEFINITION, and read access to the SQL Agent job tables in msdb. The script is reviewed with your database administrators so that it grants nothing beyond those permissions, and the scope states which instances and databases it covers. The fourth deliverable is the template configuration: macros, credentials handling, and the host and item settings for per-database state, log usage, backup age, availability groups and SQL Agent jobs. The fifth is triggers tuned to your own backup and job schedules, so that a full backup window or a nightly job does not raise a false problem.

The final deliverable is a verification record showing what was tested on each instance, which items return data, which triggers were exercised, and what remains open. Ongoing tuning, such as adjusting thresholds after a schedule change or adding instances, is available as a retainer. Ask any provider for the written scope, the list of deliverables, and the timeline, and check that the verification record is part of the handover.

How DeployOpen scopes, delivers and supports Zabbix SQL Server monitoring

DeployOpen approaches Zabbix Microsoft SQL Server monitoring as a scoped deployment inside your own infrastructure. We agree on the template choice, the monitoring login and the SQL Server instances in writing before build starts, then hand over a configuration your DBAs and Zabbix administrators can review and run.

How we scope

  • Confirm SQL Server versions in use, which of 2017, 2019 or 2022 are covered, and whether Zabbix 7.4 is already running or planned.
  • Decide between the MSSQL by Zabbix agent 2 template and the MSSQL by ODBC template for each instance, with the loadable plugin requirement noted.
  • Agree in writing which templates cover per-database state, log usage, backup age, availability groups, mirroring, WSFC quorum and SQL Agent jobs.

How we build

  • Define the monitoring login with the permissions each SQL Server version needs, reviewed with your DBA team before it is created.
  • Configure the chosen template, macros and thresholds on a non-production instance first, then confirm each item returns data as expected.
  • Test failure cases such as a replica change, a stale backup and a failed SQL Agent job so triggers fire to the agreed recipients.

How we hand over

  • Deliver a written configuration record covering hosts, macros, credentials location, permissions granted and the reasons for each setting.
  • Document how to add a new instance, rotate the monitoring login password and confirm the loadable plugin version after updates.
  • Walk your operations and DBA staff through the dashboards, problem views and the steps to follow when a trigger fires.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped in writing alongside the original engagement.
  • Retainers can cover template updates when Zabbix releases changes, plus checks after SQL Server patching or availability group changes.
  • Ask for a quote that separates the one-time build from any recurring retainer, with the response expectations stated in writing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.