Skip to content

Instantly share code, notes, and snippets.

@CrazyWolf13
Last active December 8, 2024 17:51
Show Gist options
  • Save CrazyWolf13/a645d1ddeb35df5a20e0647db149a8a3 to your computer and use it in GitHub Desktop.
Save CrazyWolf13/a645d1ddeb35df5a20e0647db149a8a3 to your computer and use it in GitHub Desktop.
Bookstack Monitoring via Grafana MySQL

Hi

This is a little guide I created on how to create Bookstack monitoring through Grafana and their MySQL Connection.

First we need to modify the mysql on bookstack a bit:

nano /etc/mysql/mysql.conf.d/mysqld.cnf
# Or when using MariaDB:
nano /etc/mysql/mariadb.conf.d/50-server.cnf

Replace the following line: bind-address = 127.0.0.1 with: bind-address = 0.0.0.0

Use Password located in /var/www/bookstack/.env Now we need to enter the database and create a new user, allow remote access from grafana's IP and set a password, this password will later on be used in grafana, so make sure to remember it.

mysql -u root -p 

Make sure to replace the IP and Password below

CREATE USER 'grafanaMonitoring'@'<IP_OF_Grafana>' IDENTIFIED BY '<SET_A_Password>';
GRANT ALL PRIVILEGES ON bookstack.* TO 'grafanaMonitoring'@'<IP_OF_Grafana>';
FLUSH PRIVILEGES;
EXIT;

Possibly create a firewall Rule to allow traffic to port 3306

Now finally head over to Grafana and create a new mysql Connection:

Host URL: <IP_OF_Bookstack>:3306
Username: grafanaMonitoring
Password: <The-Password-Set-In-MySQL>
Check: Skip-TLS Verification

Click Save & Test If a it Shows up green, then your all set and can import the dashboard.

Then import the following Dashboard, and select the freshly created mysql DB Connection.

https://grafana.com/grafana/dashboards/21649-bookstack/

If you have any questions feel free to ask below.

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