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

Generating .html reports #448

Closed
Steve8291 opened this issue Jul 18, 2019 · 8 comments
Closed

Generating .html reports #448

Steve8291 opened this issue Jul 18, 2019 · 8 comments

Comments

@Steve8291
Copy link
Contributor

Any chance you could give an example of how to generate an .html report from the command line? Looks like this should be possible but I just can't figure out how to make it work.
Thanks.

@jmrenouard
Copy link
Collaborator

Hi @Steve8291

Yes it's possible to do that :)

Let me document it in README page.

@Steve8291
Copy link
Contributor Author

Steve8291 commented Oct 2, 2019

@jmrenouard I didn't see anything in the new README. Did you decide not to do this? I've been trying with the following command but it doesn't seem to output useful .html
perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/mysqltuner_dir/template_example.tpl

@jmrenouard jmrenouard reopened this Oct 2, 2019
@jmrenouard
Copy link
Collaborator

I will document this part before closing it :) You are right

@jmrenouard jmrenouard reopened this Oct 2, 2019
@jmrenouard
Copy link
Collaborator

jmrenouard commented Oct 3, 2019

Usage is documented in USAGE section.

No documentation regarding template development.

@jmrenouard
Copy link
Collaborator

A basic example based on python j2

perl mysqltuner.pl --verbose --json | j2 -f json MySQLTuner-perl/templates/basic.html.j2 > variables.html

@jmrenouard
Copy link
Collaborator

Update documentation needed

jmrenouard added a commit that referenced this issue Mar 11, 2022
jmrenouard added a commit that referenced this issue Mar 11, 2022
@Steve8291
Copy link
Contributor Author

Thanks @jmrenouard
I have actually been using the aha package to output .html
It works very nicely and gives me colored output.
Here is what I run:

mysqltuner.pl --color > "$mysqltuner_output"
aha --black --title "MySQLTuner" -f "$mysqltuner_output" > "$html_file"

The aha --black option outputs black background with white text. Colors from mysqltuner.pl are retained.
Might be worth mentioning aha in the docs because it's also a really simple solution.
Here is a one liner:
perl mysqltuner.pl --color | aha --black --title "MySQLTuner" > mysqltuner.htm

jmrenouard added a commit that referenced this issue Mar 11, 2022
jmrenouard added a commit that referenced this issue Mar 11, 2022
@jmrenouard
Copy link
Collaborator

Thanks @Steve8291

README updated with aha information

Works fine for me

Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants