Is it possible to get discards data in bulk from the Ports API?

LibreNMS version: 26.3.1

Hi! The /api/v0/ports endpoint already lets you pull error counters in bulk (ifInErrors_rate, ifOutErrors_rate), which is great. Could discards (ifInDiscards_rate, ifOutDiscards_rate) be added the same way?

Right now, asking for those columns returns:

400 Invalid columns: ifInDiscards_rate

It would be really useful to get discards in the same request as the rest of the port data, same as errors work today. Thanks!

That is not in the ports column, try adding ?with=statistics to your query

Thanks for the quick reply!

I tried ?with=statistics and it isn’t working:

GET /api/v0/ports/203?with=statistics

{
    "status": "ok",
    "port": [
        {
            "port_id": 203,
            "device_id": 3,
            "port_descr_type": "xx",
            "port_descr_descr": "et-0\/0\/0",
            "port_descr_circuit": null,
            "port_descr_speed": null,
            "port_descr_notes": null,
            "ifDescr": "et-0\/0\/0",
            "ifName": "et-0\/0\/0",
            "portName": null,
            "ifIndex": 516,
            "ifSpeed": 100000000000,
            "ifSpeed_prev": 100000000000,
            "ifConnectorPresent": "true",
            "ifOperStatus": "up",
            "ifOperStatus_prev": "up",
            "ifAdminStatus": "up",
            "ifAdminStatus_prev": "up",
            "ifDuplex": null,
            "ifMtu": 9192,
            "ifType": "ethernetCsmacd",
            "ifAlias": "xx",
            "ifPhysAddress": "487310ab840c",
            "ifLastChange": 4051040138,
            "ifVlan": null,
            "ifTrunk": null,
            "ifVrf": 0,
            "ignore": 0,
            "disabled": 0,
            "deleted": 0,
            "pagpOperationMode": null,
            "pagpPortState": null,
            "pagpPartnerDeviceId": null,
            "pagpPartnerLearnMethod": null,
            "pagpPartnerIfIndex": null,
            "pagpPartnerGroupIfIndex": null,
            "pagpPartnerDeviceName": null,
            "pagpEthcOperationMode": null,
            "pagpDeviceId": null,
            "pagpGroupIfIndex": null,
            "ifInUcastPkts": 120254327599165,
            "ifInUcastPkts_prev": 120253442211970,
            "ifInUcastPkts_delta": 885387195,
            "ifInUcastPkts_rate": 2412499,
            "ifOutUcastPkts": 205232291527382,
            "ifOutUcastPkts_prev": 205230842137538,
            "ifOutUcastPkts_delta": 1449389844,
            "ifOutUcastPkts_rate": 3949291,
            "ifInErrors": 0,
            "ifInErrors_prev": 0,
            "ifInErrors_delta": 0,
            "ifInErrors_rate": 0,
            "ifOutErrors": 0,
            "ifOutErrors_prev": 0,
            "ifOutErrors_delta": 0,
            "ifOutErrors_rate": 0,
            "ifInOctets": 55639735534198338,
            "ifInOctets_prev": 55639282390511098,
            "ifInOctets_delta": 453143687240,
            "ifInOctets_rate": 1234723943,
            "ifOutOctets": 240641153170221379,
            "ifOutOctets_prev": 240639506313201583,
            "ifOutOctets_delta": 1646857019796,
            "ifOutOctets_rate": 4487348828,
            "poll_time": 1783346942,
            "poll_prev": 1783346575,
            "poll_period": 367
        }
    ]
}

Works for me, your install is probably not up to date.

Thank you. I noticed that it was included in the latest release. We are a few releases behind.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.