|
Version |
Path (required) |
Additional variables / JSON Data |
Returns |
Port Graphs |
/api |
/v0 |
/devices/$hostname/ports/$ifName/$type |
- $hostname = the hostname of the device you want the graph for
- $ifName = The ifName of the interface you want a graph for
- $type = the type of graph for the port (port_bits,port_upkts)
- $width = the width of the graph to be returned
- $height = the height of the graph to be returned
- $from = the from date/time of the graph (unix timestamp)
- $to = the to date/time of the graph (unix timestamp)
|
PNG Image
|
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost/ports/eth0/port_bits" > /tmp/graph.png |
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost/ports/eth0/port_bits?width=1024&height=768&from=1405457456&to=1405543856" > /tmp/graph.png |
General Info |
/api |
/v0 |
/devices/$hostname |
- $hostname = the hostname of the device you want the information about
|
JSON |
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost" > localhost.json |
General Graphs |
/api |
/v0 |
/devices/$hostname/$type |
- $hostname = the hostname of the device you want the graph for
- $type = the type of graph for the device (device_processor,device_storage)
- $width = the width of the graph to be returned
- $height = the height of the graph to be returned
- $from = the from date/time of the graph (unix timestamp)
- $to = the to date/time of the graph (unix timestamp)
|
PNG Image
|
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost/device_processor" > /tmp/graph.png |
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost/device_processor?width=1024&height=768&from=1405457456&to=1405543856" > /tmp/graph.png |
Port Stats |
/api |
/v0 |
/devices/$hostname/ports/$ifName |
- $hostname = the hostname of the device
- $ifName = the ifName of the port
|
JSON
|
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost/ports/eth0" |
List |
/api |
/v0 |
/devices |
- $order = the name of the column to order by
- $type = this is the device status (all, ignored, up, down, disabled)
|
JSON
|
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices" |
curl -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices?order=hostname&type=all" |
Add |
/api |
/v0 |
/devices |
- hostname = the hostname to be added
- version = the version of snmp to use
- community = the community to use
- port = the port to use
- transport = the transport to use
- authlevel = the auth level to use for v3
- authname = the auth name to use for v3
- authpass = the auth pass to use for v3
- authalog = the auth algorythm to use for v3
- cryptopass = the crypto pass to use for v3
- cryptoalgo = the crytpo algo to use for v3
|
JSON
|
curl -X POST -d '{"hostname":"localhost.localdomain","version":"v0","community":"public"}' \ -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices" |
Delete |
/api |
/v0 |
/devices/$hostname |
- hostname = the hostname to be deleted
|
JSON
|
curl -X DELETE -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/devices/localhost" |
List VLANs |
/api |
/v0 |
/vlans/$hostname |
- hostname = the hostname to list vlans for
|
JSON
|
curl -X DELETE -H "Content-Type: application/json" -H "X-Auth-Token: 91c60e737e342c205be5bba8e2954d27" \ "https://librenms.example.com/api/v0/vlans/localhost" |