Using API calls, you can get information about the activity of the Mikiri WAF agents and the state of the servers on which they are installed.
Data is requested using specially designed queries. The general conventions (authorization, response codes, the *_hash methods and paginated selection) are described in the relevant section.
An agent is considered active ("active": true) if the last message from it was received no later than 60 seconds ago; for the scanner agent - no later than 3 hours ago.
API reports agent api for every CID already present in Agent Monitoring. WMC reports agent wmc for every CID attached to it. Both send RAM, CPU and disk once every 30 seconds.
Request example:
curl http://api.example.com:8080/am/v1/get_agent_monitoring --header 'Content-type: application/json' --data '{"key": "%PRODUCT KEY%"}'
Response format:
If the data is missing, an empty array is returned in the agents field.
{
"status": "success",
"agents": [
{
"id": integer,
"active": boolean,
"agent": string,
"ip": string,
"iid": string,
"lastActivity": integer,
"systemMonitor": {
"ram": {
"total": number,
"available": number,
"free": number,
"percent": number
},
"cpu": {
"percent": number,
"load": array
},
"disk": [
{
"partition": string,
"total": number,
"used": number,
"free": number,
"percent": number
},
...
]
}
},
...
]
}
or (in case of an error)
{"status": "fail", "description": "%DESCRIPTION%"}
Response example:
{
"status": "success",
"agents": [
{
"id": 1,
"active": true,
"agent": "filter",
"ip": "10.10.10.1",
"iid": "abad7224dfef6baee9434d470d96e3c4",
"lastActivity": 1730986421,
"systemMonitor": {
"ram": {
"total": 6.0,
"available": 3.2,
"free": 1.1,
"percent": 46.7
},
"cpu": {
"percent": 12.5,
"load": [0.42, 0.35, 0.28]
},
"disk": [
{
"partition": "/",
"total": 10.0,
"used": 4.5,
"free": 5.5,
"percent": 45.0
}
]
}
}
]
}
id - the ID of an entry in the api database;active - the activity of the agent;agent - the type of the agent: filter, mla, mlc, scanner, api or wmc;ip - the IP address of the agent;iid - the unique identifier of the agent;lastActivity - the date of the last message received from the agent in the Unix Timestamp format;systemMonitor - information about the state of the server. If the agent has not transmitted the data, the value null is returned.systemMonitor.ram:
total - the total amount of memory, GB;available - the available memory, GB;free - the free memory, GB;percent - the memory in use, %.systemMonitor.cpu:
percent - the current CPU load, %;load - the CPU load average for 1, 5 and 15 minutes.systemMonitor.disk:
partition - the disk partition;total - the total size, GB;used - used, GB;free - free, GB;percent - used, %.Request example:
curl http://api.example.com:8080/am/v1/del_agent_monitoring --header 'Content-type: application/json' --data '{
"key": "%PRODUCT KEY%",
"id": [1, 2, 3]
}'
Required parameters:
id - the identifiers of the entries in the api database.Response example:
{"status": "success", "deleted": 3}
or (in case of an error)
{"status": "fail", "description": "%DESCRIPTION%"}
deleted - the number of deleted records.After the record is deleted, information about the agent will be created again the next time a message is received from it.