MySQL Slow Query Log Analysis Plugin

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

MySQL Slow Query Log Analysis Plugin

Post by TheWitness »

All,

Pleased to announce a new Science Project plugin for those who make analyzing MySQL a part of their daily lives. It's not the end all, do all, but it sure helped me out.

You may obtain the plugin here:

http://docs.cacti.net/plugin:slowlog

I have attached some 'fancy' graphs and images below with actual data.

TheWitness
Attachments
SlowLogQueryDetails.png
SlowLogQueryDetails.png (60.92 KiB) Viewed 12544 times
SlowLogDetails.png
SlowLogDetails.png (100.04 KiB) Viewed 12544 times
SlowLogImport.png
SlowLogImport.png (102.69 KiB) Viewed 12544 times
SlowLogSummary.png
SlowLogSummary.png (55.84 KiB) Viewed 12544 times
SlowLogByTable.png
SlowLogByTable.png (196.8 KiB) Viewed 12544 times
SlowLogByMethod.png
SlowLogByMethod.png (182.46 KiB) Viewed 12544 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mrevelle
Posts: 2
Joined: Tue Mar 15, 2011 2:38 pm

Re: MySQL Slow Query Log Analysis Plugin

Post by mrevelle »

Thanks for this, though it doesn't work. Maybe I missed something but the plugin installs alright but it seems like the chdir statement in slowlog.php is screwing things up, the plugin keeps checking for stuff within */cacti/plugins as well as */cacti and apache is reporting the following errors because of it:



[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/include, referer: http://zeta.officemax.int/cacti/plugins ... slowlog.ph[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/plugins, referer: http://zeta.officemax.int/cacti/plugins ... slowlog.ph
[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/include, referer: http://zeta.officemax.int/cacti/plugins ... slowlog.ph[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/plugins, referer: http://zeta.officemax.int/cacti/plugins ... slowlog.ph
[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/tab_graphs.gif, referer: http://zeta.officemax.int/cacti/plugins/slow[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/transparent_line.gif, referer: http://zeta.officemax.int/cacti/plugin
[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/shadow_gray.gif, referer: http://zeta.officemax.int/cacti/plugins/slo[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/cacti_backdrop2.gif, referer: http://zeta.officemax.int/cacti/plugins
[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/tab_console.gif, referer: http://zeta.officemax.int/cacti/plugins/slo[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/shadow.gif, referer: http://zeta.officemax.int/cacti/plugins/slowlog/
[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/arrow.gif, referer: http://zeta.officemax.int/cacti/plugins/slowlog/s[Fri Sep 30 13:50:34 2011] [error] [client 172.31.0.78] File does not exist: /var/www/cacti/plugins/slowlog/images/favicon.ico


EDIT: Got it, incorrect $url_path - one question though, how did you set up the pretty graph/pictures?
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: MySQL Slow Query Log Analysis Plugin

Post by TheWitness »

Once you import a mysql-slow.log file, you simply have to edit it and select the various tabs.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mrevelle
Posts: 2
Joined: Tue Mar 15, 2011 2:38 pm

Re: MySQL Slow Query Log Analysis Plugin

Post by mrevelle »

Yeah that's what I thought based on your screen shots. It's showing the actual log data but I get no graphs from any of the tabs. Logs show nothing relevant to resolving the issue as far as I can see. Any suggestions?

Haha nevermind, I'm a retard. I did a dist-upgrade to Ubuntu's beta and it has no flash-plugin yet. We're all good thanks a lot.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: MySQL Slow Query Log Analysis Plugin

Post by TheWitness »

Your welcome... Any bugs, let us know.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
maddog107
Posts: 1
Joined: Tue Mar 19, 2013 3:54 pm

Re: MySQL Slow Query Log Analysis Plugin

Post by maddog107 »

Thanks for this plugin. One question, is there a way to automatically pull in the slowquery log say every hour? We can do it via a cronjob or something. Let me know as that is what we are looking for. Thanks.
Eol
Posts: 44
Joined: Mon Apr 13, 2015 5:53 pm

Re: MySQL Slow Query Log Analysis Plugin

Post by Eol »

FYI on 0.8.8c this plugin lose all the overall web structure, i.e. you lose all the "tab" and the ability to navigate in the Cacti UI.
Attachments
Missing top navigation tab and other Cacti UI elements.
Missing top navigation tab and other Cacti UI elements.
mysql.png (53.44 KiB) Viewed 7027 times
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: MySQL Slow Query Log Analysis Plugin

Post by TheWitness »

New Slowlog after over 10 years dead!
Attachments
SlowLog2023.png
SlowLog2023.png (251.21 KiB) Viewed 1599 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: MySQL Slow Query Log Analysis Plugin

Post by TheWitness »

Way faster, and nicer to look at.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mrossTTX
Cacti User
Posts: 114
Joined: Wed Dec 07, 2022 12:49 pm

Re: MySQL Slow Query Log Analysis Plugin

Post by mrossTTX »

looks awesome
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests