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.

Revisions

  1. CrazyWolf13 revised this gist Dec 8, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions bookstack-monitoring.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ First we need to modify the mysql on bookstack a bit:

    ```bash
    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`
  2. CrazyWolf13 revised this gist Aug 7, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions bookstack-monitoring.md
    Original file line number Diff line number Diff line change
    @@ -41,4 +41,6 @@ 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.
  3. CrazyWolf13 created this gist Aug 7, 2024.
    44 changes: 44 additions & 0 deletions bookstack-monitoring.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    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:

    ```bash
    nano /etc/mysql/mysql.conf.d/mysqld.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.

    ```bash
    mysql -u root -p
    ```
    Make sure to replace the IP and Password below
    ```sql
    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:
    ```yaml
    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.
    If you have any questions feel free to ask below.