<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aurélien Py, auteur/autrice sur dbi Blog</title>
	<atom:link href="https://www.dbi-services.com/blog/author/aurelienpy/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/author/aurelienpy/</link>
	<description></description>
	<lastBuildDate>Tue, 14 Jul 2026 05:54:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2025/05/cropped-favicon_512x512px-min-32x32.png</url>
	<title>Aurélien Py, auteur/autrice sur dbi Blog</title>
	<link>https://www.dbi-services.com/blog/author/aurelienpy/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Zabbix Agent 2 service terminated unexpectedly on Windows server</title>
		<link>https://www.dbi-services.com/blog/zabbix-agent-2-service-terminated-unexpectedly-on-windows-server/</link>
					<comments>https://www.dbi-services.com/blog/zabbix-agent-2-service-terminated-unexpectedly-on-windows-server/#respond</comments>
		
		<dc:creator><![CDATA[Aurélien Py]]></dc:creator>
		<pubDate>Tue, 14 Jul 2026 05:54:49 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Zabbix]]></category>
		<category><![CDATA[windows server]]></category>
		<category><![CDATA[Zabbix agent 2]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=44276</guid>

					<description><![CDATA[<p>Introductiom The Zabbix Agent 2 service on a Windows server was repeatedly becoming unresponsive and eventually crashing. The issue caused intermittent monitoring interruptions and required further investigation through Event Viewer messages and Zabbix Agent 2 logs to better understand why the service was no longer responding properly. While monitoring a Windows server with Zabbix Agent [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-agent-2-service-terminated-unexpectedly-on-windows-server/">Zabbix Agent 2 service terminated unexpectedly on Windows server</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading" id="h-introductiom">Introductiom</h1>



<p class="wp-block-paragraph"><br>The Zabbix Agent 2 service on a Windows server was repeatedly becoming unresponsive and eventually crashing. The issue caused intermittent monitoring interruptions and required further investigation through Event Viewer messages and Zabbix Agent 2 logs to better understand why the service was no longer responding properly.</p>



<span id="more-44276"></span>



<p class="wp-block-paragraph">While monitoring a Windows server with Zabbix Agent 2, we encountered repeated crashes of the agent service accompanied by the following Event Viewer message:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
A timeout (30000 milliseconds) was reached while waiting for a transaction response from the Zabbix Agent 2 service.
</pre></div>


<p class="wp-block-paragraph">A few moments later, Windows reported:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
The Zabbix Agent 2 service terminated unexpectedly.
</pre></div>


<h2 class="wp-block-heading" id="h-initial-hypothesis">Initial Hypothesis</h2>



<p class="wp-block-paragraph">The first assumption was that a plugin or item was taking too long to execute, causing the agent to become unresponsive. A natural idea was therefore to increase the timeout value. Here the official documentation for the <a href="https://www.zabbix.com/documentation/current/en/manual/extensions/plugins">PluginTimout</a>.</p>



<p class="wp-block-paragraph">Inside the Zabbix Agent 2 configuration, we identified the following parameter:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
### Option:PluginTimeout
# Timeout for connections with external plugins.
## Mandatory: no
# Range: 1-30
# Default: &lt;Global timeout&gt;
# PluginTimeout=
</pre></div>


<p class="wp-block-paragraph">However, this parameter only supports values between 1 and 30 seconds.</p>



<p class="wp-block-paragraph">This raised an important question:</p>



<p class="wp-block-paragraph">If a timeout already exists, why does the entire agent still become blocked and eventually crash?</p>



<h2 class="wp-block-heading" id="h-understanding-the-problem">Understanding the Problem</h2>



<p class="wp-block-paragraph">Zabbix Agent 2 uses a plugin-based architecture written in Go.<br>Unlike isolated external processes, many plugins run inside the same agent process.</p>



<p class="wp-block-paragraph">This means that if a plugin becomes blocked:</p>



<ul class="wp-block-list">
<li>worker threads remain occupied</li>



<li>new requests start queuing</li>



<li>the agent gradually stops responding</li>



<li>Windows eventually considers the service frozen</li>
</ul>



<p class="wp-block-paragraph">The 30-second timeout seen in Event Viewer is actually the Windows Service Control Manager (SCM) timeout, not a protection mechanism for the plugin itself.</p>



<p class="wp-block-paragraph">In other words:</p>



<ul class="wp-block-list">
<li>the plugin blocks first</li>



<li>the agent becomes unresponsive</li>



<li>Windows waits 30 seconds</li>



<li>Windows kills the service</li>
</ul>



<h2 class="wp-block-heading" id="h-investigating-the-logs">Investigating the Logs</h2>



<p class="wp-block-paragraph">The Zabbix Agent 2 logs quickly pointed toward the real culprit.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
&#x5B;WindowsPerfMon] failed to get performance counters data:&#039;cannot collect value No data to return.&#039;
</pre></div>


<p class="wp-block-paragraph">This indicated that the agent was struggling to collect Windows Performance Counters.</p>



<p class="wp-block-paragraph">The most important recurring message was:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#x5B;WindowsPerfInstance] Cannot refresh object cache:Unable to connect to the specified computer or the computer is offline.
</pre></div>


<p class="wp-block-paragraph">This error appeared continuously for several days.</p>



<p class="wp-block-paragraph">The key observation here is that the agent was running locally, so the message below should never normally appear:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Unable to connect to the specified computer
</pre></div>


<p class="wp-block-paragraph">This strongly suggested:</p>



<ul class="wp-block-list">
<li>an invalid or corrupted performance counter</li>



<li>a problematic PerfMon object</li>



<li>or a failing wildcard instance (<code>Process(*)</code>, <code>LogicalDisk(*)</code>, etc.)</li>
</ul>



<h2 class="wp-block-heading" id="h-agent-becoming-non-responsive">Agent Becoming Non-Responsive</h2>



<p class="wp-block-paragraph">Later in the logs, additional symptoms appeared:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
failed to accept an incoming connection:accept tcp &#x5B;::]:10050:acceptex: The I/O operation has been aborted because of either a thread exit or an application request.
</pre></div>


<p class="wp-block-paragraph">At this stage, the agent was no longer able to accept incoming connections because its internal workers were saturated or blocked.</p>



<p class="wp-block-paragraph">This confirmed that the issue was not a traditional crash, but rather a thread starvation / blocking situation.</p>



<h2 class="wp-block-heading" id="h-why-the-existing-30s-timeout-was-not-enough">Why the Existing 30s Timeout Was Not Enough</h2>



<p class="wp-block-paragraph">An important misunderstanding was clarified during the investigation.</p>



<p class="wp-block-paragraph">The default timeout value of 30 seconds does not immediately protect the agent.</p>



<p class="wp-block-paragraph">Instead:</p>



<ul class="wp-block-list">
<li>the plugin may block for the full 30 seconds</li>



<li>multiple blocked requests accumulate</li>



<li>worker threads remain occupied</li>



<li>the agent becomes globally unresponsive</li>
</ul>



<p class="wp-block-paragraph">By the time Windows notices the issue, the agent is already effectively frozen.</p>



<h2 class="wp-block-heading" id="h-the-solution-reduce-plugintimeout">The Solution: Reduce PluginTimeout</h2>



<p class="wp-block-paragraph">Instead of increasing the timeout, the correct approach was to reduce it significantly.</p>



<p class="wp-block-paragraph">The following configuration was applied:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
PluginTimeout=15
</pre></div>


<p class="wp-block-paragraph">This acts as a protection mechanism inside the agent itself.</p>



<p class="wp-block-paragraph">With this configuration:</p>



<ul class="wp-block-list">
<li>problematic plugin executions are aborted quickly</li>



<li>blocked threads are released faster</li>



<li>the agent remains responsive</li>



<li>only the affected items temporarily fail</li>
</ul>



<h2 class="wp-block-heading" id="h-conclusion">Conclusion</h2>



<p class="wp-block-paragraph">The issue was not caused by the timeout itself.</p>



<p class="wp-block-paragraph">The real root cause was a problematic <code>WindowsPerfInstance</code> plugin execution blocking the Zabbix Agent 2 internal workers.</p>



<p class="wp-block-paragraph">Reducing the plugin timeout from 30 seconds to 15 seconds prevented the entire agent from becoming unresponsive while still allowing the monitoring system to recover automatically when the plugin started responding again.</p>



<p class="wp-block-paragraph">This is a good example of why increasing timeouts is not always the right solution. Sometimes, shorter timeouts are actually what keeps a monitoring agent stable.</p>



<p class="wp-block-paragraph">You can find other blogs regarding Zabbix or database administration or other topics at this link: <a href="https://www.dbi-services.com/blog/">dbi blogs</a></p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-agent-2-service-terminated-unexpectedly-on-windows-server/">Zabbix Agent 2 service terminated unexpectedly on Windows server</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/zabbix-agent-2-service-terminated-unexpectedly-on-windows-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Monitoring MSSQL Database Files in Zabbix</title>
		<link>https://www.dbi-services.com/blog/monitoring-mssql-database-files-in-zabbix/</link>
					<comments>https://www.dbi-services.com/blog/monitoring-mssql-database-files-in-zabbix/#respond</comments>
		
		<dc:creator><![CDATA[Aurélien Py]]></dc:creator>
		<pubDate>Mon, 29 Jun 2026 20:30:07 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Zabbix]]></category>
		<category><![CDATA[mssql]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=44327</guid>

					<description><![CDATA[<p>Introduction Monitoring Microsoft SQL Server database files is an important part of infrastructure supervision.A database reaching its storage limit can rapidly lead to application outages, transaction failures, or even complete service interruptions. The Initial Problem In SQL Server, retrieving file information is relatively simple when working directly inside SQL Server Management Studio A common query [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/monitoring-mssql-database-files-in-zabbix/">Monitoring MSSQL Database Files in Zabbix</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading" id="h-introduction">Introduction</h1>



<p class="wp-block-paragraph" id="h-monitoring-microsoft-sql-server-database-files-is-an-important-part-of-infrastructure-supervision-a-database-reaching-its-storage-limit-can-rapidly-lead-to-application-outages-transaction-failures-or-even-complete-service-interruptions">Monitoring Microsoft SQL Server database files is an important part of infrastructure supervision.<br>A database reaching its storage limit can rapidly lead to application outages, transaction failures, or even complete service interruptions.</p>



<h2 class="wp-block-heading" id="h-the-initial-problem">The Initial Problem</h2>



<p class="wp-block-paragraph">In SQL Server, retrieving file information is relatively simple when working directly inside SQL Server Management Studio</p>



<ul class="wp-block-list">
<li>database file size,</li>



<li>used space,</li>



<li>free space,</li>



<li>auto-growth configuration,</li>



<li>or maximum file size</li>
</ul>



<p class="wp-block-paragraph">A common query used by many DBAs is the following:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
USE &#x5B;TEST]

GO

SELECT
  DB_NAME(database_id) AS DBName,
  Name AS Logical_Name,
  Physical_Name AS &#x5B;PhysicalName],
  CAST(ROUND(((size)/128/1024), 2) AS float) AS &#x5B;SizeGB],
  CAST(ROUND((CAST(FILEPROPERTY(name, &#039;SpaceUsed&#039;) AS INT)/128/1024), 2) AS float) AS &#x5B;SpaceUsedGB],
  CAST(ROUND((size/128/1024 - CAST(FILEPROPERTY(name, &#039;SpaceUsed&#039;) AS INT)/128/1024), 2) AS float) AS &#x5B;FreeSpaceGB],
  ROUND(ISNULL(((CAST((fileproperty(name, &#039;SpaceUsed&#039;))/128/1024 as float)) / NULLIF((CAST(size/128/1024 as float)), 0)), 0)*100, 2) as &#x5B;SpaceUsed%],
  CASE WHEN &#x5B;max_size] = -1 THEN &#x5B;max_size] ELSE CAST(ROUND(((max_size)/128/1024), 2) AS float) END AS &#x5B;MaxSizeGB],
  CAST(ROUND((max_size/128/1024 - CAST(FILEPROPERTY(name, &#039;SpaceUsed&#039;) AS INT)/128/1024), 2) AS float) AS &#x5B;FreeSpaceGBtoMaxSize],
  ROUND(ISNULL(((CAST((fileproperty(name, &#039;SpaceUsed&#039;))/128/1024 as float)) / NULLIF((CAST(max_size/128/1024 as float)), 0)), 0)*100, 2) as &#x5B;SpaceUsed%toMaxSize]
FROM sys.master_files
WHERE DB_NAME(database_id) = &#039;TEST&#039;
ORDER BY Logical_Name
</pre></div>


<p class="wp-block-paragraph">The initial query works perfectly for manual analysis in SQL Server Management Studio.<br>However, integrating it into Zabbix becomes more complicated because <code>sys.database_files</code> only returns information from the current database context.</p>



<p class="wp-block-paragraph">This means the query must be executed individually for every database using:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
USE &#x5B;DatabaseName]
</pre></div>


<p class="wp-block-paragraph">In small environments this remains manageable, but in larger infrastructures containing dozens or even hundreds of databases, maintaining static queries quickly becomes impractical.</p>



<p class="wp-block-paragraph">To automate this process, we use:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
sp_MSforeachdb
</pre></div>


<p class="wp-block-paragraph">This SQL Server procedure dynamically executes the same query across every database on the instance.</p>



<p class="wp-block-paragraph">Example:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
EXEC sp_MSforeachdb &#039;
USE &#x5B;?]

SELECT
    DB_NAME(),
    name,
    physical_name
FROM sys.database_files
&#039;
</pre></div>


<p class="wp-block-paragraph">The <code>?</code> placeholder is automatically replaced by the database name during execution, allowing SQL Server to iterate through all databases dynamically.</p>



<p class="wp-block-paragraph">At first glance, this seems to solve the problem entirely.<br>However, another limitation quickly appears: <code>sp_MSforeachdb</code> returns one independent result set per database.</p>



<p class="wp-block-paragraph">Instead of producing a single structured dataset, SQL Server generates multiple separate tables:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Database 1 result
-----------------
file1
file2

Database 2 result
-----------------
file1
file2
</pre></div>


<p class="wp-block-paragraph">While this output remains perfectly readable for a DBA inside SQL Server Management Studio, it becomes difficult to exploit inside Zabbix, especially for Low-Level Discovery and dependent items.</p>



<p class="wp-block-paragraph">To solve this limitation, we redesigned the query architecture to centralize all results into a single temporary table, allowing Zabbix to consume one normalized dataset fully compatible with automatic discovery and scalable monitoring.</p>



<h2 class="wp-block-heading" id="h-why-zabbix-cannot-easily-use-this-output">Why Zabbix Cannot Easily Use This Output</h2>



<p class="wp-block-paragraph">Zabbix works much better when:</p>



<ul class="wp-block-list">
<li>the result is normalized,</li>



<li>the structure is predictable,</li>



<li>and all rows belong to a single dataset.</li>
</ul>



<p class="wp-block-paragraph">With multiple independent result sets:</p>



<ul class="wp-block-list">
<li>Low-Level Discovery becomes difficult,</li>



<li>JSON conversion becomes complicated,</li>



<li>dependent items cannot parse values correctly,</li>



<li>preprocessing becomes unreliable.</li>
</ul>



<p class="wp-block-paragraph">The issue is therefore no longer the database context itself. The issue becomes the query output structure.</p>



<h2 class="wp-block-heading" id="h-building-a-zabbix-compatible-query">Building a Zabbix-Compatible Query</h2>



<p class="wp-block-paragraph">To make the output usable inside Zabbix, the query had to be redesigned completely.</p>



<p class="wp-block-paragraph">The objective was no longer simply to retrieve MSSQL file information, but to transform multiple independent database results into a single normalized dataset compatible with Low-Level Discovery.</p>



<p class="wp-block-paragraph">The new query therefore introduces three important concepts:</p>



<ul class="wp-block-list">
<li>dynamic iteration through all databases using <code>sp_MSforeachdb</code>,</li>



<li>centralized data collection using a global temporary table,</li>



<li>and a final unified output consumable by Zabbix dependent items.</li>
</ul>



<p class="wp-block-paragraph">The core logic becomes inside the <code>sp_MSforeachdb</code> execution.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
INSERT INTO ##Results
</pre></div>


<p class="wp-block-paragraph">Each database inserts its rows into the same centralized structure instead of returning independent result sets.</p>



<p class="wp-block-paragraph">At the end of the execution, the query simply returns:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
SELECT * FROM ##Results
</pre></div>


<p class="wp-block-paragraph">The final output is now normalized instead of multiple disconnected tables.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Database</th><th>File</th><th>Type</th><th>Size</th><th>Free</th></tr></thead><tbody><tr><td>TEST</td><td>TEST_Data</td><td>Data</td><td>&#8230;</td><td>&#8230;</td></tr><tr><td>TEST</td><td>TEST_Log</td><td>Log</td><td>&#8230;</td><td>&#8230;</td></tr><tr><td>PROD</td><td>PROD_Data</td><td>Data</td><td>&#8230;</td><td>&#8230;</td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="h-the-complete-query">The complete query</h2>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
SET NOCOUNT ON;

DECLARE @Granularity VARCHAR(10) = NULL
DECLARE @Database_Name sysname = NULL
 
DECLARE @SQL VARCHAR(5000)

IF EXISTS (SELECT NAME FROM tempdb..sysobjects WHERE NAME = &#039;##Results&#039;)
BEGIN
    DROP TABLE ##Results
END

CREATE TABLE ##Results (
    &#x5B;Database Name] sysname,
    &#x5B;File Name] sysname,
    &#x5B;Physical Name] NVARCHAR(260),
    &#x5B;File Type] VARCHAR(4),
    &#x5B;Total Size in Bytes] BIGINT,
    &#x5B;Available Space in Bytes] BIGINT,
    &#x5B;Growth Units] VARCHAR(20),
    &#x5B;Max File Size in Bytes] BIGINT
)

SELECT @SQL =
&#039;USE &#x5B;?] 
INSERT INTO ##Results(
    &#x5B;Database Name],
    &#x5B;File Name],
    &#x5B;Physical Name],
    &#x5B;File Type],
    &#x5B;Total Size in Bytes],
    &#x5B;Available Space in Bytes],
    &#x5B;Growth Units],
    &#x5B;Max File Size in Bytes]
)
SELECT 
    DB_NAME(),
    &#x5B;name],
    physical_name,
    CASE type
        WHEN 0 THEN &#039;&#039;Data&#039;&#039;
        WHEN 1 THEN &#039;&#039;Log&#039;&#039;
    END,

    -- TOTAL SIZE (bytes) SAFE
    CAST(size AS BIGINT) * 8 * 1024,

    -- FREE SPACE (bytes) SAFE
    (CAST(size AS BIGINT) - CAST(FILEPROPERTY(&#x5B;name], &#039;&#039;SpaceUsed&#039;&#039;) AS BIGINT)) * 8 * 1024,

    -- GROWTH
    CASE is_percent_growth
        WHEN 1 THEN CAST(growth AS varchar(20)) + &#039;&#039;%&#039;&#039;
        ELSE CAST(CAST(growth AS BIGINT) * 8 * 1024 AS varchar(20))
    END,

    -- MAX SIZE (bytes) SAFE
    CASE max_size
        WHEN -1 THEN NULL
        WHEN 268435456 THEN NULL
        ELSE CAST(max_size AS BIGINT) * 8 * 1024
    END

FROM sys.database_files
ORDER BY type, file_id
&#039;

EXEC sp_MSforeachdb @SQL

-- =========================
-- RESULTATS
-- =========================

IF @Database_Name IS NULL
BEGIN
    IF @Granularity = &#039;Database&#039;
    BEGIN
        SELECT
            T.&#x5B;Database Name],

            T.&#x5B;Total Size in Bytes] AS &#x5B;DB Size (Bytes)],
            T.&#x5B;Available Space in Bytes] AS &#x5B;DB Free (Bytes)],
            T.&#x5B;Consumed Space in Bytes] AS &#x5B;DB Used (Bytes)],

            D.&#x5B;Total Size in Bytes] AS &#x5B;Data Size (Bytes)],
            D.&#x5B;Available Space in Bytes] AS &#x5B;Data Free (Bytes)],
            D.&#x5B;Consumed Space in Bytes] AS &#x5B;Data Used (Bytes)],
            CEILING(CAST(D.&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(D.&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Data Free %],

            L.&#x5B;Total Size in Bytes] AS &#x5B;Log Size (Bytes)],
            L.&#x5B;Available Space in Bytes] AS &#x5B;Log Free (Bytes)],
            L.&#x5B;Consumed Space in Bytes] AS &#x5B;Log Used (Bytes)],
            CEILING(CAST(L.&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(L.&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Log Free %]

        FROM
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            GROUP BY &#x5B;Database Name]
        ) T

        INNER JOIN
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            WHERE &#x5B;File Type] = &#039;Data&#039;
            GROUP BY &#x5B;Database Name]
        ) D ON T.&#x5B;Database Name] = D.&#x5B;Database Name]

        INNER JOIN
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            WHERE &#x5B;File Type] = &#039;Log&#039;
            GROUP BY &#x5B;Database Name]
        ) L ON T.&#x5B;Database Name] = L.&#x5B;Database Name]

        ORDER BY T.&#x5B;Database Name]
    END
    ELSE
    BEGIN
        SELECT
            &#x5B;Database Name],
            &#x5B;File Name],
            &#x5B;Physical Name],
            &#x5B;File Type],
            &#x5B;Total Size in Bytes] AS &#x5B;DB Size (Bytes)],
            &#x5B;Available Space in Bytes] AS &#x5B;DB Free (Bytes)],
            CEILING(CAST(&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Free Space %],
            &#x5B;Growth Units],
            &#x5B;Max File Size in Bytes] AS &#x5B;Grow Max Size (Bytes)]
        FROM ##Results
    END
END
ELSE
BEGIN
    IF @Granularity = &#039;Database&#039;
    BEGIN
        SELECT
            T.&#x5B;Database Name],

            T.&#x5B;Total Size in Bytes] AS &#x5B;DB Size (Bytes)],
            T.&#x5B;Available Space in Bytes] AS &#x5B;DB Free (Bytes)],
            T.&#x5B;Consumed Space in Bytes] AS &#x5B;DB Used (Bytes)],

            D.&#x5B;Total Size in Bytes] AS &#x5B;Data Size (Bytes)],
            D.&#x5B;Available Space in Bytes] AS &#x5B;Data Free (Bytes)],
            D.&#x5B;Consumed Space in Bytes] AS &#x5B;Data Used (Bytes)],
            CEILING(CAST(D.&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(D.&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Data Free %],

            L.&#x5B;Total Size in Bytes] AS &#x5B;Log Size (Bytes)],
            L.&#x5B;Available Space in Bytes] AS &#x5B;Log Free (Bytes)],
            L.&#x5B;Consumed Space in Bytes] AS &#x5B;Log Used (Bytes)],
            CEILING(CAST(L.&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(L.&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Log Free %]

        FROM
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            WHERE &#x5B;Database Name] = @Database_Name
            GROUP BY &#x5B;Database Name]
        ) T

        INNER JOIN
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            WHERE &#x5B;File Type] = &#039;Data&#039;
              AND &#x5B;Database Name] = @Database_Name
            GROUP BY &#x5B;Database Name]
        ) D ON T.&#x5B;Database Name] = D.&#x5B;Database Name]

        INNER JOIN
        (
            SELECT &#x5B;Database Name],
                SUM(&#x5B;Total Size in Bytes]) AS &#x5B;Total Size in Bytes],
                SUM(&#x5B;Available Space in Bytes]) AS &#x5B;Available Space in Bytes],
                SUM(&#x5B;Total Size in Bytes] - &#x5B;Available Space in Bytes]) AS &#x5B;Consumed Space in Bytes]
            FROM ##Results
            WHERE &#x5B;File Type] = &#039;Log&#039;
              AND &#x5B;Database Name] = @Database_Name
            GROUP BY &#x5B;Database Name]
        ) L ON T.&#x5B;Database Name] = L.&#x5B;Database Name]

        ORDER BY T.&#x5B;Database Name]
    END
    ELSE
    BEGIN
        SELECT
            &#x5B;Database Name],
            &#x5B;File Name],
            &#x5B;Physical Name],
            &#x5B;File Type],
            &#x5B;Total Size in Bytes] AS &#x5B;DB Size (Bytes)],
            &#x5B;Available Space in Bytes] AS &#x5B;DB Free (Bytes)],
            CEILING(CAST(&#x5B;Available Space in Bytes] AS decimal(20,2)) / NULLIF(&#x5B;Total Size in Bytes],0) * 100) AS &#x5B;Free Space %],
            &#x5B;Growth Units],
            &#x5B;Max File Size in Bytes] AS &#x5B;Grow Max Size (Bytes)]
        FROM ##Results
        WHERE &#x5B;Database Name] = @Database_Name
    END
END

DROP TABLE ##Results
</pre></div>


<h2 class="wp-block-heading" id="h-discovery-in-zabbix">Discovery in Zabbix</h2>



<p class="wp-block-paragraph">Once the query has been implemented in Zabbix, the next step is to create a Low-Level Discovery (LLD) rule in order to automatically discover databases and files, then generate the associated dependent items and triggers dynamically.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="677" height="242" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-17.png" alt="" class="wp-image-44336" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-17.png 677w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-17-300x107.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></figure>



<p class="wp-block-paragraph">A dedicated blog explaining how to configure Low-Level Discovery in Zabbix is available here: Create DISCO Put the link here</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Monitoring MSSQL database files in Zabbix can become challenging when working with multiple databases and dynamic environments.<br>While the initial query is perfectly suitable for manual analysis, its structure and dependency on the current database context make it difficult to integrate directly into Zabbix.</p>



<p class="wp-block-paragraph">By using <code>sp_MSforeachdb</code> together with a centralized temporary table, we can transform multiple independent result sets into a single normalized dataset fully compatible with Zabbix Low-Level Discovery and dependent items.</p>



<p class="wp-block-paragraph">This approach provides a scalable and reusable solution capable of automatically monitoring database and log file growth across an entire SQL Server instance while significantly reducing manual configuration and maintenance efforts.</p>



<p class="wp-block-paragraph"></p>



<span id="more-44327"></span>
<p>L’article <a href="https://www.dbi-services.com/blog/monitoring-mssql-database-files-in-zabbix/">Monitoring MSSQL Database Files in Zabbix</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/monitoring-mssql-database-files-in-zabbix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Zabbix &#8211; Monitoring full cluster Patroni/PostgreSQL</title>
		<link>https://www.dbi-services.com/blog/zabbix-monitoring-full-cluster-patroni-postgresql/</link>
					<comments>https://www.dbi-services.com/blog/zabbix-monitoring-full-cluster-patroni-postgresql/#respond</comments>
		
		<dc:creator><![CDATA[Aurélien Py]]></dc:creator>
		<pubDate>Fri, 12 Jun 2026 14:06:13 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Zabbix]]></category>
		<category><![CDATA[Patroni]]></category>
		<category><![CDATA[postgresql]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=44284</guid>

					<description><![CDATA[<p>Introduction Monitoring a PostgreSQL environment involves much more than simply checking whether the database is running. In a modern high availability architecture, multiple components work together to keep the service available and stable. In this article, we will explain how to monitor a PostgreSQL cluster environment with Zabbix: The goal of this blog is to [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-monitoring-full-cluster-patroni-postgresql/">Zabbix &#8211; Monitoring full cluster Patroni/PostgreSQL</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading" id="h-introduction">Introduction</h1>



<p class="wp-block-paragraph">Monitoring a PostgreSQL environment involves much more than simply checking whether the database is running. In a modern high availability architecture, multiple components work together to keep the service available and stable.</p>



<p class="wp-block-paragraph">In this article, we will explain how to monitor a PostgreSQL cluster environment with Zabbix:</p>



<ul class="wp-block-list">
<li>PostgreSQL</li>



<li>Patroni</li>



<li>HAProxy</li>



<li>ETCD</li>



<li>Keepalived</li>
</ul>



<p class="wp-block-paragraph">The goal of this blog is to provide a simple and clear overview that can be understood by both beginners and experienced administrators.</p>



<span id="more-44284"></span>



<h2 class="wp-block-heading" id="h-postgresql-high-availability-architecture">PostgreSQL High Availability Architecture</h2>



<p class="wp-block-paragraph">A typical PostgreSQL high availability environment often contains several components:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Component</th><th>Role</th></tr></thead><tbody><tr><td>PostgreSQL</td><td>Database engine</td></tr><tr><td>Patroni</td><td>PostgreSQL cluster management and failover</td></tr><tr><td>ETCD</td><td>Distributed key-value store used by Patroni</td></tr><tr><td>HAProxy</td><td>Load balancing and traffic routing</td></tr><tr><td>Keepalived</td><td>Virtual IP management and failover</td></tr><tr><td>Zabbix</td><td>Monitoring and alerting platform</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">In a PostgreSQL HA environment, monitoring only the database is not enough because every component directly impacts cluster stability and application availability. Moreover, a failures in components like HAProxy, ETCD, or Keepalived can directly impact application availability and cluster stability. Comprehensive monitoring ensures the entire ecosystem remains healthy and operational.</p>



<h2 class="wp-block-heading" id="h-monitoring-postgresql-with-zabbix">Monitoring PostgreSQL with Zabbix</h2>



<p class="wp-block-paragraph">Zabbix already provides an official PostgreSQL <a href="https://www.zabbix.com/integrations/postgresql#postgresql_agent2">template</a>.</p>



<p class="wp-block-paragraph">This template allows administrators to monitor:</p>



<ul class="wp-block-list">
<li>Database availability</li>



<li>Connections</li>



<li>Transactions</li>



<li>Cache hit ratio</li>



<li>Replication status</li>



<li>Locks</li>



<li>Deadlocks</li>



<li>Database size</li>



<li>Query statistics</li>



<li>WAL activity</li>



<li>Performance metrics</li>
</ul>



<p class="wp-block-paragraph">Therefore, using the official template is usually the fastest and easiest way to start monitoring PostgreSQL.</p>



<h2 class="wp-block-heading" id="h-etcd">ETCD</h2>



<p class="wp-block-paragraph">Zabbix already provides an official template for <a href="https://www.zabbix.com/integrations/etcd">ETCD</a> monitoring.</p>



<p class="wp-block-paragraph">The template uses HTTP Agent items to collect metrics directly from the <code>/metrics</code> endpoint exposed by ETCD.</p>



<p class="wp-block-paragraph">In addition, the template works without external scripts and uses Prometheus-style metrics collection.</p>



<p class="wp-block-paragraph">The official template already includes many useful triggers and metrics for monitoring ETCD health, performance, and cluster activity.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="269" height="300" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image.png" alt="" class="wp-image-44286" style="aspect-ratio:0.896661284441898;width:220px;height:auto" /></figure>



<h2 class="wp-block-heading" id="h-haproxy">HAProxy</h2>



<p class="wp-block-paragraph">HAProxy plays a critical role in a PostgreSQL high availability environment, ensuring that client connections are automatically routed to the correct PostgreSQL node and maintaining application connectivity during failovers.</p>



<p class="wp-block-paragraph">Zabbix already provides an official HAProxy monitoring template that can be used as a base for monitoring and customization: <a href="https://www.zabbix.com/integrations/haproxy">HAProxy by HTTP</a></p>



<p class="wp-block-paragraph">The number of active servers in HAProxy is also monitored by the template. However, the template does not create a trigger by default for this metric. This means that a backend could lose one or more active servers without generating any alert in Zabbix. For this reason, it is highly recommended to create custom triggers on this item to immediately detect backend availability issues and avoid unnoticed service degradation.</p>



<p class="wp-block-paragraph">To implement this properly, a new macro should be created in the template to define the minimum expected number of active servers. Then, a custom trigger must be added on the item prototype available in the Low-Level Discovery (LLD) section of the template. Consequently, Zabbix can automatically monitor and alert on all discovered HAProxy backends.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="497" height="115" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-1.png" alt="" class="wp-image-44287" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-1.png 497w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-1-300x69.png 300w" sizes="(max-width: 497px) 100vw, 497px" /></figure>



<h2 class="wp-block-heading" id="h-patroni">Patroni</h2>



<p class="wp-block-paragraph">Zabbix does not directly include Patroni monitoring in the standard PostgreSQL templates.</p>



<p class="wp-block-paragraph">One approach is to use the Zabbix <a href="https://www.zabbix.com/integrations/systemd">Systemd </a>template, which allows monitoring of services running on the server. In this case, it is simply necessary to filter on the <code>patroni</code> service name to verify that the service is active.</p>



<p class="wp-block-paragraph">Another approach is to create a custom item in a template using a Zabbix agent item with the following key:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
net.tcp.service&#x5B;&quot;{$HAPROXY.STATS.SCHEME}&quot;,&quot;{$HAPROXY.STATS.HOST}&quot;,&quot;{$HAPROXY.STATS.PORT.PATRONI}&quot;]
</pre></div>


<p class="wp-block-paragraph">This item performs a direct HTTP TCP connection test on port <code>5000</code>, which is commonly used by the Patroni API. This configuration allows Zabbix to verify that the Patroni service responds correctly and remains reachable.</p>



<p class="wp-block-paragraph">Additionally, combining both monitoring methods significantly improves monitoring reliability.</p>



<h2 class="wp-block-heading" id="h-monitoring-keepalived">Monitoring Keepalived</h2>



<p class="wp-block-paragraph">Keepalived monitoring is not included by default in the standard Zabbix templates.<br>To properly monitor the VIP management layer, administrators should create custom items whether the Virtual IP (VIP) is correctly present on one of the cluster nodes.</p>



<p class="wp-block-paragraph">A common approach is to create three different items:</p>



<ul class="wp-block-list">
<li>Two items using the <code>net.tcp.service</code> key to test TCP connectivity for:
<ul class="wp-block-list">
<li>the READ-ONLY access</li>



<li>the READ-WRITE access</li>
</ul>
</li>



<li>One additional item using a <code>system.run</code> command to directly verify the VIP status on the server.</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="637" height="98" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-2.png" alt="" class="wp-image-44288" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-2.png 637w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-2-300x46.png 300w" sizes="auto, (max-width: 637px) 100vw, 637px" /></figure>



<p class="wp-block-paragraph">Together, these checks help ensure that:</p>



<ul class="wp-block-list">
<li>the VIP is correctly assigned</li>



<li>the PostgreSQL services are reachable</li>



<li>the failover mechanism is working properly</li>
</ul>



<p class="wp-block-paragraph">Finally, administrators should create the appropriate triggers for these items in order to immediately detect VIP failover or connectivity issues.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="380" height="191" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-3.png" alt="" class="wp-image-44289" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-3.png 380w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/05/image-3-300x151.png 300w" sizes="auto, (max-width: 380px) 100vw, 380px" /></figure>



<h2 class="wp-block-heading" id="h-conclusion">Conclusion</h2>



<p class="wp-block-paragraph">In conclusion, monitoring PostgreSQL alone is not enough in a high availability environment.</p>



<p class="wp-block-paragraph">A complete monitoring strategy must include:</p>



<ul class="wp-block-list">
<li>PostgreSQL</li>



<li>Patroni</li>



<li>HAProxy</li>



<li>ETCD</li>



<li>Keepalived</li>
</ul>



<p class="wp-block-paragraph">Using Zabbix with both official and custom templates provides a centralized and efficient monitoring solution.</p>



<p class="wp-block-paragraph">The PostgreSQL template available in Zabbix already offers excellent database monitoring capabilities.</p>



<p class="wp-block-paragraph">Additional templates for ETCD and HAProxy help extend monitoring to the full HA architecture and improve visibility across the entire platform.</p>



<p class="wp-block-paragraph">As a result, this approach helps administrators detect failures earlier, improve troubleshooting, and ensure better service availability.</p>



<p class="wp-block-paragraph">If you need you can try other blogs regarding Zabbix or postgreSQL here: <a href="https://www.dbi-services.com/blog/">dbi Blog</a></p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-monitoring-full-cluster-patroni-postgresql/">Zabbix &#8211; Monitoring full cluster Patroni/PostgreSQL</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/zabbix-monitoring-full-cluster-patroni-postgresql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Zabbix &#8211; Oracle backups monitoring</title>
		<link>https://www.dbi-services.com/blog/zabbix-oracle-backups-monitoring/</link>
					<comments>https://www.dbi-services.com/blog/zabbix-oracle-backups-monitoring/#respond</comments>
		
		<dc:creator><![CDATA[Aurélien Py]]></dc:creator>
		<pubDate>Tue, 26 May 2026 15:11:12 +0000</pubDate>
				<category><![CDATA[Database Administration & Monitoring]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Zabbix]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Oracle]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=42829</guid>

					<description><![CDATA[<p>If your Oracle database is running in ARCHIVELOG mode, monitoring your backups is essential.Without proper backup supervision, the Fast Recovery Area (FRA) can eventually become full, which may block archive log generation and, in the worst case, stop database activity. In this article, we will see how to monitor Oracle backups using Zabbix and the [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-oracle-backups-monitoring/">Zabbix &#8211; Oracle backups monitoring</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If your Oracle database is running in ARCHIVELOG mode, monitoring your backups is essential.<br>Without proper backup supervision, the Fast Recovery Area (FRA) can eventually become full, which may block archive log generation and, in the worst case, stop database activity.</p>



<span id="more-42829"></span>



<p class="wp-block-paragraph">In this article, we will see how to monitor Oracle backups using Zabbix and the Oracle plugin available with Zabbix Agent 2.</p>



<p class="wp-block-paragraph">This guide assumes that:</p>



<ul class="wp-block-list">
<li>ARCHIVELOG mode is already enabled, </li>



<li>RMAN backups are already configured, </li>



<li>and Zabbix Agent 2 is already installed on the Oracle server.</li>
</ul>



<h2 class="wp-block-heading" id="h-setup-zabbix-agent-2">Setup Zabbix agent 2</h2>



<p class="wp-block-paragraph">By default, the Oracle template provided with Zabbix does not include items dedicated to backup monitoring.<br>To achieve this, we will use the Oracle plugin feature called CustomQueries. You can find the documentation for this plugin on the <a href="https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2_plugins/oracle_plugin" id="https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2_plugins/oracle_plugin">official web-site</a>.</p>



<p class="wp-block-paragraph">The approach is straightforward:</p>



<ul class="wp-block-list">
<li>create custom SQL queries, </li>



<li>store them locally on the database server, </li>



<li>and let Zabbix execute them periodically</li>
</ul>



<p class="wp-block-paragraph">First, create a directory that will contain your monitoring SQL scripts:</p>



<pre class="wp-block-code"><code>mkdir -p /etc/zabbix/oracle/sql 

chmod 755 -R /etc/zabbix/oracle/sql</code></pre>



<p class="wp-block-paragraph" id="h-create-a-sql-script-that-returns-the-timestamp-of-the-latest-level-0-backup">Create a SQL script that returns the timestamp of the latest level 0 backup.</p>



<pre class="wp-block-code"><code><code>vi /etc/zabbix/oracle/sql/last_inc0.sql</code></code></pre>



<pre class="wp-block-code"><code><code>SELECT
    CAST(((CAST(BS.COMPLETION_TIME AS DATE) - DATE '1970-01-01') * 86400) AS NUMERIC) AS LAST_INC0
FROM
    V$BACKUP_SET BS
WHERE
    BS.INCREMENTAL_LEVEL = 0
ORDER BY
    BS.COMPLETION_TIME DESC
FETCH FIRST 1 ROWS ONLY;</code></code></pre>



<p class="wp-block-paragraph">This query retrieves the completion time of the latest RMAN level 0 backup. Then, it converts the value into Unix epoch format, which makes preprocessing and trigger calculations much easier inside Zabbix.</p>



<p class="wp-block-paragraph">You can easily adapt this query to monitor:</p>



<ul class="wp-block-list">
<li>archive log backups,</li>



<li>level 1 incremental backups,</li>



<li>controlfile backups,</li>



<li>or even backup duration.</li>
</ul>



<p class="wp-block-paragraph" id="h-configure-the-oracle-plugin">Configure the Oracle Plugin</p>



<p class="wp-block-paragraph">Now edit the Oracle plugin configuration file:</p>



<pre class="wp-block-code"><code><code>vi /etc/zabbix/zabbix_agent2.d/plugins.d/oracle.conf</code></code></pre>



<pre class="wp-block-code"><code><code>Plugins.Oracle.CustomQueriesPath=/etc/zabbix/oracle/sql/</code></code></pre>



<p class="wp-block-paragraph">With this configuration, the Oracle plugin knows exactly where to find your custom SQL scripts.</p>



<p class="wp-block-paragraph">Afterward, restart the Zabbix Agent 2 service:</p>



<pre class="wp-block-code"><code>systemctl restart zabbix-agent2</code></pre>



<h2 class="wp-block-heading" id="h-setup-zabbix-template">Setup Zabbix template</h2>



<p class="wp-block-paragraph">In your Oracle template, create a new <strong>Zabbix agent item</strong> using the following key:</p>



<p class="wp-block-paragraph">oracle.custom.query[&#8220;{$ORACLE.CONNSTRING}&#8221;,&#8221;{$ORACLE.USER}&#8221;,&#8221;{$ORACLE.PASSWORD}&#8221;,&#8221;{$ORACLE.SERVICE}&#8221;,<strong>last_inc0</strong>]</p>



<p class="wp-block-paragraph">Make sure that:</p>



<ul class="wp-block-list">
<li>the query name matches your SQL file name (<code>last_inc0.sql</code>),</li>



<li>and the preprocessing steps are correctly configured.</li>
</ul>



<p class="wp-block-paragraph">Once the item becomes active, Zabbix immediately starts collecting the timestamp of the latest level 0 backup.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="786" height="286" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153119.png" alt="" class="wp-image-42831" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153119.png 786w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153119-300x109.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153119-768x279.png 768w" sizes="auto, (max-width: 786px) 100vw, 786px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="813" height="202" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153316.png" alt="" class="wp-image-42832" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153316.png 813w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153316-300x75.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-153316-768x191.png 768w" sizes="auto, (max-width: 813px) 100vw, 813px" /></figure>



<ul class="wp-block-list">
<li>And now you can see your last backup time. Then you just have to create a trigger with this item and you have finished !</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="25" src="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-160538-1024x25.png" alt="" class="wp-image-42834" srcset="https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-160538-1024x25.png 1024w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-160538-300x7.png 300w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-160538-768x18.png 768w, https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2026/02/Screenshot-2026-02-10-160538.png 1041w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading" id="h-conclusion">Conclusion</h2>



<p class="wp-block-paragraph">By using custom Oracle queries with Zabbix Agent 2, you can quickly extend the default Oracle monitoring capabilities with very little configuration effort.</p>



<p class="wp-block-paragraph">More importantly, this approach helps you detect backup issues early before the FRA fills up and impacts production systems.</p>



<p class="wp-block-paragraph">Because the solution remains fully customizable, you can easily extend it later to monitor additional RMAN metrics that match your operational requirements.</p>



<p class="wp-block-paragraph">You can find other blog regarding Zabbix with this <a href="https://www.dbi-services.com/blog/tag/zabbix/page/3/">link</a>.</p>



<p class="wp-block-paragraph"></p>
<p>L’article <a href="https://www.dbi-services.com/blog/zabbix-oracle-backups-monitoring/">Zabbix &#8211; Oracle backups monitoring</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/zabbix-oracle-backups-monitoring/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: www.dbi-services.com @ 2026-10-23 02:31:58 by W3 Total Cache
-->