Grafana Integration
NetXMS integrates with Grafana through a dedicated data source plugin, allowing you to build Grafana dashboards using NetXMS monitoring data. This integration is useful for teams that standardize on Grafana for visualization across multiple monitoring systems.
Prerequisites
-
NetXMS server with the web API enabled (see below)
-
Grafana 10.4.0 or later
-
Network connectivity between Grafana and the NetXMS web API port
Enabling the Web API
The web API is built into the NetXMS server and is provided by the webapi server module.
To enable it, load the module in netxmsd.conf and restart the server:
Module = webapi
The API listener is configured in the [WEBAPI] section of netxmsd.conf.
By default it serves plain HTTP on port 8000 and accepts connections on the loopback interface only.
When Grafana runs on a different host, set Address to any, *, or an explicit IP address so the listener accepts remote connections:
[WEBAPI] Address = any Port = 8000
An optional TLS listener can be enabled (port 8443 by default); it is terminated by an external reproxy process, which is bundled with the server on Windows but must be installed separately on Linux.
The recommended setup is to place a TLS-offloading reverse proxy (nginx, Caddy, Traefik, etc.) in front of the HTTP port.
Installing the Data Source Plugin
Plugin releases are published on the GitHub releases page as a zip archive. Unzip the archive into the Grafana plugins directory and restart Grafana:
cd /var/lib/grafana/plugins
unzip radensolutions-netxms-datasource-<version>.zip
systemctl restart grafana-server
If using an unsigned plugin build, add it to the allow_loading_unsigned_plugins setting in grafana.ini:
[plugins]
allow_loading_unsigned_plugins = radensolutions-netxms-datasource
Configuring the Data Source
-
In NetXMS, issue an authentication token for the account Grafana will use: navigate to Configuration > Users and groups, right-click the user, and select Issue authentication token…
-
Open Grafana and navigate to Connections > Data sources
-
Click Add new data source and select "NetXMS"
-
Configure the connection:
| Setting | Description |
|---|---|
API address |
Base URL of the NetXMS web API (e.g., |
API Key |
Authentication token issued in NetXMS |
-
Click Save & Test to verify the connection
This is a backend plugin: all requests to the NetXMS web API are made by the Grafana server process, and the API key is stored encrypted in Grafana.
| Create a dedicated NetXMS user account for Grafana with read-only access to the required objects. The token carries the permissions of the user it was issued for. |
Building Dashboards
Query Editor
The first field in the query editor is Query Type:
| Query type | Description |
|---|---|
Alarms |
Active alarms, optionally limited to a subtree of the object tree |
Summary Tables |
Data from a DCI summary table configured on the server |
Object Queries |
Results of an object query configured on the server |
DCI value |
Historical values of a single DCI |
Object Status |
Status of objects under the selected root object |
Depending on the query type, additional fields appear. All of them are dropdowns populated from the NetXMS server:
| Field | Description |
|---|---|
Root object |
Object that scopes the query. Optional for Alarms and Object Queries, required for the other query types |
DCI |
The DCI to retrieve values from (DCI value only; the list is filtered by the selected root object) |
Summary table |
The DCI summary table to query (Summary Tables only) |
Object query |
The object query to execute (Object Queries only) |
Query parameters |
Optional input fields for the object query, entered in a plain text area as a JSON array of key-value pairs (Object Queries only). The plugin currently sends them in a form the server ignores, so they have no effect (grafana-datasource#4) |
Example Dashboard
A typical NetXMS Grafana dashboard might include:
-
CPU and memory graphs for a group of servers
-
Network interface utilization charts
-
Active alarm table
-
Node status overview using stat panels
-
Disk usage bar gauges
Example panel query configuration:
Query Type: DCI value Root object: server01 DCI: CPU: usage (average last minute)
Permissions and Access Control
The Grafana data source inherits the permissions of the NetXMS user account the API key was issued for. To restrict what data is visible in Grafana:
-
Create a dedicated NetXMS user for Grafana
-
Assign read-only access to specific object containers
-
Use NetXMS access control to limit visibility
Troubleshooting
Connection Failed
-
Verify the web API is enabled:
Module = webapimust be present innetxmsd.conf, and the server log should contain a "Web API initialized" message on startup -
If Grafana runs on a different host, make sure
Addressis set in the[WEBAPI]section — by default the API listens on the loopback interface only -
Check firewall rules between Grafana and the NetXMS server API port (default 8000)
-
Verify the API address includes the correct protocol and port
-
Verify the API key is valid and not expired
Alternative: Infinity Plugin with REST API
If the dedicated NetXMS data source plugin is not available or does not meet your requirements, you can use the Grafana Infinity plugin with the NetXMS REST API directly.
Prerequisites
-
Ensure the web API is enabled on the NetXMS server: the
webapimodule must be loaded (Module = webapiinnetxmsd.conf). The API listener is enabled by default on port 8000. To change the port or disable the listener, edit the[WEBAPI]section innetxmsd.conf:Module = webapi [WEBAPI] Enable = true Port = 8000
-
Install the Infinity plugin in Grafana:
grafana-cli plugins install yesoreyeram-infinity-datasource systemctl restart grafana-server
Configuring the Infinity Data Source
-
Create a new data source of type Infinity
-
Set authentication to Bearer Token
-
Generate a token in NetXMS: open the management console, navigate to Configuration > Users and groups, right-click your API user, and select Issue authentication token…
-
Paste the token into the Infinity data source configuration
-
Add the NetXMS API address to Allowed Hosts
-
Set the health check URL to
/v1/status
Available API Endpoints
The following REST API endpoints are available for use with the Infinity plugin:
| Method | Endpoint | Description |
|---|---|---|
POST |
|
Active alarms. A JSON body is required; the |
POST |
|
Object query results. Body: |
POST |
|
Summary table data. Body: |
GET |
|
DCI history values. Query params: |
GET |
|
DCIs configured on an object |
POST |
|
Status of objects under a root object |
GET |
|
Objects usable as query roots; |
GET |
|
Configured DCI summary tables |
GET |
|
Configured object queries |
DCI History Panels
To create time-series panels using DCI history:
-
Add a new panel in Grafana
-
Select the Infinity data source
-
Configure:
Setting Value Type
JSON
Parser
Backend
Source
URL
Format
Data Frame
Method
GET
URL
http://<server>:8000/v1/objects/<objectId>/data-collection/<dciId>/history -
Add URL query parameters to pass the Grafana time range:
Parameter Value timeFrom$__from/1000timeTo$__to/1000 -
Set the root selector to
values -
Configure columns:
-
timestamp— type Time (ISO format) -
value— type Number
-
Grafana time range variables ($from, $to) return milliseconds. The NetXMS API expects seconds, so divide by 1000.
|
The values/timestamp+value column mapping applies to raw-tier responses.
With aggregation enabled and long time ranges (or when maxDataPoints is set), the response contains avg, min, max, and sampleCount columns plus aggregated: true and tierServed fields instead of value — map the aggregate columns accordingly.
|
Alternatively, you can embed the time parameters directly in the URL using the :date:seconds format:
http://<server>:8000/v1/objects/<objectId>/data-collection/<dciId>/history?timeFrom=${__from:date:seconds}&timeTo=${__to:date:seconds}
Example: CPU Usage Graph
Create a time-series panel showing CPU usage from a specific node:
| Setting | Value |
|---|---|
Format |
Data Frame |
Method |
GET |
URL |
|
URL Query: |
|
URL Query: |
|
Root |
|
Configure columns: timestamp as Time (ISO format), value as Number.
To show multiple metrics (e.g., user CPU, system CPU, I/O wait), add additional queries in the same panel with different DCI IDs.
Example: Log Monitoring Table
Display log monitoring data (e.g., authentication errors captured by the LogWatch subagent) as a table:
| Setting | Value |
|---|---|
Format |
Data Frame |
Method |
GET |
URL |
|
URL Query: |
|
URL Query: |
|
Root |
|
This works with any DCI type including push DCIs populated by log monitoring policies.
Object Query Panels
To display object query results as a table:
-
Add a table panel with the Infinity data source
-
Set method to POST
-
Set the URL to
http://<server>:8000/v1/grafana/infinity/object-query -
Set the body:
{ "rootObjectId": 2, "queryId": 1, "inputFields": { "fieldName": "value" } }
| Grafana sorts table columns alphabetically by default. Use Grafana’s Organize fields transformation to arrange columns in the desired order. |
Example: Agent Information Query
The following NXSL object query script displays agent information for all nodes with an agent. Create this query in NetXMS under Configuration > Object Queries, then reference it by ID in Grafana.
with
nodeName (name = "Node name", order = "asc") = {
$node.name
},
agentVersion (name = "Agent Version") = {
$node.agentVersion
},
agentUnreachable (name = "Agent unreachable") = {
$node.state == NodeState::AgentUnreachable
},
lastCommTime (name = "Last connection time") = {
DateTime($node.lastAgentCommTime).format("%Y-%m-%d %H:%M")
},
tunnelConnected (name = "Tunnel connection") = {
$node.tunnel != null
},
hasUserAgent (name = "Has user agent") = {
$node.hasUserAgent
},
platformName (name = "Platform name") = {
$node.platformName
}
(type == NODE) and $node.isAgent
Configure the Infinity panel as POST to /v1/grafana/infinity/object-query with body {"queryId": 2}.
Summary Table Panels
To display a summary table in Grafana:
-
Add a table panel with the Infinity data source
-
Set method to POST
-
Set the URL to
http://<server>:8000/v1/grafana/infinity/summary-table -
Set the body with both
rootObjectIdandtableId(both required):{ "rootObjectId": 2, "tableId": 5 }
The API returns the same data as the NetXMS summary table view. Use Grafana’s Organize fields transformation to arrange columns in the desired order.
Next Steps
-
REST API — API details used by the Grafana plugin
-
Data Collection Concepts — understanding DCIs and data origins
-
Dashboards — native NetXMS dashboard capabilities