Nagios MSSQL Query Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FrontlineIT
Posts: 94
Joined: Tue Jul 26, 2016 8:46 am

Nagios MSSQL Query Monitoring

Post by FrontlineIT »

Hello,

We have a MSSQL monitor we would like to error if the result is less than 1. How would we go about setting that up? Below is an example of a monitor that's going into error when the result is > 1. However, we'd like it to error if < 1. Also, we'd like to collect performance data results so that we can analyze graph trends.

check_xi_mssql_query!--username ********* --password "**********" --database ********* --instance ********** --query "SELECT COUNT(1) AS [JobsExecuted] FROM JAMS.dbo.hist WITH (NOLOCK) WHERE start_time > DATEADD(MINUTE,-5,GETUTCDATE())" --result "" --decode --warning 50 --critical 200 --querywarning 0 --querycritical 1!!!!!!!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios MSSQL Query Monitoring

Post by dwhitfield »

What version of XI are you running? There are some bugs related to this that you may be hitting. Also, make sure you are using the latest versions of the wizards. The wizards do not get automatically update with you update XI. You can update the wizards from Admin > Manage Config Wizards.

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.

If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
FrontlineIT
Posts: 94
Joined: Tue Jul 26, 2016 8:46 am

Re: Nagios MSSQL Query Monitoring

Post by FrontlineIT »

We were able to figure out how to do this by simply adding a colon after the monitoring threshold. Now the monitor alerts if the queue is less than 1. Example of the working monitor below:

check_xi_mssql_query --username ********* --password "**********" --database ********* --instance ********** --query "SELECT COUNT(1) AS [JobsExecuted] FROM JAMS.dbo.hist WITH (NOLOCK) WHERE start_time > DATEADD(MINUTE,-5,GETUTCDATE())" --result "" --decode --warning 50 --critical 200 --querycritical 1:

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

Re: Nagios MSSQL Query Monitoring

Post by dwhitfield »

Did you have any other questions or are we ready to lock it up?
FrontlineIT
Posts: 94
Joined: Tue Jul 26, 2016 8:46 am

Re: Nagios MSSQL Query Monitoring

Post by FrontlineIT »

This has been resolved and closed.
kyang

Re: Nagios MSSQL Query Monitoring

Post by kyang »

Sounds great! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!
Locked