Cacti / plugin_slowlog

GNU General Public License v2.0
3 stars 0 forks source link

Warnings issue when attempting to import a Slowlog from the CLI #2

Open bonj1987 opened 1 year ago

bonj1987 commented 1 year ago

i used this with the --logfile= and pointed it to where my cacti's mysql slowlog file was and i got this error PHP Notice: Undefined offset: 3 in C:\inetpub\wwwroot\cacti\plugins\slowlog\slowlog_functions.php on line 139

TheWitness commented 1 year ago

What version of MySQL/MariaDB? Can you upload a 100 or so lines of the file?

TheWitness commented 1 year ago

I've worked around it, but if you can still upload head -100 slowlog that would be good.

bonj1987 commented 1 year ago

i uninstalled and redownloaded it and reinstalled it.. i ran the command to import the slow log. php -q import_log.php --logfile=C:\ProgramData\MySQL\MySQL Server 5.7\Data\server-slow.log i got this error.. **PHP Notice: Undefined variable: file in C:\inetpub\wwwroot\cacti\plugins\slowlog\slowlog_functions.php on line 302 FATAL: Can not find file '' on that line $file\n is listed but $file isn't anywhere else in the script print "FATAL: Can not find file '$file'\n";**

bonj1987 commented 1 year ago

ignore my last comment.. i forgot to surround my path with "" i ran the command it imported.

other than making it a scheduled task, will we be able to configure that from within cacti itself?

TheWitness commented 1 year ago

Another good catch. Making a light update. I did not use this script previously from the command line, always imported it from the GUI. Good to get this flushed out now.

TheWitness commented 1 year ago

You may want to provide the full path to the logfile.

bonj1987 commented 1 year ago

where do you import it in the gui? i didnt see such a control in the gui, which is why i did it from command line.

bonj1987 commented 1 year ago

nevermind.. im friggin blind today LOL..

TheWitness commented 1 year ago

There is a plus sign on the table view.

image

TheWitness commented 1 year ago

Watch those two variables. Some of my slowlog's get to be ~1GB is size. Have to increase those two variables and restart httpd/php-fpm.