Get Object's Stat

GET /node/api/objects/:id/stat

Returns object's agent data (stat).
Permissions: objectPermissions.

Request parameters

Path parameters

Parameter
Type
Description
id
string
required
The ID of an object whose stat should be retrieved.

Response description

...

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
object_id=<...>
5
url=https://$saymon_hostname/node/api/objects/$object_id/stat
6
7
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let objectId = <...>
5
let path = "/node/api/objects/" + objectId + "/stat";
6
let auth = "Basic " + btoa(login + ":" + password);
7
8
let headers = new Headers();
9
headers.append("Authorization", auth);
10
11
let requestOptions = {
12
method: "GET",
13
headers: headers
14
};
15
16
fetch(saymonHostname + path, requestOptions)
17
.then(response => response.text())
18
.then(result => console.log(result))
19
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let objectId = <...>
7
let path = "/node/api/objects/" + objectId + "/stat";
8
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
9
10
let options = {
11
"method": "GET",
12
"hostname": saymonHostname,
13
"headers": {
14
"Authorization": auth
15
},
16
"path": path
17
};
18
19
let req = http.request(options, function (res) {
20
let chunks = [];
21
22
res.on("data", function (chunk) {
23
chunks.push(chunk);
24
});
25
26
res.on("end", function (chunk) {
27
let body = Buffer.concat(chunks);
28
console.log(body.toString());
29
});
30
31
res.on("error", function (error) {
32
console.error(error);
33
});
34
});
35
36
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
object_id = <...>
7
url = "https://" + saymon_hostname + "/node/api/objects/" + \
8
object_id + "/stat"
9
10
response = requests.request("GET", url, auth=(login, password))
11
print(response.text)
Copied!

Response example

1
{
2
"entityId": "5e21b85b308c3c66d64e07c8",
3
"entityType": "obj",
4
"taskType": "agentWatchdog",
5
"period": 60000,
6
"timestamp": 1585040374498,
7
"agentId": "5e21b85b308c3c66d64e07c8",
8
"agentVersion": "4.2.69-SNAPSHOT",
9
"agentBuild": "866cc",
10
"payload": {
11
"runtimeName": "OpenJDK Runtime Environment",
12
"runtimeVersion": "1.8.0_242-8u242-b08-0ubuntu3~16.04-b08",
13
"totalMemory": 267911168,
14
"freeMemory": 226294168,
15
"maxMemory": 1830813696,
16
"usedHeapMemory": 41617000,
17
"usedNonHeapMemory": 36068184,
18
"processCpuLoad": 0.0036666666666666666,
19
"numberOfThreads": 10,
20
"snmpTrapsPerSecond": 0,
21
"statNotificationsPerSecond": 0,
22
"tasksNumber": 1,
23
"hostName": "rossinnotw",
24
"networkInterfaces": {
25
"IPv6": [
26
"fe80:0:0:0:24a9:1aff:fecb:3722%veth3c89613",
27
"fe80:0:0:0:f45b:6dff:fe6e:5497%veth9f402c5",
28
"fe80:0:0:0:42:ffff:fe77:1b87%docker0",
29
"fe80:0:0:0:3e4d:25b:3be:d798%enp4s0"
30
],
31
"IPv4": [
32
"172.17.0.1",
33
"192.168.1.82"
34
]
35
}
36
}
37
}
Copied!
Last modified 1yr ago