Monitoring MS SQL & My SQLServer with Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vinish098
Posts: 136
Joined: Fri Oct 21, 2016 6:30 am

Monitoring MS SQL & My SQLServer with Nagios XI

Post by vinish098 »

Hi team,

We are monitoring MS SQL & My SQL Server in Nagios Server.

Services need to be monitor is below:

1. SQL Server logs need to be monitor.
2. Blocking transactions: If any long queries is going to take that query need to show.
3. When Database is offline.

Please do needful for this requirement how to follow.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by npolovenko »

Hello, @vinish098. Please take a look at this doc describing how to monitor an SQL server with NagiosXI:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Here is the list of other SQL related plugins on the Nagios Exchange:
https://exchange.nagios.org/directory/P ... /SQLServer

Let me know if you think these plugins would work with your requirements.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinish098
Posts: 136
Joined: Fri Oct 21, 2016 6:30 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by vinish098 »

Hi npolovenko,

Thanks for your reply.

As per you shared document it is fine. But the requirement is like below:

1. If any job fail in Database this fail throw in error log then need to get alert.
2. If any query is taking long time more than expected time then need to get alert.

Please do needful.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by cdienger »

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinish098
Posts: 136
Joined: Fri Oct 21, 2016 6:30 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by vinish098 »

Hello team,

I am trying to run below command and getting one error is below:

[root@incrpvmnagios-dev libexec]# ./check_nrpe -H <sql server ip> -c check_mssql -a 'Jobs'
UNKNOWN: MSSQLSERVER Exception: Cannot convert value to type System.String. .
MSSQLSERVER Exception: Cannot convert value to type System.String. .|

Please help me.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by cdienger »

Please provide a copy of the nrpe.cfg or common.cfg where check_mssql command is defined.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinish098
Posts: 136
Joined: Fri Oct 21, 2016 6:30 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by vinish098 »

Hi team,

I attached commands.cfg file where check_mssql command is stored. One thing we are getting out for remaining services like "Connectiontime", DBstatus, Tempdbsize. we are only facing "jobs" service issue.

And one more plugin error is facing check_mssql_query(plugin). While running our own query in mssql server we are able to get output but whenever we tried to run mssql query in nagios configuration wizard we are facing error. I attached error for mssql query running. Actually we are trying to monitor longqueries running in mssql server we need to get alert in nagios xi. We are getting output in mssql server but we are facing error like couldnot be execute need in nagios.

please help me.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by cdienger »

The commands.cfg was taken from the XI server. The nrpe.cfg or common.cfg will be found on the sql server where the nrpe agent is installed.

To avoid confusion that can occur if multiple issues are addressed in a single thread, it is best to open a new thread for each issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinish098
Posts: 136
Joined: Fri Oct 21, 2016 6:30 am

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by vinish098 »

Hello cdienger,

Thanks for your reply.

While running one custom plugin in Nagios getting error like “Error: Perl: while loading libraries is not working /use/bin/perl: no such file or directory”.

Please do needful.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Post by lmiltchev »

Usually, check_mssql plugin is run directly against the MSSQL server, not through check_nrpe...

Example:

Code: Select all

/usr/local/nagios/libexec/check_mssql -H 152.63.3.143 --username "xxx" --password "xxx" --database master --port 1433 --query "xxx" --decode --warning 50 --critical 200 --querywarning 50 --querycritical 200 --result "Expected result"
It seems like you are trying to use check_nrpe and run your command "locally", on the MSSQL server...
./check_nrpe -H <sql server ip> -c check_mssql -a 'Jobs'
In order to do this, you will have to have NRPE agent installed, and "check_mssql" command defined on the client (remote machine), NOT on the Nagios XI server... This is why, @cdienger was asking for a "copy of the nrpe.cfg or common.cfg where check_mssql command is defined".

What happens if you run your check as in my example? Do you get the expected output?
While running one custom plugin in Nagios getting error like “Error: Perl: while loading libraries is not working /use/bin/perl: no such file or directory”.
If you are troubleshooting a different (custom) plugin, this would be a different issue. Please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked