Monitoring SQL Database - inside.
-
- Posts: 10
- Joined: Wed Mar 07, 2018 7:19 am
Monitoring SQL Database - inside.
Hello again,
I come with another question from my side.
Specifically, I mean the SQL database.
I have a database on a separate server to which data goes over the TCP/IP port.
I would like (if it is possible) to get inside the sql database from the server Nagios also on the TCP/IP port.
In the database from time to time appear "errors" from my application (defined by me). Can I call a plugin to let Nagios detect this and inform me about it when the line with the keyword "1" appears in the "error" column?
What agent to install?
How can you possibly approach this topic?
I will be grateful for every tips, because I have no idea how to counter it and if it is possible.
Regards!
I come with another question from my side.
Specifically, I mean the SQL database.
I have a database on a separate server to which data goes over the TCP/IP port.
I would like (if it is possible) to get inside the sql database from the server Nagios also on the TCP/IP port.
In the database from time to time appear "errors" from my application (defined by me). Can I call a plugin to let Nagios detect this and inform me about it when the line with the keyword "1" appears in the "error" column?
What agent to install?
How can you possibly approach this topic?
I will be grateful for every tips, because I have no idea how to counter it and if it is possible.
Regards!
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitoring SQL Database - inside.
Hello, @Melanie123. I would recommend using one of MySQL query plugins, to query the data table and get the check in a critical state based on specified thresholds. For example, this one:
https://www.monitoring-plugins.org/doc/ ... query.html
https://www.monitoring-plugins.org/doc/ ... query.html
It's a standard plugin, so you should already have it in the /usr/local/nagios/libexec/ directory.cd /usr/local/nagios/libexec/
[root@centos7x64 libexec]# ./check_mysql_query
Must specify a SQL query to run
Usage:
check_mysql_query -q SQL_query [-w warn] [-c crit] [-H host] [-P port] [-s socket]
[-d database] [-u user] [-p password] [-f optfile] [-g group]
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 10
- Joined: Wed Mar 07, 2018 7:19 am
Re: Monitoring SQL Database - inside.
Yes, that's it!
But... How can this plugin also support the MS SQL database?
I found "check_mssql" (https://exchange.nagios.org/directory/P ... ql/details), i think this is what i search.
But... How can this plugin also support the MS SQL database?
I found "check_mssql" (https://exchange.nagios.org/directory/P ... ql/details), i think this is what i search.
-
- Posts: 10
- Joined: Wed Mar 07, 2018 7:19 am
Re: Monitoring SQL Database - inside.
I configured everything - I think.
And when I tried plugin:
I have this:
And I have no idea what else to change.
And when I tried plugin:
Code: Select all
./check_mssql -H x.x.x.x -U Administrator -P 'xxx' -p 1433 -d test -q "SELECT COUNT(*) FROM test"
Code: Select all
CRITICAL: Could not connect to dblib:host=x.x.x.x;dbname=test as Administrator (Exception: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)).
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitoring SQL Database - inside.
@Melanie123, Please check out this troubleshooting guide that we have:
https://support.nagios.com/kb/article/n ... d-735.html
https://support.nagios.com/kb/article/n ... d-735.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 10
- Joined: Wed Mar 07, 2018 7:19 am
Re: Monitoring SQL Database - inside.
npolovenko, I tried everything, but nothing changed. Do you have any idea yet?
Re: Monitoring SQL Database - inside.
You might try some of the various Python based plugins for SQL Server:
https://github.com/NagiosEnterprises/ch ... ollection/
This will help identify if it's a SQL Server connection issue, or an issue with the check_mssql plugin you used previously.
https://github.com/NagiosEnterprises/ch ... ollection/
This will help identify if it's a SQL Server connection issue, or an issue with the check_mssql plugin you used previously.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Monitoring SQL Database - inside.
Former Nagios employee
-
- Posts: 10
- Joined: Wed Mar 07, 2018 7:19 am
Re: Monitoring SQL Database - inside.
Are these plugins compatible with MS SQL 2014?
I found the information in all that they support to the 2008/2012 server version.
Now I have problems with connecting to the SQL server and I'm looking for the source of the problem.
I found the information in all that they support to the 2008/2012 server version.
Now I have problems with connecting to the SQL server and I'm looking for the source of the problem.
Re: Monitoring SQL Database - inside.
I haven't encountered any issues with using these plugins against SQL Server 2014. Admittedly, I haven't tested every possible use of the plugins.Melanie123 wrote:Are these plugins compatible with MS SQL 2014?
Can you share the error message that the plugins are producing? It may give us useful insights for troubleshooting.Melanie123 wrote:Now I have problems with connecting to the SQL server and I'm looking for the source of the problem.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/