Port Graph
port_graphGenerate a per-port graph image from LibreNMS for interface traffic, packets, errors, or etherlike data. When the standard endpoint fails, automatically uses a fallback rendering path so the requested graph is returned.
Instructions
Render a per-port graph as an image, for example interface traffic.
Some LibreNMS releases fail to render through the per-port endpoint and answer 500 with an empty graph type in the message. For 'bits' this tool then falls back to the port-group endpoint, which renders the same traffic data, so callers still get a graph without needing a port ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Graph width in pixels. | |
| height | No | Graph height in pixels. | |
| ifname | Yes | Interface name as reported by LibreNMS, e.g. 'Po1' or 'Te2/7' | |
| legend | No | Whether to render the graph legend. | |
| to_time | No | End of the time range, either a relative offset or a Unix timestamp. Defaults to now. | |
| hostname | Yes | Device hostname or device ID | |
| from_time | No | Start of the time range, either a relative offset such as '-1d', '-6h' or '-1w', or a Unix timestamp. Defaults to the LibreNMS default (-1d). | |
| graph_type | No | Graph type: 'bits' (traffic), 'upkts' (unicast packets), 'errors', or 'etherlike' | bits |