* Add transceivers module Move os specific code to OS Fix errors and updated connector names Add RouterOS, a lot less data there. Add Comware Add Exa, required a transformer function (mw to dBm) Add Junos, revision was too short Just starting on ui Graphs, and more ui some polling fixes collapse header for small screens refactor a bit Missed graphs Transceivers icon inline Use @once on popup javascript update db_schema.yaml Don't show transceivers in basic view basic view could use a review Apply fixes from StyleCI API functions Comware don't fail if port is missing Apply fixes from StyleCI Add alert rules to collection Device Overview Attempt to fix bad alert rule, probably needs more Fix up Comware and remove old sensors Mark transceiver metrics without thresholds as Unknown Routeros cleanup Exa cleanup Handle missing port Graph allow filter by channel More translations Add transceiver graphs to port graphs Add Cisco support, use entPhyscial module data if available Fix OcNos divisors Labels on transceiver page Show encoding if available Hacky OcNos port mapping Fix up Junos optics and remove old sensors FS switch support Metric casts to prevent thrashing Extra transform_function support Add link to transceivers page from overview Change default sort to group by type, then channel move some code out of overview blade template Fix bad type ocnos Apply fixes from StyleCI Add scales to graphs Add some test data Default sort order for metrcis in SQL applied by default Transceiver metrics threshold manual settings via WebUI and API Fixes to channels verbiage Fix severity calculations Add cable field for SM/MM/Copper Apply fixes from StyleCI update test data Show DDM Update DB schema file Extend serial field to 32, even though devices shouldn't be able to have one longer than 16 Missing import Add status field to database, that way we can support snmp implementations that only return an enum Add missing files Fix db_schema Fix style Fixes Style fix Work around phpstan issue Update transceivers.blade.php Missed getStatus() call Prevent extra dots when channels are not changed Update module to match upstream Save ocnos metrics as sensors Move to regular sensors add entity physical index Update UI to sensors WIP Apply fixes from StyleCI Forgot one change Update ui to use sensors Remove transceiver metrics Remove metric os discover code fs-switch pending Remove transceiver metrics for fs-centec Exa link up Revert all test data Fix up transceiver module interface Remove unused Convert class comware cache and transceiver type Fix some transceiver metrics filtering and formatting issues Consolidate display formatting Coalesce commare hh3cTransceiverTable walks to prevent double walk Use group to identify transceiver sensors Fixup routeros Fix up cisco update db_schema Small addition to docs Improve overview layout and add graph popup Update Junos update css files ddm should be nullable Increase the field length for type and model Cisco Improve detection when there is an intermediary container Add transceiver test data Apply fixes from StyleCI Fix incorrect test data Improve display formatting Fix test data Apply fixes from StyleCI Fix up more data Fix up more data Fix incorrect return type in routeros Update ocnos data * Remove some remaining references to transceiver_metrics table
10 KiB
get_all_ports
Get info for all ports on all devices. Strongly recommend that you use
the columns
parameter to avoid pulling too much data.
Route: /api/v0/ports
Input:
- columns: Comma separated list of columns you want returned.
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports?columns=ifName%2Cport_id
Output:
{
"status": "ok",
"message": "",
"ports": [
{
"ifName": "Gi0/0/0",
"port_id": "1"
},
{
"ifName": "Gi0/0/1",
"port_id": "2"
},
...
{
"ifName": "Vlan 3615",
"port_id": "5488"
}
]
}
search_ports
Search for ports matching the query.
Route: /api/v0/ports/search/:search
- search string to search in fields: ifAlias, ifDescr, and ifName
Input:
- columns: Comma separated list of columns you want returned.
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/search/lo
Output:
{
"status": "ok",
"ports": [
{
"device_id": 1,
"port_id": 1,
"ifIndex": 1,
"ifName": "lo"
},
{
"device_id": 2,
"port_id": 3,
"ifIndex": 1,
"ifName": "lo"
},
{
"device_id": 3,
"port_id": 5,
"ifIndex": 1,
"ifName": "lo"
}
]
}
search_ports in specific field(s)
Specific search for ports matching the query.
Route: /api/v0/ports/search/:field/:search
- field: comma separated list of field(s) to search
- search: string to search in fields
Input:
- columns: Comma separated list of columns you want returned.
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/search/ifName/lo
Output:
{
"status": "ok",
"ports": [
{
"device_id": 1,
"port_id": 1,
"ifIndex": 1,
"ifName": "lo"
},
{
"device_id": 2,
"port_id": 3,
"ifIndex": 1,
"ifName": "lo"
},
{
"device_id": 3,
"port_id": 5,
"ifIndex": 1,
"ifName": "lo"
}
]
}
ports_with_associated_mac
Search for ports matching the search mac.
Route: /api/v0/ports/mac/:search?filter=first
- search a mac address in fdb and print the ports ordered by the mac count of the associated port.
Input:
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/mac/00:11:22:33:44:55
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/mac/001122.334455?filter=first
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/mac/001122334455?filter=first
Output:
{
"status": "ok",
"message": "",
"port": [
{
"port_id": "323",
"device_id": "55",
"port_descr_type": null,
"port_descr_descr": null,
"port_descr_circuit": null,
"port_descr_speed": null,
"port_descr_notes": null,
"ifDescr": "GigabitEthernet0/0/0",
"ifName": "Gi0/0/0",
"portName": null,
"ifIndex": "1",
"ifSpeed": "1000000000",
"ifConnectorPresent": "true",
"ifPromiscuousMode": "false",
"ifHighSpeed": "1000",
"ifOperStatus": "up",
"ifOperStatus_prev": null,
"ifAdminStatus": "up",
"ifAdminStatus_prev": null,
"ifDuplex": "fullDuplex",
"ifMtu": "1560",
"ifType": "ethernetCsmacd",
"ifAlias": "ASR Interconnect Trunk",
"ifPhysAddress": "84bf20853e00",
"ifHardType": null,
"ifLastChange": "42407358",
"ifVlan": "",
"ifTrunk": "",
"ifVrf": "0",
"counter_in": null,
"counter_out": null,
"ignore": "0",
"disabled": "0",
"detailed": "0",
"deleted": "0",
"pagpOperationMode": null,
"pagpPortState": null,
"pagpPartnerDeviceId": null,
"pagpPartnerLearnMethod": null,
"pagpPartnerIfIndex": null,
"pagpPartnerGroupIfIndex": null,
"pagpPartnerDeviceName": null,
"pagpEthcOperationMode": null,
"pagpDeviceId": null,
"pagpGroupIfIndex": null,
"ifInUcastPkts": "128518576",
"ifInUcastPkts_prev": "128517284",
"ifInUcastPkts_delta": "1292",
"ifInUcastPkts_rate": "4",
"ifOutUcastPkts": "128510560",
"ifOutUcastPkts_prev": "128509268",
"ifOutUcastPkts_delta": "1292",
"ifOutUcastPkts_rate": "4",
"ifInErrors": "0",
"ifInErrors_prev": "0",
"ifInErrors_delta": "0",
"ifInErrors_rate": "0",
"ifOutErrors": "0",
"ifOutErrors_prev": "0",
"ifOutErrors_delta": "0",
"ifOutErrors_rate": "0",
"ifInOctets": "12827393730",
"ifInOctets_prev": "12827276736",
"ifInOctets_delta": "116994",
"ifInOctets_rate": "387",
"ifOutOctets": "14957481766",
"ifOutOctets_prev": "14957301765",
"ifOutOctets_delta": "180001",
"ifOutOctets_rate": "596",
"poll_time": "1483779150",
"poll_prev": "1483778848",
"poll_period": "302"
}
]
}
get_port_info
Get all info for a particular port.
Route: /api/v0/ports/:portid
- portid must be an integer
Input:
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/323
Output:
{
"status": "ok",
"message": "",
"port": [
{
"port_id": "323",
"device_id": "55",
"port_descr_type": null,
"port_descr_descr": null,
"port_descr_circuit": null,
"port_descr_speed": null,
"port_descr_notes": null,
"ifDescr": "GigabitEthernet0/0/0",
"ifName": "Gi0/0/0",
"portName": null,
"ifIndex": "1",
"ifSpeed": "1000000000",
"ifConnectorPresent": "true",
"ifPromiscuousMode": "false",
"ifHighSpeed": "1000",
"ifOperStatus": "up",
"ifOperStatus_prev": null,
"ifAdminStatus": "up",
"ifAdminStatus_prev": null,
"ifDuplex": "fullDuplex",
"ifMtu": "1560",
"ifType": "ethernetCsmacd",
"ifAlias": "ASR Interconnect Trunk",
"ifPhysAddress": "84bf20853e00",
"ifHardType": null,
"ifLastChange": "42407358",
"ifVlan": "",
"ifTrunk": "",
"ifVrf": "0",
"counter_in": null,
"counter_out": null,
"ignore": "0",
"disabled": "0",
"detailed": "0",
"deleted": "0",
"pagpOperationMode": null,
"pagpPortState": null,
"pagpPartnerDeviceId": null,
"pagpPartnerLearnMethod": null,
"pagpPartnerIfIndex": null,
"pagpPartnerGroupIfIndex": null,
"pagpPartnerDeviceName": null,
"pagpEthcOperationMode": null,
"pagpDeviceId": null,
"pagpGroupIfIndex": null,
"ifInUcastPkts": "128518576",
"ifInUcastPkts_prev": "128517284",
"ifInUcastPkts_delta": "1292",
"ifInUcastPkts_rate": "4",
"ifOutUcastPkts": "128510560",
"ifOutUcastPkts_prev": "128509268",
"ifOutUcastPkts_delta": "1292",
"ifOutUcastPkts_rate": "4",
"ifInErrors": "0",
"ifInErrors_prev": "0",
"ifInErrors_delta": "0",
"ifInErrors_rate": "0",
"ifOutErrors": "0",
"ifOutErrors_prev": "0",
"ifOutErrors_delta": "0",
"ifOutErrors_rate": "0",
"ifInOctets": "12827393730",
"ifInOctets_prev": "12827276736",
"ifInOctets_delta": "116994",
"ifInOctets_rate": "387",
"ifOutOctets": "14957481766",
"ifOutOctets_prev": "14957301765",
"ifOutOctets_delta": "180001",
"ifOutOctets_rate": "596",
"poll_time": "1483779150",
"poll_prev": "1483778848",
"poll_period": "302"
}
]
}
get_port_ip_info
Get all IP info (v4 and v6) for a given port id.
Route: /api/v0/ports/:portid/ip
- portid must be an integer
Input:
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/323/ip
Output:
{
"status": "ok",
"message": "",
"addresses": [
{
"ipv4_address_id": "290",
"ipv4_address": "192.168.99.292",
"ipv4_prefixlen": "30",
"ipv4_network_id": "247",
"port_id": "323",
"context_name": ""
}
]
}
get_port_transceiver
Get transceiver info with metrics
Route: /api/v0/ports/:portid/transceiver
- portid must be an integer
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/50736/transceiver
Output:
{
"status": "ok",
"transceivers": [
{
"id": 13,
"created_at": "2024-06-26T23:46:06.000000Z",
"updated_at": "2024-06-27T00:00:07.000000Z",
"device_id": 3138,
"port_id": 50736,
"index": "51",
"type": "10G_BASE_SR_SFP",
"vendor": "HPE",
"oui": "64 9D 99",
"model": null,
"revision": "1",
"serial": "AAA0000AAA00",
"date": null,
"ddm": true,
"encoding": null,
"cable": "MM",
"distance": 300,
"wavelength": 850,
"connector": "LC",
"channels": 1
}
]
}
get_port_description
Get the description (ifAlias
) for a given port id.
Route: /api/v0/ports/:portid/description
Example:
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/323/description
Output:
{
"status": "ok",
"port_description": "GigabitEthernet14"
}
update_port_description
Change the description (ifAlias
) for a given port id.
Route: /api/v0/ports/:portid/description
Input (JSON):
- description: The string data to use as the new port description. Sending an empty string will reset the description to default.
Example:
curl -X PATCH -d '{"description": "Out-of-Band Management Link"}' -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/323/description
Output:
{
"status": "ok",
"message": "Port description updated."
}