Post

Ubnt automation notes

AirFiber 60 and family

Interesting commands:

  • prs_*
    • prs_stats -
  • rtstat
  • tcpdump
  • ubinfo
  • uibox - Seems to be a replacement of ubntbox
  • wave_ai

  • As of:
    • Conditions:
      • 1.3.0
      • AF60-XR
    • Notice:
      • ubntbox is missing, seems to be replaced with uibox.
  • Done

Zabbix - Ubiquiti Screen scrape stats

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
try {
	var obj = JSON.parse(value);
	var host = obj.host;
	var password = obj.pass;
	var username = obj.user;
	var result = "";
	var base_url = "https://" + host;
	var login_path = "/api/v1.0/user/login";
	var stat_path = "/api/v1.0/statistics";

	var req = new HttpRequest();
	var resp = req.post(
		base_url + login_path,
		JSON.stringify({'username': username, 'password': password})
	);
	if (req.getStatus() != 200) { throw "Error logging in: " + req.getStatus(); }
	var authheaders = req.getHeaders();
	var authtoken = authheaders["x-auth-token"];

	req.addHeader("x-auth-token: " + authtoken);
	resp = req.get(base_url + stat_path);

	if (req.getStatus() != 200) { throw "Error fetching stats: " + req.getStatus(); }
	result = resp;
} catch (error) {
	Zabbix.log(2, "ERROR - EdgePower stats fetch: " + error);
	result = JSON.stringify({'error': error});
}

return result;
This post is licensed under CC BY 4.0 by the author.