lmiltchev wrote:Can you show us the actual command that you are running from the command line along with the output of it? Hide sensitive info.
Example:
You can use either port or an instance name but not both. Also, check the permissions of your user. I believe, the user needs server level permissions of "Connect SQL" and "View server state." Also needs database level permissions of "Connect" and "Select". To check these permissions, the user have to log in the MSSQL server, and run the following queries:Code: Select all
/usr/local/nagios/libexec/check_mssql_server.py -H x.x.x.x -U 'username' -P 'password' -I 'instancename' --time2connect --warning 1 --critical 5 OK: Time to connect was 0.00740003585815s|time=0.00740003585815s;1;5;;
Code: Select all
SELECT * FROM fn_my_permissions(null, 'DATABASE') SELECT * FROM fn_my_permissions(null, 'SERVER')
CLI-based check works
[root@fikc-nagxidev01 ~]# /usr/local/nagios/libexec/check_mssql_server.py -H 10.x.x.30 -U 'nagiosxi' -P 'xxxxxxxx' -I 'FIHPSQL04S1' --time2connect --warning 1 --critical 5
OK: Time to connect was 0.0354108810425s|time=0.0354108810425s;1;5;;
GUI-based does not (generated by the Wizard)
COMMAND: /usr/local/nagios/libexec/check_mssql_server.py -H 10.x.x.30 -U 'nagiosxi' -P \'xxxxxxx
#- "\" actually not there; password is incomplete; no ending (') or the rest of the argument wizard placed into ARG2
OUTPUT: DB-Lib error message 20009, severity 9:
Unable to connect: Adaptive Server is unavailable or does not exist
Net-Lib error during Connection refused Error 111 - Connection refused