Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling mount points #573

Closed
wants to merge 6 commits into from
Closed

Handling mount points #573

wants to merge 6 commits into from

Conversation

jzuellig
Copy link
Contributor

@jzuellig jzuellig commented Feb 9, 2023

Bug reports

  • Your operating system name and version
    => Windows Server 2012 R2 to 2022 (MSSQL 2014-2022)
  • Any details about your local setup that might be helpful in troubleshooting
    => MSSQL Setup with multiple Database Files on mount point partitions
  • Detailed steps to reproduce the bug

Mount point

The bug can appear as soon as you start monitoring database files and transaction log if you have mount points
This check plugin uses the "df" section and added all file systems to a dict based on the first letter.
Windows mount points are under a drive letter. This resulted in the last file system in the df section for the drive letter being use for free space calculations.
=> this generated incorrect max sizes because the file system that is used for calculations might not be the one the file is on.

Display only a summary of all Datafiles/Transactionlogs

  • when the Rule "MSSQL datafile and transactionlog discovery" is activated, for every database file the free space is added again to the max size
    => this is illogical if two files are on the same file system: they only have 10 GB left, they can not both grow each 10 GB

Proposed changes

  • What is the expected behavior?

Mount point

  • the plugin respects the mount points
    => the physical name does not get cut off
    => the best matching mount point is used for free space calculations

Display only a summary of all Datafiles/Transactionlogs

  • a file system only is added once per max size calculation, per instance
    => if the file system's free space has already been added to the max size, it will be ignored (set to 0)
  • What is the observed behavior?
    => see bug section

  • Is this a new problem? What made you submit this PR (new firmware, new device, changed device behavior)?
    => Our database team observed the issues after the update from 2.0.0p26 to 2.1.0p17

jzuellig and others added 2 commits February 9, 2023 15:49
prior to this change, the plugin:
- used only drive letters instead of mount points
- summarized the free space for every drive to the max size


now it handles mount points and only adds the free space once per mount 
point to the max size
@jzuellig jzuellig marked this pull request as ready for review February 10, 2023 12:56
@jzuellig
Copy link
Contributor Author

As you can see in the left part of the Screenshot, the max size wrong, because the mount point D:/MSSQL13.SHARED01/MSSQL/DATA/CusLOG/' is used (Last one in df_section with drive letter D)
(15355.25+124890)/1024=136

The max size varies because the log mount point has no the same usage on every host

On the right side of the screenshot, you can see that the max size is calculated with the mount point D:/MSSQL13.SMA/MSSQL/DATA/CusDTA/
(72704.8125+124890)/1024=192

Relevant Agent output of all 4 Nodes of Screenshot

host 1

<<df:sep(9)>>
System NTFS 125247484 82037560 43209924 66% C:
SQL_root NTFS 104724416 57084352 47640064 55% D:
SCSM_dta NTFS 526250944 324053952 202196992 62% D:\MSSQL13.SCSM\MSSQL\DATA\CusDTA
SCSM_log NTFS 157153216 104804736 52348480 67% D:\MSSQL13.SCSM\MSSQL\DATA\CusLOG
SMA_dta NTFS 209580992 135131328 74449664 65% D:\MSSQL13.SMA\MSSQL\DATA\CusDTA
SMA_log NTFS 31421376 10252096 21169280 33% D:\MSSQL13.SMA\MSSQL\DATA\CusLOG
WAP_dta NTFS 10450880 347584 10103296 4% D:\MSSQL13.WAP\MSSQL\DATA\CusDTA
WAP_log NTFS 5208000 990208 4217792 20% D:\MSSQL13.WAP\MSSQL\DATA\CusLOG
SCCM_dta NTFS 73267136 37211584 36055552 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusDTA
SCCM_log NTFS 62781376 31640768 31140608 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusLOG
SHARED02_dta NTFS 314439616 117083904 197355712 38% D:\MSSQL13.SHARED02\MSSQL\DATA\CusDTA
SHARED02_log NTFS 262010816 60445312 201565504 24% D:\MSSQL13.SHARED02\MSSQL\DATA\CusLOG
SHARED01_dta NTFS 104723392 43257152 61466240 42% D:\MSSQL13.SHARED01\MSSQL\DATA\CusDTA
SHARED01_log NTFS 41809856 26086080 15723776 63% D:\MSSQL13.SHARED01\MSSQL\DATA\CusLOG
TempDB ReFS 209518592 72153600 137364992 35% T:
<<<mssql_datafiles:sep(124):cached(1679573471,500)>>>
SMA|SMA|SMA|D:\MSSQL13.SMA\MSSQL\Data\CusDTA\SMA.mdf|0|124890|124172|1

host 2

<<df:sep(9)>>
System NTFS 125247484 84128148 41119336 68% C:
SQL_root NTFS 104724416 21851392 82873024 21% D:
SCSM_dta NTFS 526250944 297288256 228962688 57% D:\MSSQL13.SCSM\MSSQL\DATA\CusDTA
SCSM_log NTFS 157153216 103084480 54068736 66% D:\MSSQL13.SCSM\MSSQL\DATA\CusLOG
SMA_dta NTFS 209580992 135131264 74449728 65% D:\MSSQL13.SMA\MSSQL\DATA\CusDTA
SMA_log NTFS 31421376 10252096 21169280 33% D:\MSSQL13.SMA\MSSQL\DATA\CusLOG
WAP_dta NTFS 10450880 347584 10103296 4% D:\MSSQL13.WAP\MSSQL\DATA\CusDTA
WAP_log NTFS 5208000 1055744 4152256 21% D:\MSSQL13.WAP\MSSQL\DATA\CusLOG
SHARED01_dta NTFS 104723392 43257152 61466240 42% D:\MSSQL13.SHARED01\MSSQL\DATA\CusDTA
SCCM_dta NTFS 73267136 37211584 36055552 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusDTA
SCCM_log NTFS 62781376 31640768 31140608 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusLOG
SHARED02_dta NTFS 314439616 117084160 197355456 38% D:\MSSQL13.SHARED02\MSSQL\DATA\CusDTA
SHARED02_log NTFS 262010816 60445312 201565504 24% D:\MSSQL13.SHARED02\MSSQL\DATA\CusLOG
SHARED01_log NTFS 41809856 26086080 15723776 63% D:\MSSQL13.SHARED01\MSSQL\DATA\CusLOG
TempDB ReFS 209518592 23509120 186009472 12% T:
<<<mssql_datafiles:sep(124):cached(1679573471,500)>>>
SMA|SMA|SMA|D:\MSSQL13.SMA\MSSQL\Data\CusDTA\SMA.mdf|0|124890|124172|1

host 3

<<df:sep(9)>>
C:\ NTFS 125247484 52377956 72869528 42% C:
D:\ NTFS 104724476 6291492 98432984 7% D:
SCCM_dta NTFS 73267136 37211584 36055552 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusDTA
SCCM_log NTFS 62781376 31640768 31140608 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusLOG
SCSM_dta NTFS 524154816 297288192 226866624 57% D:\MSSQL13.SCSM\MSSQL\DATA\CusDTA
SCSM_log NTFS 157153216 103084416 54068800 66% D:\MSSQL13.SCSM\MSSQL\DATA\CusLOG
SHARED01_dta NTFS 104723392 43247680 61475712 42% D:\MSSQL13.SHARED01\MSSQL\DATA\CusDTA
SHARED01_log NTFS 41808832 26072960 15735872 63% D:\MSSQL13.SHARED01\MSSQL\DATA\CusLOG
SHARED02_dta NTFS 314439616 117089024 197350592 38% D:\MSSQL13.SHARED02\MSSQL\DATA\CusDTA
SHARED02_log NTFS 262010816 61591168 200419648 24% D:\MSSQL13.SHARED02\MSSQL\DATA\CusLOG
SMA_dta NTFS 209580992 135131264 74449728 65% D:\MSSQL13.SMA\MSSQL\DATA\CusDTA
SMA_log NTFS 31421376 10252096 21169280 33% D:\MSSQL13.SMA\MSSQL\DATA\CusLOG
WAP_dta NTFS 10450880 347584 10103296 4% D:\MSSQL13.WAP\MSSQL\DATA\CusDTA
WAP_log NTFS 5208000 728064 4479936 14% D:\MSSQL13.WAP\MSSQL\DATA\CusLOG
TempDB NTFS 209580992 24738624 184842368 12% T:
<<<mssql_datafiles:sep(124):cached(1679573471,500)>>>
SMA|SMA|SMA|D:\MSSQL13.SMA\MSSQL\Data\CusDTA\SMA.mdf|0|124890|124172|1

host 4

<<df:sep(9)>>
System NTFS 125247484 79077152 46170332 64% C:
SQL_root NTFS 104724416 10099072 94625344 10% D:
SCSM_dta NTFS 526250944 297288192 228962752 57% D:\MSSQL13.SCSM\MSSQL\DATA\CusDTA
SCSM_log NTFS 157153216 103084416 54068800 66% D:\MSSQL13.SCSM\MSSQL\DATA\CusLOG
SMA_dta NTFS 209580992 135131264 74449728 65% D:\MSSQL13.SMA\MSSQL\DATA\CusDTA
SMA_log NTFS 15693760 10252096 5441664 66% D:\MSSQL13.SMA\MSSQL\DATA\CusLOG
WAP_dta NTFS 10450880 347584 10103296 4% D:\MSSQL13.WAP\MSSQL\DATA\CusDTA
WAP_log NTFS 5208000 1055744 4152256 21% D:\MSSQL13.WAP\MSSQL\DATA\CusLOG
SCCM_dta NTFS 73267136 37211584 36055552 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusDTA
SCCM_log NTFS 62781376 31640768 31140608 51% D:\MSSQL13.SCCM\MSSQL\DATA\CusLOG
SHARED02_dta NTFS 314439616 117083904 197355712 38% D:\MSSQL13.SHARED02\MSSQL\DATA\CusDTA
SHARED02_log NTFS 262010816 60445312 201565504 24% D:\MSSQL13.SHARED02\MSSQL\DATA\CusLOG
SHARED01_dta NTFS 104723392 43257344 61466048 42% D:\MSSQL13.SHARED01\MSSQL\DATA\CusDTA
SHARED01_log NTFS 41809856 26086080 15723776 63% D:\MSSQL13.SHARED01\MSSQL\DATA\CusLOG
Backup NTFS 526250944 247552 526003392 1% E:
TempDB ReFS 209518592 37921600 171596992 19% T:
<<<mssql_datafiles:sep(124):cached(1679573471,500)>>>
SMA|SMA|SMA|D:\MSSQL13.SMA\MSSQL\Data\CusDTA\SMA.mdf|0|124890|124172|1

@github-actions
Copy link

github-actions bot commented Jun 14, 2023

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jzuellig
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@CheckmkCI CheckmkCI force-pushed the master branch 2 times, most recently from 875a494 to 3419412 Compare May 29, 2024 08:27
@jzuellig jzuellig closed this May 31, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants