mirror of
https://github.com/Telecominfraproject/wlan-cloud-analytics.git
synced 2026-01-27 02:22:21 +00:00
Hardening stats
This commit is contained in:
@@ -452,7 +452,13 @@ paths:
|
||||
schema:
|
||||
type: boolean
|
||||
required: false
|
||||
|
||||
- in: query
|
||||
description: list of boards for a given venue
|
||||
name: forVenue
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
required: false
|
||||
responses:
|
||||
200:
|
||||
description: Return a list of boards
|
||||
|
||||
@@ -8,6 +8,25 @@
|
||||
|
||||
namespace OpenWifi {
|
||||
void RESTAPI_board_list_handler::DoGet() {
|
||||
auto forVenue = GetParameter("forVenue","");
|
||||
|
||||
if(!forVenue.empty()) {
|
||||
std::vector<AnalyticsObjects::BoardInfo> Boards;
|
||||
auto F = [&](const AnalyticsObjects::BoardInfo &B) -> bool {
|
||||
if(!B.venueList.empty()) {
|
||||
for(const auto &venue:B.venueList) {
|
||||
if(venue.id == forVenue) {
|
||||
Boards.emplace_back(B);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
DB_.Iterate(F);
|
||||
return ReturnObject("boards",Boards);
|
||||
}
|
||||
|
||||
return ListHandler<BoardsDB>("boards", DB_, *this);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace OpenWifi {
|
||||
class RelativeCounter {
|
||||
public:
|
||||
explicit RelativeCounter(uint64_t iv) {
|
||||
inited = iv;
|
||||
inited = true;
|
||||
LastValue = iv;
|
||||
}
|
||||
|
||||
RelativeCounter() = default;
|
||||
|
||||
inline uint64_t set(uint64_t v) {
|
||||
[[nodiscard]] inline uint64_t set(uint64_t v) {
|
||||
if(!inited) {
|
||||
inited=true;
|
||||
LastValue=v;
|
||||
|
||||
154
stats_sample/bridge2_config.json
Normal file
154
stats_sample/bridge2_config.json
Normal file
@@ -0,0 +1,154 @@
|
||||
{
|
||||
"globals": {
|
||||
"wireless-multimedia": {
|
||||
"profile": "rfc8325"
|
||||
}
|
||||
},
|
||||
"interfaces": [
|
||||
{
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"WAN*",
|
||||
"LAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"ipv6": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"name": "BowenNetwork",
|
||||
"role": "upstream",
|
||||
"services": [
|
||||
"ssh",
|
||||
"lldp",
|
||||
"mdns"
|
||||
],
|
||||
"ssids": [
|
||||
{
|
||||
"bss-mode": "mesh",
|
||||
"encryption": {
|
||||
"ieee80211w": "optional",
|
||||
"key": "snoopy_mesh",
|
||||
"proto": "psk2"
|
||||
},
|
||||
"name": "BowenMesh",
|
||||
"services": [
|
||||
"statistics"
|
||||
],
|
||||
"wifi-bands": [
|
||||
"5G"
|
||||
]
|
||||
},
|
||||
{
|
||||
"bss-mode": "ap",
|
||||
"encryption": {
|
||||
"ieee80211w": "optional",
|
||||
"key": "snoopy99",
|
||||
"proto": "psk2"
|
||||
},
|
||||
"name": "petunia",
|
||||
"roaming": {
|
||||
"generate-psk": true,
|
||||
"message-exchange": "ds"
|
||||
},
|
||||
"services": [
|
||||
"wifi-steering"
|
||||
],
|
||||
"wifi-bands": [
|
||||
"2G",
|
||||
"5G"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tunnel": {
|
||||
"proto": "mesh"
|
||||
},
|
||||
"vlan": {
|
||||
"id": 100
|
||||
}
|
||||
}
|
||||
],
|
||||
"metrics": {
|
||||
"dhcp-snooping": {
|
||||
"filters": [
|
||||
"ack",
|
||||
"discover",
|
||||
"offer",
|
||||
"request",
|
||||
"solicit",
|
||||
"reply",
|
||||
"renew"
|
||||
]
|
||||
},
|
||||
"health": {
|
||||
"interval": 60
|
||||
},
|
||||
"statistics": {
|
||||
"interval": 60,
|
||||
"types": [
|
||||
"ssids",
|
||||
"lldp",
|
||||
"clients"
|
||||
]
|
||||
},
|
||||
"wifi-frames": {
|
||||
"filters": [
|
||||
"probe",
|
||||
"auth",
|
||||
"assoc",
|
||||
"disassoc",
|
||||
"deauth",
|
||||
"local-deauth",
|
||||
"inactive-deauth",
|
||||
"key-mismatch",
|
||||
"beacon-report",
|
||||
"radar-detected"
|
||||
]
|
||||
}
|
||||
},
|
||||
"radios": [
|
||||
{
|
||||
"band": "5G",
|
||||
"bandwidth": 20,
|
||||
"channel": 36,
|
||||
"channel-mode": "VHT",
|
||||
"channel-width": 80,
|
||||
"country": "CA",
|
||||
"tx-power": 10
|
||||
},
|
||||
{
|
||||
"band": "2G",
|
||||
"bandwidth": 20,
|
||||
"channel-mode": "VHT",
|
||||
"channel-width": 40,
|
||||
"country": "CA",
|
||||
"tx-power": 23
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"lldp": {
|
||||
"describe": "uCentral",
|
||||
"location": "universe"
|
||||
},
|
||||
"mdns": {
|
||||
"enable": true
|
||||
},
|
||||
"ssh": {
|
||||
"port": 22
|
||||
},
|
||||
"wifi-steering": {
|
||||
"assoc-steering": true,
|
||||
"load-kick-threshold": 90,
|
||||
"mode": "local",
|
||||
"network": "upstream",
|
||||
"required-probe-snr": -80,
|
||||
"required-roam-snr": -80,
|
||||
"required-snr": -85
|
||||
}
|
||||
},
|
||||
"uuid": 1645464648
|
||||
}
|
||||
@@ -236,6 +236,13 @@ listboards() {
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
boardsforvenue() {
|
||||
curl ${FLAGS} -X GET "https://${OWANALYTICS}/api/v1/boards?forVenue=$1" \
|
||||
-H "accept: application/json" \
|
||||
-H "Authorization: Bearer ${token}" > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
boarddevices() {
|
||||
curl ${FLAGS} -X GET "https://${OWANALYTICS}/api/v1/board/$1/devices" \
|
||||
-H "accept: application/json" \
|
||||
@@ -257,6 +264,7 @@ case "$1" in
|
||||
"systeminfo") login; systeminfo ; logout;;
|
||||
"boarddevices") login; boarddevices $2 ; logout ;;
|
||||
"deleteboard") login; deleteboard $2; logout ;;
|
||||
"boardsforvenue") login; boardsforvenue $2; logout;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user