Grafana datasource plugin for PRTG

# Steps for Multiple Grafana Organizations using the maxmarkusprogram-prtg-datasource.
# Using the same plugin in multiple Grafana organizations will lead to errors, hence the need to duplicate the plugin.
# If you need to use the plugin in more than one Grafana organization, you can follow these steps to set up a duplicate PRTG plugin under the same Grafana instance. 

# Step 1
cd /tmp # Change to temporary directory
git clone https://github.com/1DeliDolu/PRTG.git # Clone the PRTG plugin repository
sudo mv /tmp/PRTG/maxmarkusprogram-prtg-datasource /var/lib/grafana/plugins/PRTG-ORG2 # Move the plugin to Grafana's plugin directory
sudo chown -R grafana:grafana /var/lib/grafana/plugins/PRTG-ORG2 # Set ownership to Grafana user and group

# Step 2: Build the plugin (frontend)
cd /var/lib/grafana/plugins/PRTG-ORG2 # Change to the plugin directory
npm install # Install Node.js dependencies
npm run build # Build the frontend assets for the plugin

# Step 3: Build the Go backend binary
mkdir -p dist # Create a directory for the binary
go build -o dist/gpx_prtg_linux_amd64 ./pkg # Compile the Go backend binary
chmod +x dist/gpx_prtg_linux_amd64 # Make the binary executable

# Step 4: Update Plugin Metadata. Edit the plugin.json file to give the plugin a unique name and ID. Important: The id must be unique across all plugins in Grafana.
sudo nano /var/lib/grafana/plugins/PRTG-ORG2/plugin.json # Open the plugin.json file in nano editor
Update
{
  "name": "PRTG", # Change the name to something unique for the new plugin
  "id": "maxmarkusprogram-prtg-datasource", # Change the ID to a unique identifier for the new plugin
  ...
}

# Step 5: Update grafana.ini to include new Grafana Organization PRTG plugin (Verify this is update in nano /etc/grafana/grafana.ini)
[plugins]
allow_loading_unsigned_plugins = maxmarkusprogram-prtg-datasource,<new Plugin name> # Allow loading of unsigned plugin by ID

# Step 6: Restart Grafana-Server
sudo systemctl restart grafana-server

# Step 7: Add the new datasource in the Grafana UI. Search using the specified id/name from Step 4
Home>Connections>Data sources>Add data source
1 Like