Agent services
addagent
This service creates a new agent. After creation, the new agent implements the basic configuration and can be managed via this API or the NXLog Manager user interface.
Type of Request: POST
URL: https://hostname:9443/nxlog-manager/mvc/restservice/addagent
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Object specifying the characteristics of the agent being created. It contains
the |
XML or JSON object |
Required |
|
Unique name of the agent being created. If the request specifies the
|
String |
Required/Optional |
|
Object with several nested parameters which are listed below in this table. The first three parameters are required and define the minimum agent’s configuration, other are optional. |
XML or JSON |
Required |
|
Communication address or DNS hostname of the agent in case of the IPv4 and IPv6 addresses are supported. |
String |
Required |
|
Port associated with the |
Integer |
Required |
|
Fingerprint of the default certificate issuer which is used by the agent manager. To obtain the fingerprint information, you can run the certificateinfo service. |
String |
Required |
|
Fingerprint of the existing certificate which can be assigned to the agent during creation. If this parameter is omitted, a new certificate will be created and assigned to the agent. Such certificate uses the agent name and the default subject parameters according to the values from the Certificates tab. To obtain the certificate fingerprint of the existing certificate, you can run the certificateinfoservice. |
String |
Optional |
|
Specifies the Log to file
parameter configuration. The default value is |
Boolean |
Optional |
|
Severity level set by the LogLevel directive.
Accepts one of the following values: |
String |
Optional |
|
The connection mode the agent will use after creation.
Accepts the For more details, see the Connection type parameter description of the Agent Configuration topic. |
String |
Optional |
|
Verbatim configuration of the agent. After the agent has been created, this configuration is available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v POST "https://hostname:9443/nxlog-manager/mvc/restservice/addagent" -H "accept:application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"global-config\": { \"ca-fingerprint\":\"82cb807dea47e8c31a448e7496afa45d1922aa8\", \"address\": \"192.168.31.86\", \"port\": 9442, \"mode\": \"Listen\" }, \"name\": \"Agent_192.168.31.86\"}"
{
"servicename": "addagent",
"values": [
{
"message": "Agent 'Agent_192.168.31.86' is created."
}
],
"links": [
{
"rel": "self",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_192.168.31.86"
}
]
}
agentinfo
Retrieves information about NXLog agents registered with NXLog Manager.
Type of Request: GET
URL: https://hostname:9443/nxlog-manager/mvc/restservice/agentinfo
This service can accept the communication format specified via the .xml
or .json extensions appended to the end of the URL which can be used instead
of the accept and Content-Type headers.
For JSON format, the following URL should be used: https://hostname:9443/nxlog-manager/mvc/restservice/agentinfo.json .
The following URL should be used for XML: https://hostname:9443/nxlog-manager/mvc/restservice/agentinfo.xml .
|
Parameters are listed below. At least one parameter should be used to retrieve information.
Parameter | Description | Format | Type |
---|---|---|---|
|
A comma-delimited list of agent names for which information should be listed.
This parameter is mutually exclusive with the Can be combined with the |
Array[string] |
Optional |
|
Listing of agent information based on the state. In case of several states, this parameter can be specified for each state separately. The following states are available: Mutually exclusive with the This can be combined with the |
Array[string] |
Optional |
|
Listing of modules. This parameter can be combined with the |
Boolean |
Optional |
curl -k -v -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" "https://hostname:9443/nxlog-manager/mvc/restservice/agentinfo.json?agentstate=ONLINE&agentwithmodules=TRUE"
{
"servicename": "agentinfo",
"values": [
{
"content": {
"name": "192.168.31.86",
"version": "5.0.5874",
"status": "ONLINE",
"os": "Linux",
"address": "192.168.31.86",
"hostname": "nxlog",
"started": "2020-06-30 21:38",
"load": "0.01",
"memUsage": 1.0432512e7,
"received": 0,
"receivedToday": 0,
"processing": 0,
"sent": 0,
"sentToday": 0,
"lastOnline": "2020-07-03 23:43",
"sysinfo": "OS: Linux, Hostname: nxlog, Release: 3.10.0-1127.8.2.el7.x86_64, Version: #1 SMP Tue May 12 16:57:42 UTC 2020, Arch: x86_64, 2 CPU(s), 3.7Gb memory",
"modules": [
{
"module_name": "to_file",
"module": "om_file",
"module-type": 3,
"type": "OUTPUT",
"isRunning": true,
"evt-recvd": 0,
"queuesize": 0,
"evt-fwd": 0,
"evt-drop": 0,
"status": 3,
"module-status": "RUNNING",
"id": 24,
"serverInfo": {}
},
{
"module_name": "from_file",
"module": "im_file",
"module-type": 1,
"type": "INPUT",
"isRunning": true,
"evt-recvd": 0,
"queuesize": 0,
"evt-fwd": 0,
"evt-drop": 0,
"status": 3,
"module-status": "RUNNING",
"id": 23,
"serverInfo": {}
}
]
},
"links": [
{
"rel": "self",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/agentinfo.json?agentname=192.168.31.86&agentwithmodules=true{&agentstate}"
},
{
"rel": "online_agents_with_modules",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/agentinfo.json?agentstate=ONLINE&agentwithmodules=true{&agentname}"
},
{
"rel": "all_agents_with_modules",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/agentinfo.json?agentwithmodules=true{&agentname,agentstate}"
}
]
}
],
"links": [
{
"rel": "self",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/agentinfo.json?agentstate=ONLINE&agentwithmodules=true{&agentname}"
}
]
}
modifyagent
Modifies the existing agent configuration.
Type of Request: PUT
URL: https://hostname:9443/nxlog-manager/mvc/restservice/modifyagent
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Specifies the name of the agent to be modified. Only one agent name per request can be used. |
String |
Required |
|
Object specifying the characteristics of the agent being created. It contains
the |
XML or JSON object |
Required |
|
The new unique name which will be used to replace the existing agent’s name.
In case the agent name needs to remain unaltered, this parameter should accept
the same name as the |
String |
Required |
|
Object containing several nested parameters which are listed below in this table. Three parameters are required, and other are optional. By providing new values to any of these parameters, the existing agent’s configuration can be altered. |
XML or JSON |
Required |
|
Communication address or DNS hostname of the agent in case of the IPv4 and IPv6 addresses are supported. |
String |
Required |
|
Port associated with the |
Integer |
Required |
|
Fingerprint of the default certificate issuer which is used by the agent manager. To obtain the fingerprint information, you can run the certificateinfo service. |
String |
Required |
|
Fingerprint of the existing certificate which can be assigned to the agent after modification. To obtain the certificate fingerprint, you can run the certificateinfo service. |
String |
Optional |
|
Specifies the Log to file
parameter configuration. The default value is |
Boolean |
Optional |
|
Severity level set by the LogLevel directive.
Accepts one of the following values: |
String |
Optional |
|
Connection mode the agent will use after modification. The parameter accepts
the For more details, see the Connection type parameter description of the Agent configuration topic. |
String |
Optional |
|
Verbatim configuration which will be used by the agent after modification. This configuration will be available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v -X PUT "https://hostname:9443/nxlog-manager/mvc/restservice/modifyagent?agentName=Agent_192.168.31.86" -H "accept: application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"global-config\": { \"ca-fingerprint\": \"82cb807dea47e8c31a448e7496afa45d1922aa8\", \"address\": \"192.168.31.218\", \"mode\": \"Listen\", \"port\": 9442 }, \"name\": \"Agent_192.168.31.218\"}"
{
"servicename": "modifyagent",
"values": [
{
"message": "Agent global configuration saved successfully."
}
],
"links": [
{
"rel": "self",
"href": "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_192.168.31.218"
}
]
}