Page 1 of 1

MSSQL Database permissions

Posted: Fri Aug 23, 2013 11:05 am
by Mwr_support
Hello,
We are having difficulty configuring the proper permissions to monitor Wait times and Deadlocks for MSSQL (via the check_xi_mssql_server script). The 'MSSQL Connection Time' portion of check_xi_mssql_server script is working properly.

Presently, we have granted the Nagios SQL account to have public and db_datareader permissions the master and tempdb databases. What are we missing?

Any help is greatly appreciated. Thank you.

Re: MSSQL Database permissions

Posted: Fri Aug 23, 2013 11:15 am
by abrist
Could you post a full version of the check command you are attempting? The proper permissions are mode/check dependent.

Re: MSSQL Database permissions

Posted: Fri Aug 23, 2013 11:32 am
by Mwr_support
MSSQL Deadlocks Per Sec
COMMAND: /usr/local/nagios/libexec/check_mssql_server.py -H 192.168.0.142 -U 'user' -P 'password' -p 1433 --deadlocks --warning 20 --critical 30
OUTPUT: SQL Server message 297, severity 16, state 1, line 1:
The user does not have permission to perform this action.
DB-Lib error message 297, severity 16:
General SQL Server error: Check messages from the SQL Server

MSSQL Lock Wait Times
COMMAND: /usr/local/nagios/libexec/check_mssql_server.py -H 192.168.0.142 -U 'user' -P 'password' -p 1433 --lockwait --warning 2000 --critical 3000
OUTPUT: SQL Server message 297, severity 16, state 1, line 1:
The user does not have permission to perform this action.
DB-Lib error message 297, severity 16:
General SQL Server error: Check messages from the SQL Server

MSSQL Connection Time (working properly)
COMMAND: /usr/local/nagios/libexec/check_mssql_server.py -H 192.168.0.142 -U 'user' -P 'password' -p 1433 --time2connect --warning 1 --critical 5
OUTPUT: OK: Time to connect was 0.0089008808136s|time=0.0089008808136s;1;5;;;

Re: MSSQL Database permissions

Posted: Fri Aug 23, 2013 1:33 pm
by slansing
It looks like the user you are connecting to on the remote host does not have permission to run those queries. Are they able to do it on the system if you log in manually? It's not the nagios mysql account, its the one on the remote DB that you are accessing that is having the problems.