Nagios XI error "SQL Server message 297, severity 16, state 1, line 1:"

I'm implementing database monitoring for ms SQL server's . i'm able to retrive information for check
 "MSSQL Connection Time"
      Ok       1h 1m 41s       1/5       2015-07-16 13:38:54       OK: Time to connect was 0.00798416137695s" with same credential i'm getting error for below plugin:
master MSSQL Database Size
      error----> "Unknown       1h 10m 42s       5/5       2015-07-16 13:38:56       SQL Server message 297, severity 16, state 1, line 1:"
Does anybody knows this check will work with read only permission or no.

Any idea what permissions we should use while setting up nagios monitoring for mssql database, server and query.

I'm new to ms-sql , please help.
Ranjit ChavanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ranjit ChavanAuthor Commented:
thanks for the info!!
Deepak ChauhanSQL Server DBACommented:
not enough permisssion require "VIEW SERVER STATE " permissions , "VIEW database STATE" and DB_datareader role in each database.

GRANT VIEW SERVER STATE TO <userName> at server level

DB_datareader role at database level

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ranjit ChavanAuthor Commented:
Hi Deepak,

Can you help me in knowing the "VIEW SERVER STATE " permissions , "VIEW database STATE" and DB_datareader role as i only know about serveradmin,sysadmin, setupadmin type of permissions.
and not the one you mentioned. Please help in how to provide these permission in MSSQL database
Deepak ChauhanSQL Server DBACommented:
Ranjit- Sysadmin role allow you to do anything on the server. " View server state" permissions allow to query system DMVs on whole server for eg.
select * from sys.dm_os_wait_stats;

" View database state" permissions allow to query database specific system DMVs

Select * from sys.database_files.

Since this is third party tool and trying to query DMVs to monitor the status. So these permissions will be require. Otherwise sysadmin but you have to be more carefull if you are going to assign sysadmin role to monitoring user.

First: execute this query and check if this solve.

Use master
Grant View server state to <monitoring user>
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.