久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='9ttoW'><style id='9ttoW'><dir id='9ttoW'><q id='9ttoW'></q></dir></style></legend>
    1. <small id='9ttoW'></small><noframes id='9ttoW'>

        <bdo id='9ttoW'></bdo><ul id='9ttoW'></ul>
      <i id='9ttoW'><tr id='9ttoW'><dt id='9ttoW'><q id='9ttoW'><span id='9ttoW'><b id='9ttoW'><form id='9ttoW'><ins id='9ttoW'></ins><ul id='9ttoW'></ul><sub id='9ttoW'></sub></form><legend id='9ttoW'></legend><bdo id='9ttoW'><pre id='9ttoW'><center id='9ttoW'></center></pre></bdo></b><th id='9ttoW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9ttoW'><tfoot id='9ttoW'></tfoot><dl id='9ttoW'><fieldset id='9ttoW'></fieldset></dl></div>

    2. <tfoot id='9ttoW'></tfoot>

      如何使用 Zabbix 監控數據庫文件大小

      How to monitor database file size using Zabbix(如何使用 Zabbix 監控數據庫文件大小)
          <tfoot id='aG7D1'></tfoot>

            1. <legend id='aG7D1'><style id='aG7D1'><dir id='aG7D1'><q id='aG7D1'></q></dir></style></legend>
            2. <small id='aG7D1'></small><noframes id='aG7D1'>

                <bdo id='aG7D1'></bdo><ul id='aG7D1'></ul>

                <i id='aG7D1'><tr id='aG7D1'><dt id='aG7D1'><q id='aG7D1'><span id='aG7D1'><b id='aG7D1'><form id='aG7D1'><ins id='aG7D1'></ins><ul id='aG7D1'></ul><sub id='aG7D1'></sub></form><legend id='aG7D1'></legend><bdo id='aG7D1'><pre id='aG7D1'><center id='aG7D1'></center></pre></bdo></b><th id='aG7D1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aG7D1'><tfoot id='aG7D1'></tfoot><dl id='aG7D1'><fieldset id='aG7D1'></fieldset></dl></div>

                  <tbody id='aG7D1'></tbody>
                本文介紹了如何使用 Zabbix 監控數據庫文件大小的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我需要能夠在 Zabbix 中監控數據庫文件空間.我已經嘗試了許多用于監控 SQL Server 的模板,但它們似乎沒有做我需要它們做的事情.本質上,我需要知道特定數據庫的數據庫文件或日志文件(.mdf 或 .ldf)何時在一定百分比范圍內已滿.

                I need to be able to monitor database file space in Zabbix. I have tried out many of the templates for monitoring SQL Server and they don't seem to do what I need them to do. Essentially, I need to know when a database file or log file (.mdf or .ldf) for a particular database is within a certain percentage of being full.

                基本上我希望:

                1. 發現服務器上每個數據庫中的所有數據和日志文件
                2. 為每個文件創建兩個項目,使用空間和最大空間(考慮自動增長)
                3. 為每個文件創建一個觸發器,當數據或日志文件處于已滿的特定百分比范圍內時會提醒我(例如,80% 已滿警告,90% 嚴重)

                由于我們的環境規模和網絡限制,不能使用 ODBC.我相信我需要使用 PowerShell 的某種類型的發現腳本,然后是另一個腳本來獲取項目的值,但我不確定.

                Using ODBC is not an option due to the size of our environment and network restrictions. I believe I need some type of discovery script using PowerShell, then another script to fetch the values for the items, but I'm not sure.

                推薦答案

                不知道 Zabbix 是什么(稍后我會看一看),但在 SQL Server 中,你有 sp_MSforeachdb

                No idea what Zabbix is (I'll take a peek later), but in SQL Server, you have sp_MSforeachdb

                這里我們創建一個#Temp表來收集服務器上每個數據庫的結果

                Here we create a #Temp table to collect the results from each database on the server

                示例

                Use Master;
                Create table #Temp (DBName varchar(150),FileType varchar(50),MBytes bigint,MBytesMax bigint)
                
                EXEC sp_MSforeachdb '
                 Insert Into #Temp
                 Select DBName    = ''?''
                       ,FileType  = case when physical_name like ''%.mdf'' then ''Database'' else ''Log'' end
                       ,MBytes    = try_convert(bigint,size) * 8 / 1024   
                       ,MBytesMax = try_convert(bigint,max_size) * 8 / 1024   
                  From  [?].sys.database_files 
                '
                
                Select *
                      ,Pct = convert(decimal(10,1),(MBytes *100.0) / nullif(MBytesMax,0))
                 From  #Temp
                

                退貨

                DBName  FileType    MBytes  MBytesMax   Pct
                master  Database    4       0           NULL
                master  Log         1       0           NULL
                tempdb  Database    816     0           NULL
                tempdb  Log         894     0           NULL
                msdb    Database    201     0           NULL
                msdb    Log         19      2097152     0.0
                xxxxxxx Database    761     4096        18.6
                xxxxxxx Log         1       2097152     0.0
                yyyyyyy Database    533     4096        13.0
                yyyyyyy Log         1       2097152     0.0
                zzzzzzz Database    1641    4096        40.1
                zzzzzzz Log         1       2097152     0.0
                

                這篇關于如何使用 Zabbix 監控數據庫文件大小的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)
                <tfoot id='U9AWk'></tfoot>
                  <tbody id='U9AWk'></tbody>
                    <i id='U9AWk'><tr id='U9AWk'><dt id='U9AWk'><q id='U9AWk'><span id='U9AWk'><b id='U9AWk'><form id='U9AWk'><ins id='U9AWk'></ins><ul id='U9AWk'></ul><sub id='U9AWk'></sub></form><legend id='U9AWk'></legend><bdo id='U9AWk'><pre id='U9AWk'><center id='U9AWk'></center></pre></bdo></b><th id='U9AWk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='U9AWk'><tfoot id='U9AWk'></tfoot><dl id='U9AWk'><fieldset id='U9AWk'></fieldset></dl></div>
                    <legend id='U9AWk'><style id='U9AWk'><dir id='U9AWk'><q id='U9AWk'></q></dir></style></legend>

                      <small id='U9AWk'></small><noframes id='U9AWk'>

                      • <bdo id='U9AWk'></bdo><ul id='U9AWk'></ul>

                          主站蜘蛛池模板: 九九九久久国产免费 | 亚洲视频三区 | 天堂一区在线观看 | 亚洲毛片一区二区 | 最新黄色在线观看 | 91在线看 | 欧美一区二区三区视频在线播放 | 久久久久久国产精品免费 | 国产精品亚洲第一区在线暖暖韩国 | 欧美日韩亚洲视频 | 免费观看av网站 | 97精品一区二区 | 日本高清视频在线播放 | 在线不卡视频 | 96国产精品久久久久aⅴ四区 | 精品免费国产一区二区三区四区 | 成人精品一区二区 | 中文字幕国产一区 | 久久一区二区精品 | 欧美精品一二三 | 免费一区二区三区 | 日本a视频 | 久久网站黄 | 亚洲综合色视频在线观看 | 国产成人免费视频网站高清观看视频 | 精品久久九| 亚洲一区有码 | 欧美日韩一| 日韩成人久久 | 嫩草视频在线看 | 日韩欧美综合 | 国产一区二区三区在线免费观看 | 日日干夜夜操 | 亚洲色图综合 | 2021狠狠干 | 人成在线视频 | 在线播放中文字幕 | 神马久久久久久久久久 | 丁香综合| 麻豆av片 | 国产精品一区二区免费 |