Page 1 of 1

Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Sat Jun 01, 2019 3:29 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Mon Jun 03, 2019 1:12 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Thu Jun 06, 2019 7:28 am
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Fri Jun 07, 2019 4:18 pm
by cdienger

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Wed Jul 03, 2019 2:22 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Wed Jul 03, 2019 4:26 pm
by cdienger
Please provide a copy of the nrpe.cfg or common.cfg where check_mssql command is defined.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Thu Jul 04, 2019 12:01 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Tue Jul 09, 2019 1:44 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Thu Jul 11, 2019 2:00 pm
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.

Re: Monitoring MS SQL & My SQLServer with Nagios XI

Posted: Thu Jul 11, 2019 4:31 pm
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.