Page 1 of 1

SQL Server Wizard - troubleshooting

Posted: Wed May 29, 2019 8:04 am
by MikeMAN987
Hi Team,

We have recently followed the SQL Monitoring guide in order to start checking the performance of our SQL server. We worked through a few firewall issues (when those checks failed, we got a failure to connect message as expected..) Now that those have been resolved, the only error message we can see is that the service check timed out after 60.01 seconds.

We have tried, by instance, by database, with and without ports.

Wanted to ask a few questions:
Is there any verbose logging on the SQL plugin itself on the server? Happy to look through logs for other items.
Currently see the traffic allowed from the Nagios XI server to the SQL server, but no authentication failures etc in the SQL logs.

Thanks for any insight!

Regards,

Re: SQL Server Wizard - troubleshooting

Posted: Wed May 29, 2019 12:21 pm
by tgriep
Most plugins have some sort of debugging or verbose option to get more details and to find then, run the plugin with the --help option and it should print out all of the available options for the plugin.

There are a few SQL wizards available on the system, which one did you run?

Re: SQL Server Wizard - troubleshooting

Posted: Wed May 29, 2019 12:41 pm
by MikeMAN987
Hello,

We are running the SQL Server Wizard (not database and not query). Specifically check_mssql_server.py.

I don't see an option for additional verbose logging..

Usage: check_mssql_server.py -H hostname -U user -P password -T table --mode

Options:
-h, --help show this help message and exit

Required Options:
-H HOSTNAME, --hostname=HOSTNAME
Specify MSSQL Server Address
-U USER, --user=USER
Specify MSSQL User Name
-P PASSWORD, --password=PASSWORD
Specify MSSQL Password

Optional Connection Information:
-I INSTANCE, --instance=INSTANCE
Specify instance
-p PORT, --port=PORT
Specify port.

Nagios Plugin Information:
-w WARNING, --warning=WARNING
Specify warning range.
-c CRITICAL, --critical=CRITICAL
Specify critical range.

Mode Options:
--pagelooks Page Lookups Per Second
--batchreq Batch Requests / Sec
--lockwaits Lockwaits / Sec
--pagereads Page Reads / Sec
--totalpages Total Pages (Cumulative)
--readahead Readahead Pages / Sec
--pagewrites Page Writes / Sec
--stolenpages Stolen Pages
--targetpages Target Pages
--fullscans Full Scans / Sec
--locktimeouts Lock Timeouts / Sec
--test Run tests of all queries against the database.
--freepages Free Pages (Cumulative)
--bufferhitratio Buffer Cache Hit Ratio
--averagewait Average Wait Time (ms)
--time2connect Time to connect to the database.
--checkpoints Checkpoint Pages / Sec
--lockrequests Lock Requests / Sec
--pagelife Page Life Expectancy
--databasepages Database Pages
--deadlocks Deadlocks / Sec
--cachehit Cache Hit Ratio
--pagesplits Page Splits / Sec
--lockwait Lock Wait Time (ms)
--lazywrites Lazy Writes / Sec
--sqlcompilations SQL Compilations / Sec

Re: SQL Server Wizard - troubleshooting

Posted: Wed May 29, 2019 1:17 pm
by tgriep
That plugin does not have an option to output verbose information but if you run the plugin with python trace module, it will output a lot of data to you can check it for any errors.
The following example is what you would use.

Code: Select all

python -m trace --trace /usr/local/nagios/libexec/check_mssql_server.py -H xxx.xxx.xxx.xxx -U 'user' -P 'pass' -I 'instance' --freepages --warning 10 --critical 20
FYI, the output is very large so redirect it to a file so you can view the output with an editor.

Re: SQL Server Wizard - troubleshooting

Posted: Thu May 30, 2019 11:11 am
by MikeMAN987
Thanks for that. It allowed me to find out we have some sort of auth error we will have the DBA's look at. Thank you!! Feel free too close.

Re: SQL Server Wizard - troubleshooting

Posted: Thu May 30, 2019 12:11 pm
by scottwilkerson
MikeMAN987 wrote:Thanks for that. It allowed me to find out we have some sort of auth error we will have the DBA's look at. Thank you!! Feel free too close.
Great!

Locking