Page 1 of 1
MSSQL DB free space monitor?!
Posted: Fri Nov 01, 2013 5:26 am
by xpertech
Using command check_mssql_database.py to monitor remote MSSQL Server, but the reported value didn't match with DB space?!
Re: MSSQL DB free space monitor?!
Posted: Fri Nov 01, 2013 9:44 am
by slansing
It is 511MB off, is it possible 5011MB were added in the time it took you to take both screenshots?
Re: MSSQL DB free space monitor?!
Posted: Fri Nov 01, 2013 1:57 pm
by xpertech
The second screenshot was immediately taken after the first one, the DB will not increase 500MB in that little time.
Just wondering how check_mssql_database.py calculate the value?
Re: MSSQL DB free space monitor?!
Posted: Fri Nov 01, 2013 2:15 pm
by yancy
xpertech,
Allocated Space - Free Space = Total used
6659MB - 6039MB = 620MB
Plugin calculated space looks like 6294528KB / 1024 = 5527MB
This is a huge difference if i'm doing my math right...
I'll test this on one of our databases to see if I get similar results.
-Yancy
Re: MSSQL DB free space monitor?!
Posted: Fri Nov 01, 2013 2:39 pm
by yancy
Code: Select all
with fs
as
(
select database_id, type, size * 8.0 size
from sys.master_files
)
select
name,
(select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeKB,
(select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeKB
from sys.databases db
Can you run the following and verify size is accurate.
-Yancy
Re: MSSQL DB free space monitor?!
Posted: Sun Nov 03, 2013 9:01 pm
by xpertech
yancy wrote:Code: Select all
with fs
as
(
select database_id, type, size * 8.0 size
from sys.master_files
)
select
name,
(select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeKB,
(select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeKB
from sys.databases db
Can you run the following and verify size is accurate.
-Yancy
We execute that MSSQL command, the displayed value was matched with the DB's GUI properties. So, how the check_mssql_database.py calculate the space?
Re: MSSQL DB free space monitor?!
Posted: Mon Nov 04, 2013 1:21 pm
by slansing
You may want to look into the resolution listed in the comments section of the plugin here:
http://exchange.nagios.org/directory/Pl ... ts/details
It looks like Willem ran into the same issue with the plugin and made a manual change.