You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/monitors/targets/configure-targets.mdx
+6-19Lines changed: 6 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,6 @@ host:
51
51
52
52
shell_exec:
53
53
enabled: true
54
-
pipeline_max_segments: 3
55
54
default_max_lines: 200
56
55
cat_max_file_size: 20971520
57
56
user_allow_list: []
@@ -67,10 +66,6 @@ mongodb: []
67
66
mongodb_mongos: []
68
67
kafka: []
69
68
elasticsearch: []
70
-
71
-
script_tool:
72
-
enabled: false
73
-
dir: /opt/monit-agent/tools.d
74
69
```
75
70
76
71
## locator_mappings
@@ -121,7 +116,6 @@ Recommendations:
121
116
host:
122
117
shell_exec:
123
118
enabled: true
124
-
pipeline_max_segments: 3
125
119
default_max_lines: 200
126
120
cat_max_file_size: 20971520
127
121
user_allow_list: []
@@ -130,7 +124,10 @@ host:
130
124
Recommendations:
131
125
132
126
- Keep `enabled: true` when AI-SRE needs live host diagnostics. Only controlled shell commands can be executed.
133
-
- If some shell commands are blocked by built-in guardrails, add them manually to `user_allow_list` only after confirming that they are safe, read-only, and do not expose sensitive information.
127
+
- If a command is occasionally blocked, local root can [approve that command](/en/monitors/targets/install-agent#approve-a-blocked-shell-command).
128
+
- For a command that needs to run repeatedly, add the complete command to `user_allow_list` only after confirming that it is safe, read-only, and does not expose sensitive information.
129
+
130
+
Neither human approval nor `user_allow_list` can allow high-risk operations such as shutdown, reboot, system destruction, or reading sensitive credentials.
134
131
135
132
To urgently disable a tool, use `tool_policy.disabled_tools`:
136
133
@@ -140,6 +137,8 @@ tool_policy:
140
137
- shell.exec
141
138
```
142
139
140
+
After changing `shell_exec.enabled` or `tool_policy.disabled_tools`, send SIGHUP to reload the configuration. The change takes effect without restarting the Agent.
141
+
143
142
## MySQL
144
143
145
144
To diagnose MySQL, add instance configuration under `mysql:`. Use a read-only MySQL account, and preferably store the password in a separate credential file:
@@ -499,15 +498,3 @@ ES_PASSWORD=<ES_PASSWORD>
499
498
| `credential` | If Elasticsearch security authentication is disabled, credential can be omitted. Configure a read-only account in production. |
500
499
501
500
Elasticsearch does not use `locator_mappings`. The Agent automatically obtains `cluster_name` from the cluster and uses it as the object address in the console.
502
-
503
-
## script_tool
504
-
505
-
`script_tool` is used to add custom script tools. Most users can keep it disabled:
506
-
507
-
```yaml
508
-
script_tool:
509
-
enabled: false
510
-
dir: /opt/monit-agent/tools.d
511
-
```
512
-
513
-
Enable it only when you need custom diagnostic capabilities and can confirm that the script source and directory permissions are controlled.
Copy file name to clipboardExpand all lines: en/monitors/targets/install-agent.mdx
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Prepare the following information before installation:
13
13
| Item | Description |
14
14
|---|---|
15
15
| Agent package download URL |`https://static.flashcat.cloud/monitagent/monitagent-v0.0.27-linux-amd64.tar.gz`. For ARM CPUs, replace `amd64` with `arm64`. |
16
-
| Edge address | For example, `ws://edge.example.com:6868` or `wss://edge.example.com:6868`. Edge version must be `>= v0.46.0`. View the Edge list and installation method [here](https://console.flashcat.cloud/monit/engine/list). |
16
+
| Edge address | For example, `ws://edge.example.com:6868` or `wss://edge.example.com:6868`. Edge version must be `>= v0.47.0`. View the Edge list and installation method [here](https://console.flashcat.cloud/monit/engine/list). |
17
17
| Local host object address | Use the current host's fixed private IP or DNS name, such as `10.0.1.12`. If omitted, the Agent uses the IP address associated with the local default route. |
18
18
| Read-only accounts for databases and middleware | To diagnose MySQL, Redis, PostgreSQL, MongoDB, Kafka, Elasticsearch, and other services, prepare read-only accounts and credentials in advance. |
19
19
@@ -132,6 +132,30 @@ If you modify the Edge address, Basic Auth, TLS parameters, or `hostLocator`, re
132
132
sudo systemctl kill -s HUP monitagent
133
133
```
134
134
135
+
## Approve a blocked Shell command
136
+
137
+
`shell.exec` automatically runs read-only diagnostic commands that meet its built-in safety rules. If a command does not pass the automatic rules but you have confirmed that it is appropriate for the current machine, sign in to the Linux host running the Agent and open an approval session as root:
138
+
139
+
```bash
140
+
sudo /opt/monit-agent/monitagent shell-approval
141
+
```
142
+
143
+
After the session connects, it displays a waiting status. When commands need approval, the terminal shows only the commands and a ten-second countdown:
144
+
145
+
- Press Enter to approve every command in the current batch.
146
+
- Press `n` to reject every command in the current batch.
147
+
- If you do not respond within ten seconds, the batch is rejected automatically. Concurrent commands that arrive later are queued and receive a full ten-second window after they are displayed.
148
+
- Input while no command is pending does not execute anything; the terminal continues to display the waiting status.
149
+
- Press `Ctrl-C` to close the approval session.
150
+
151
+
Only one approval session can be active for an Agent. To take over an existing session, run:
Only root can open or replace a session. Pending commands are rejected if the Agent restarts or the session disconnects, and you must open a new session after a restart. High-risk operations such as shutdown, reboot, system destruction, or reading sensitive credentials cannot be enabled through human approval.
158
+
135
159
## Next step
136
160
137
161
After the Agent starts successfully, a host object usually appears on the monitoring object page within a few seconds. Next, read [Configure Monitoring Objects](/en/monitors/targets/configure-targets) to add database and middleware objects in `agent.yaml`.
If you only add or adjust object configuration in `agent.yaml`, use SIGHUP reload first. Restart is needed only when startup parameters or service-level parameters change.
30
30
</Note>
31
31
32
+
After changing tool switches, a successful reload updates the diagnostic tools currently available from the Agent. No restart is required.
33
+
32
34
## Verify successful onboarding
33
35
34
36
After the Agent starts, a host object usually appears on the monitoring object page within a few seconds.
0 commit comments