Start stop and restart the IBM Storage Scale Bridge for Grafana using systemd - IBM/ibm-spectrum-scale-bridge-for-grafana GitHub Wiki

You can use the grafana-bridge.service file to give systemd control over starting and stopping the IBM Storage Scale Bridge for Grafana.

Copy grafana-bridge.service file to /etc/systemd/system/:

# cp <my-grafana-bridge-source-location>/grafana-bridge.service /etc/systemd/system/grafana-bridge.service

Open copied file in the edit mode and check that the WorkingDirectory path points to the grafana-bridge main folder location.

# vi /etc/systemd/system/grafana-bridge.service
[Unit]
Description=IBM Storage Scale bridge for Grafana
After=multi-user.target

[Service]
Type=simple
Restart=on-failure
WorkingDirectory=/opt/IBM/bridge
ExecStart=/usr/bin/python3 -u source/zimonGrafanaIntf.py

StandardOutput=journal+console
StandardError=journal+console
SyslogIdentifier=grafana-bridge

[Install]
WantedBy=multi-user.target

Enable and start the grafana-bridge systemd service:


# sudo systemctl daemon-reload
# sudo systemctl enable grafana-bridge.service
# sudo systemctl start grafana-bridge.service

To ensure that the IBM Storage Scale Bridge for Grafana is running, run the command:


# systemctl status grafana-bridge
● grafana-bridge.service - IBM Storage Scale bridge for Grafana
     Loaded: loaded (/etc/systemd/system/grafana-bridge.service; enabled; preset: disabled)
     Active: active (running) since Thu 2024-05-02 21:35:05 CEST; 4s ago
   Main PID: 2594419 (python3)
      Tasks: 26 (limit: 74702)
     Memory: 60.2M
        CPU: 609ms
     CGroup: /system.slice/grafana-bridge.service
             └─2594419 /usr/bin/python3 -u source/zimonGrafanaIntf.py

May 02 21:35:05 scale-11 systemd[1]: Started IBM Storage Scale bridge for Grafana.
May 02 21:35:05 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     -  *** IBM Storage Scale bridge for>
May 02 21:35:05 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     - Successfully retrieved MetaData
May 02 21:35:05 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     - Received sensors:CPU, DiskFree, G>
May 02 21:35:05 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     - Initial cherryPy server engine st>
May 02 21:35:05 scale-11 grafana-bridge[2594419]: [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)], cherryPy version: 18.9.0.
May 02 21:35:06 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     - Registered applications:
May 02 21:35:06 scale-11 grafana-bridge[2594419]:  OpenTSDB Api listening on Grafana queries,
May 02 21:35:06 scale-11 grafana-bridge[2594419]:  Prometheus Exporter Api listening on Prometheus requests
May 02 21:35:06 scale-11 grafana-bridge[2594419]: 2024-05-02 21:35 - MainThread                 - INFO     - server started