Hw To Monitor MS SQL Query on Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
tsabit
Posts: 35
Joined: Thu Sep 15, 2016 3:26 am

Hw To Monitor MS SQL Query on Nagios XI

Post 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.
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: Hw To Monitor MS SQL Query on Nagios XI

Post 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.
tsabit
Posts: 35
Joined: Thu Sep 15, 2016 3:26 am

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Hw To Monitor MS SQL Query on Nagios XI

Post by tacolover101 »

what error(s) have you seen Nagios XI returning?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
Last edited by dwhitfield on Tue Sep 12, 2017 9:43 am, edited 1 time in total.
Reason: pm received
tsabit
Posts: 35
Joined: Thu Sep 15, 2016 3:26 am

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tsabit
Posts: 35
Joined: Thu Sep 15, 2016 3:26 am

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tsabit
Posts: 35
Joined: Thu Sep 15, 2016 3:26 am

Re: Hw To Monitor MS SQL Query on Nagios XI

Post 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
Locked