Page 1 of 2

Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Aug 29, 2017 5:02 pm
by tsabit
Hi Support,

I have question about monitoring MSSQL Query on Nagios XI.
Can I monitor llike a query below

select BPRCEFFDAT, BSCHEDNAM, BSDATMSTRT, BSDATMENDD, datediff(minute,BSDATMSTRT,BSDATMENDD) total_menit from VM1DTA.BSSCPF where

cast(BPRCEFFDAT as date) =DATEADD(day,-2,cast(getdate() as date)) and BSCHEDNAM not in('L2AGTMGRPC','L2IMPORCLD') order by DATIME asc



IF The query is running.if need the time to execute the result is time execution on the query get more 70 Minutes i will get notification om=n email

Please assist me.

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Wed Aug 30, 2017 1:14 pm
by dwhitfield
If you want it to notify when it takes over 70 minutes, you'll need to use 4200. I filed a feature request so that the units get added to that metric.

As far as the query itself, does it return a numeric result? The Query Warning and Critical only work in this context with numeric results.

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Mon Sep 04, 2017 6:13 pm
by tsabit
Hi dwhitfield,

the query result on attachment.the field "total_menit" get the numeric result.
if the Nagios can monitor those query.

i have tried on Nagios XI but still not resolve.

please assist me.

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 05, 2017 7:43 am
by tacolover101
what error(s) have you seen Nagios XI returning?

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 05, 2017 2:04 pm
by dwhitfield
tsabit wrote:
i have tried on Nagios XI but still not resolve.
Are you saying to host is not resolving from XI or that the issue is not resolved?

Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh

That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

UPDATE: Profile received and shared with techs

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Mon Sep 11, 2017 10:29 pm
by tsabit
tacolover101 wrote:what error(s) have you seen Nagios XI returning?
Hi,

i have tried to add query but is not resolved.please assist me

the error query is attached

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 12, 2017 7:52 am
by scottwilkerson
This error looks like you have incorrect line ending in your plugin.

you will likely need to correct this with a utility something lok dos2unix

Code: Select all

dos2unix /path/to/plugin/check_plugin

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 12, 2017 9:40 am
by tsabit
scottwilkerson wrote:This error looks like you have incorrect line ending in your plugin.

you will likely need to correct this with a utility something lok dos2unix

Code: Select all

dos2unix /path/to/plugin/check_plugin
Hi,

Okay i will run the command on nagios xi server. You mean there is no plugin on the nagiosxi?

This is point for the customer to monitor mssql query.if can monitor the query like above i really thank's a lot

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 12, 2017 9:47 am
by scottwilkerson
tsabit wrote:
Hi,

i have tried to add query but is not resolved.please assist me

the error query is attached
As I look at this thread again, I see you were using the wizard which doesn't use a bash script, however the error in the picture above is an error of an incorrect script.

Please share the command this service is using found in the CCM

Re: Hw To Monitor MS SQL Query on Nagios XI

Posted: Tue Sep 12, 2017 11:55 am
by tsabit
Hi,

I just test the query "select coloumn from table "

But the result is error .

The customer wanna monitor the query with result like above capture but i have tried still error.

I confuse about monitoring query