Implement a web agent service that monitors a server.
Method: GET
{
"cpus": 2,
"memory": {
"total": 100,
"used": 30
},
"uptime": 10,
"usage": 30
}
List the cpus
Method: GET
[
{
"model": "cpu model",
"manufacturer": "cpu manufacturer",
"speed": 1000,
"usage": 30
}
]
List the information about one cpu
Methods: GET
{
"model": "cpu model",
"manufacturer": "cpu manufacturer",
"speed": 1000,
"usage": 30
}
Return the list of processes PIDs
[
1, 2, 3, 46, 110234, ...
]
Return information about a process
{
"command": "....",
"arguments": ["...", "..."],
"memory": {
"vsz": 1000,
"rss": 300
}
}
Stop a process
{
"status": "ok or error",
"erroor": 0
}
Method POST
{
"command": "command to run",
"arguments": ["argument1", "argument2"],
"environment" {
"variable1": "value",
"variable2": "value",
"variable3": "value"
}
}
Response
{
"status": "ok or error",
"error": 0
}