MSSQL database wizard issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

MSSQL database wizard issue

Post by Naveed »

I am trying to monitor my databases metrics with nagios XI.

I had executed mssql database monitoring wizard and using my 'sa' user to monitor db metrics.

its giving service check timeout issue after 60 seconds.

I have attached server logs as well, with screenshot.

kindly guide.

Code: Select all

Dec  9 03:11:44 Nagios-VM nagios: wproc:   host=40.78.31.210; service=MSSQL Log Truncations;
Dec  9 03:11:44 Nagios-VM nagios: wproc:   early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
Dec  9 03:11:44 Nagios-VM nagios: Warning: Check of service 'MSSQL Log Truncations' on host '40.78.31.210' timed out after 60.007s!
Dec  9 03:11:44 Nagios-VM nagios: SERVICE ALERT: 40.78.31.210;MSSQL Log Truncations;CRITICAL;SOFT;3;(Service check timed out after 60.01 seconds)
Dec  9 03:11:44 Nagios-VM nagios: wproc: Core Worker 49864: job 127 (pid=51124): Dormant child reaped
Dec  9 03:11:46 Nagios-VM nagios: wproc: Core Worker 49865: job 128 (pid=51132) timed out. Killing it
Dec  9 03:11:46 Nagios-VM nagios: wproc: CHECK job 128 from worker Core Worker 49865 timed out after 60.01s
Dec  9 03:11:46 Nagios-VM nagios: wproc:   host=40.78.31.210; service=master MSSQL Database Size;
Dec  9 03:11:46 Nagios-VM nagios: wproc:   early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
Dec  9 03:11:46 Nagios-VM nagios: Warning: Check of service 'master MSSQL Database Size' on host '40.78.31.210' timed out after 60.010s!
Dec  9 03:11:46 Nagios-VM nagios: wproc: Core Worker 49865: job 128 (pid=51132): Dormant child reaped
Dec  9 03:11:52 Nagios-VM nagios: wproc: Core Worker 49864: job 135 (pid=51171) timed out. Killing it
Dec  9 03:11:52 Nagios-VM nagios: wproc: CHECK job 135 from worker Core Worker 49864 timed out after 60.01s
Dec  9 03:11:52 Nagios-VM nagios: wproc:   host=40.78.31.210; service=masterMSSQL Connection Time;
Dec  9 03:11:52 Nagios-VM nagios: wproc:   early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
Dec  9 03:11:52 Nagios-VM nagios: Warning: Check of service 'masterMSSQL Connection Time' on host '40.78.31.210' timed out after 60.008s!
Dec  9 03:11:52 Nagios-VM nagios: SERVICE ALERT: 40.78.31.210;masterMSSQL Connection Time;CRITICAL;SOFT;2;(Service check timed out after 60.01 seconds)
You do not have the required permissions to view the files attached to this post.
Last edited by dwhitfield on Fri Dec 09, 2016 10:42 am, edited 1 time in total.
Reason: code block...and we do have a 12/9 profile from another thread
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: MSSQL database wizard issue

Post by avandemore »

/usr/local/nagios/etc/nagios.cfg has a setting for global timeout, each plugin may or may not offer a timeout setting(refer to its documentation), and NSClient has its own timeout setting. See their documentation for setting that.

If you run the command from the command line, what is the full output?
Previous Nagios employee
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: MSSQL database wizard issue

Post by dwhitfield »

Also, is 40.78.31.210 the right address? Is MSSQL running on that server?
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: MSSQL database wizard issue

Post by Naveed »

yes
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: MSSQL database wizard issue

Post by dwhitfield »

I think you may have missed this question: If you run the command from the command line, what is the full output? Thanks!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: MSSQL database wizard issue

Post by Naveed »

query is giving solution now..

check_xi_mssql_query!--username test --password "1234" --database master --port 1433 --query "SELECT+%2A+FROM+sys.databases" --decode --querywarning 1500 --querycritical 2000 --result Expected result

I have tried to monitored another query which is "select * from sys.databases" it also gives the same result.

How can I get the total number of databases and can add action parameters in my command.

Thanks
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: MSSQL database wizard issue

Post by dwhitfield »

Naveed wrote: I have tried to monitored another query which is "select * from sys.databases" it also gives the same result.
The same result as what? You attached an OK screenshot, but before you had a timeout screenshot.
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: MSSQL database wizard issue

Post by Naveed »

Yes, I had telnet db port on monitoring server which was not working. I allowed port and its start working for me.

Now 2 different queries are giving same result.

I want to monitor total number of databases but its just giving ok status with query execution time.

Please check and guide.

Thanks
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: MSSQL database wizard issue

Post by rkennedy »

I believe that's the query that is expected, are you looking for it turn return all of the database names?
Now 2 different queries are giving same result.
Please show us these different queries.
Former Nagios Employee
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: MSSQL database wizard issue

Post by Naveed »

I have executed below query which is working fine with below result...

OK: Query results matched, query duration=0.121833 seconds.

I want to add such action parameters those should check that query execution results, e.g query results in tabular form or nothing etc. I dont want query duration.

Please guide.

check_xi_mssql_query!--username abc --password "123" --database Master --port 1433 --query "select++CAPTION%2C+STATUS%2C%0D%0A++CASE+%0D%0A++++WHEN+STATUS+%3D+3+THEN+%27Error%27%0D%0A%09WHEN+status+%3D+4+THEN+%27Finished%27%0D%0A%09WHEN+status+%3D+8+THEN+%27Cancelled%27%0D%0A%09ELSE+%27Unknown%27%0D%0A++END+AS+JobStatus%2C+%0D%0A++BATCHJOBID%2C+%0D%0A++CANCELEDBY%2C%0D%0A++dateadd%28hour%2C+7%2C+STARTDATETIME%29+as+StartTime%2C+dateadd%28hour%2C+7%2C+ENDDATETIME%29+as+EndTime%2C%0D%0Aformat%28ENDDATETIME+-+STARTDATETIME%2C+%27HH%3Amm%3Ass%27%29+as+RunTime+%0D%0Afrom+BATCHJOBHISTORY%0D%0Awhere+dateadd%28hour%2C+7%2CSTARTDATETIME%29+%3E%3D+getdate%28%29+-1+%0D%0Aand+status+in+%283%2C8%29%0D%0A--order+by+%22end+time%22+desc%2C+status%2C+RunTime+DESC+++++++%0D%0AORDER+BY+%5BEndTime%5D%3B" --result "" --decode
Locked