What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How can I monitor MySQL performance via MySQLv2 sensor

Votes:

2

Implementing MySQL performance monitoring via the MySQL v2 sensor.

  1. Create the SQL file to pull the statistics you would like.
    C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\sql\mysql\Queries_Threads_SlowQueries.sql
  2. Insert the following query:
    SELECT * from information_schema.GLOBAL_STATUS where VARIABLE_NAME='QUERIES' OR VARIABLE_NAME='THREADS_CONNECTED' OR VARIABLE_NAME='THREADS_RUNNING' OR VARIABLE_NAME='SLOW_QUERIES' ;
  3. Add MySQL v2 sensor and configure it like this:
OptionSetting Or Value
Sensor NameQUERIES THREADS_CONNECTED SLOW_QUERIES
Database<name of your mysql database>
Select Channel Value byKey Value Pair
Sensor Channel #1 NameQueries
Select Channel Value byKey value pair
Sensor Channel #1 NameQUERIES
Sensor Channel #1 KeyQUERIES
Sensor Channel #1 ModeDifference
Sensor Channel #1 UnitCount
Sensor Channel #2 NameTHREADS_CONNECTED
Sensor Channel #2 KeyTHREADS_CONNECTED
Sensor Channel #2 ModeAbsolute
Sensor Channel #2 UnitCount
Sensor Channel #3 NameTHREADS_RUNNING
Sensor Channel #3 KeyTHREADS_RUNNING
Sensor Channel #3 ModeAbsolute
Sensor Channel #3 UnitCount
Sensor Channel #4 NameSLOW_QUERIES
Sensor Channel #4 KeySLOW_QUERIES
Sensor Channel #4 ModeDifference
Sensor Channel #4 UnitCount

mysql mysql-v2-sensor performance performance-counters performancecounter prtg

Created on Oct 25, 2016 12:32:23 AM

Last change on Oct 31, 2016 6:16:06 PM by  Stephan Linke [Paessler Support]



6 Replies

Votes:

1

Sharing is caring, thanks! :)

Created on Oct 26, 2016 8:31:22 AM by  Stephan Linke [Paessler Support]



Votes:

0

Thanks for the formatting. I did not realize you supported wiki markup.

Per https://kb.paessler.com/en/topic/63737-how-can-i-share-my-self-written-prtg-script-program-with-other-prtg-users

Can we please change the title to:

"How can I monitor MySQL performance via MySQLv2 sensor"

Created on Oct 31, 2016 6:02:54 PM



Votes:

0

Done :)

Created on Oct 31, 2016 6:16:26 PM by  Stephan Linke [Paessler Support]



Votes:

0

Hello,

Your .sql file doesn't work

i got this "Can not log in using the specified credentials!"

The linux account is informed well about the equipment.

Any idea ?

Created on Jun 14, 2018 2:14:21 PM



Votes:

0

Did you try this in the SQLv2.exe (in the sensor system directory)? Are Windows credentials configured for the device? If so, please remove them (or break inheritance). Otherwise, kerberos might be used in combination with the Linux credentials.


Kind regards,
Stephan Linke, Tech Support Team

Created on Jun 15, 2018 9:07:08 AM by  Stephan Linke [Paessler Support]



Votes:

2

Instead of using 'INFORMATION_SCHEMA.GLOBAL_STATUS' you should use 'performance_schema.global_status' when using MySQL 5.7.6 or newer. A deprecation warning is raised when selecting from the INFORMATION_SCHEMA tables using newer MySQL versions and in MySQL 8.0 it wont even work with compatibility options enabled.

SELECT * from performance_schema.global_status where VARIABLE_NAME='QUERIES' OR VARIABLE_NAME='THREADS_CONNECTED' OR VARIABLE_NAME='THREADS_RUNNING' OR VARIABLE_NAME='SLOW_QUERIES';

Created on Jul 26, 2018 5:44:11 PM

Last change on Jul 27, 2018 7:11:44 AM by  Luciano Lingnau [Paessler]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.