alxpanel-agentctl
Sends one operation to the agent and prints its answer as JSON. A diagnostics tool.
The agent is the service that changes the server on the panel's behalf. The panel talks to it over a socket; this command does the same from a shell. Use it to see what the agent sees when the panel shows something you do not expect. Run it as root.
Usage
alxpanel-agentctl [--socket PATH] [--dry-run] <operation> ['<json-arguments>']
| Argument | Meaning |
|---|---|
<operation> |
The name of an agent operation, such as ping or firewall.status. |
'<json-arguments>' |
The operation's arguments as one JSON object. Default {}. |
--dry-run |
Plan only, apply nothing. Must come before the operation. |
--socket PATH |
The agent's socket. Default /run/alxpanel/agent.sock. |
Examples
Is the agent answering?
alxpanel-agentctl ping
What does the agent report about the firewall?
alxpanel-agentctl firewall.status
A warning
This is the same door the panel uses, with nothing in between. An operation that changes something changes it for real, and the panel's database will not know. Keep to operations that only read, or pass --dry-run. To change the server, use the panel.
Exit codes
| Exit code | Meaning |
|---|---|
| 0 | The agent answered, and the operation succeeded. |
| 1 | The agent could not be reached, or it answered that the operation failed. The answer is still printed. |
| 2 | Wrong usage, or arguments that are not valid JSON. |
Every operation, from the panel or from here, is recorded in /var/log/alxpanel/agent-audit.log.