Expose RouterOS QoS graphs through API

Hi,

I would like to request support for retrieving RouterOS Simple Queue QoS graphs through the LibreNMS API.

Currently the graph works correctly through graph.php when using qos_id:

https://librenms.example.org/graph.php?device=1&type=device_qos_routeros_simple_traffic&qos_id=16101&from=-24h&to=now&width=1200&height=400

But the equivalent API graph endpoint does not work:

curl -H “X-Auth-Token: ”
https://librenms.example.org/api/v0/devices/1/device_qos_routeros_simple_traffic?qos_id=16101&from=-24h&to=now&width=1200&height=400”

It returns:

{
“status”: “error”,
“message”: “No Data filerouteros-simplequeue-.rrd”
}

The graph file expects qos_id in $vars:

includes/html/graphs/device/qos_routeros_simple_traffic.inc.php

$qos = \App\Models\Qos::find($vars[‘qos_id’]);
$rrd_filename = Rrd::name($device[‘hostname’], [‘routeros-simplequeue’, $qos->rrd_id]);

So it looks like the API graph endpoint does not pass qos_id into the graph renderer, while graph.php does.

It would be useful if RouterOS QoS graphs could be retrieved via the API, for example:

/api/v0/devices/1/device_qos_routeros_simple_traffic?qos_id=16101&from=-24h&to=now&width=1200&height=400

Also, these graphs are currently not listed in:

/api/v0/devices/1/graphs

Use case:
We want to embed LibreNMS RouterOS Simple Queue graphs into an external internal system using API authentication, without relying on graph.php and LibreNMS web session cookies.

Environment:

  • LibreNMS with MikroTik RouterOS device
  • QoS type: routeros_simple
  • Working graph.php type: device_qos_routeros_simple_traffic
  • Related graph files:
    • includes/html/graphs/device/qos_routeros_simple_traffic.inc.php
    • includes/html/graphs/device/qos_routeros_simple_drop.inc.php

Is there a supported way to retrieve these QoS graphs through the API, or would this need a change in the API graph endpoint to pass qos_id to $vars?