Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bonj1987 opened this issue Feb 9, 2023 · 10 comments
Open

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

bonj1987 opened this issue Feb 9, 2023 · 10 comments
Labels
bug Something isn't working resolved A resolved issue

Comments

@bonj1987
Copy link

bonj1987 commented Feb 9, 2023

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 TheWitness changed the title undefined offset Warnings issue when attempting to import a Slowlog from the CLI Feb 25, 2023
@TheWitness
Copy link
Member

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

TheWitness added a commit that referenced this issue Feb 25, 2023
* Warnings issue when attempting to import a Slowlog from the CLI
* Clean up CHANGELOG.md
@TheWitness
Copy link
Member

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

@TheWitness TheWitness added bug Something isn't working resolved A resolved issue labels Feb 25, 2023
@bonj1987
Copy link
Author

bonj1987 commented Mar 1, 2023

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
Copy link
Author

bonj1987 commented Mar 1, 2023

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
Copy link
Member

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 added a commit that referenced this issue Mar 2, 2023
Another issue with the logfile processing
@TheWitness
Copy link
Member

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

@bonj1987
Copy link
Author

bonj1987 commented Mar 2, 2023

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
Copy link
Author

bonj1987 commented Mar 2, 2023

nevermind.. im friggin blind today LOL..

@TheWitness
Copy link
Member

There is a plus sign on the table view.

image

@TheWitness
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved A resolved issue
Projects
None yet
Development

No branches or pull requests

2 participants