3.3 Installing Grafana on the Prometheus (Monitoring) Server

There are several ways to install Grafana, including as a Docker container. However, we will use the rpm-based setup because it is less complicated.

  1. Download the Grafana RPM from the Grafana download site.

    wget https://dl.grafana.com/oss/release/grafana-9.4.7-1.x86_64.rpm

  2. Install Grafana.

    rpm -i --nodeps grafana-9.4.7-1.x86_64.rpm

  3. Modify the Grafana configuration file located at /etc/grafana/grafana.ini to set the default port.

    ########### Server ##########;
    [server]
    # Protocol (http, https, h2, socket)
    protocol=http
    
    # The ip address to bind to, empty will bind to all interfaces
    ;http_addr =
    
    # The http port to use
    http_port = 4000

    The edirapi docker image uses port 3000 by default, but if you install Grafana on an OES 2023 Server with UMC installed, it will instead utilize port 3000. In this instance, we switch the port to 4000 and this port must be added in the firewall allowed services.

  4. Start the Grafana Service.

    systemctl start grafana-server.service

3.3.1 Configuring the Grafana dashboard

Prerequisites:

Before configuring the Grafana dashboard for Node Exporter and cAdvsior ensure to integrate the Metric Endpoints. See,Section 4.0, How to Integrate Metric Endpoints (targets).

  1. Login to http://<server_ip_of grafana>:4000 with default user credentials (admin/admin).

  2. Add the Prometheus data source to Grafana:

    1. Navigate to Configuration > Datasource > Add datasource in the Grafana sidebar.

    2. Select Prometheus as the type.

    3. Set the appropriate Prometheus server URL (for example, http://localhost:9090/).

    4. Adjust other data source settings as required (for example, choosing the right access method).

    5. Click Save & Test to save the new data source.

      NOTE:In case of failure, ensure the service is up and running and that the correct port number has been added to the firewall.

  3. Go to the Grafana Community where you can find numerous ready-made dashboards that can be imported and utilized in your environment.

    NOTE:Grafana dashboard provides different templates for cAdvisor and Node Exporter.

  4. Select the required ready-made dashboards from and copy the ID of the dashboard.

  5. Import the dashboard using the available template in Grafana labs.

    1. Navigate to Home > Dashboard > +import in the Grafana sidebar.

    2. In Import via grafana.com field, enter the copied ID of the ready-made dashboard, and click Load.

      Figure 3-1 Grafana Dashboard

    3. From Host drop-down list, select the server for viewing the respective dashboard results.