https://github.com/leviself56/edgeos-api
Php code for querying statistics from Ubiquiti Edgeswitch
https://github.com/leviself56/edgeos-api
php7 rest-api ubiquiti ubiquiti-edgeos
Last synced: 3 months ago
JSON representation
Php code for querying statistics from Ubiquiti Edgeswitch
- Host: GitHub
- URL: https://github.com/leviself56/edgeos-api
- Owner: leviself56
- Created: 2024-02-16T15:24:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-16T20:29:41.000Z (over 2 years ago)
- Last Synced: 2025-01-19T18:43:51.380Z (over 1 year ago)
- Topics: php7, rest-api, ubiquiti, ubiquiti-edgeos
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EdgeOS REST API
## Php code for querying statistics from Ubiquiti Edgeswitch
Server will need access to the switch in the same subnet/vlan.
The file `api.php` allows a remote server (like Zabbix) to query the switch and retrieve the datasets via HTTP POST.
This code can be further expanded to include POST, PATCH or PUT to manipulate the remote switch.
Current functions:
+ `get.sfps`
+ `get.interfaces`
+ `get.system.info`
Example usage:
```POST http://localhost/EdgeOS/api.php```
```Content-Type: application/json```
```
{
"ip": "10.15.100.170",
"username": "ubnt",
"password": "ubnt",
"function": "get.sfps"
}
```
Sample Response:
```
{
"0/1": {
"temperature": 24,
"voltage": 3.281,
"current": 0,
"rxPower": -40,
"txPower": -40
},
"0/2": {
"temperature": 23.5,
"voltage": 3.341,
"current": 37.17,
"rxPower": -7.552,
"txPower": -2.184
},
"0/3": {
"temperature": 18.6,
"voltage": 3.291,
"current": 17.982,
"rxPower": -11.249,
"txPower": -5.612
}
}
```