昨天在ZZ.AC上通过dode js 的环境成功安装了探针。对于系统的代理运行方式有了一些心得。今天尝试在系统上直接安装运行哪吒探针。
直接用脚本运行
在哪吒面板的管理页面获取到哪吒的安装脚本
1
| curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/agent/install.sh -o agent.sh && chmod +x agent.sh && env NZ_SERVER=x.x.x.x:8008 NZ_TLS=false NZ_CLIENT_SECRET=your -nezha-SECRET ./agent.sh
|
尝试运行脚本提示
1
| Download nezha-agent release failed, check your network connectivity
|
在下载nezha-agent release失败,检查网络链接。
于是尝试直接从官网下载对于的系统版本,运行以下命令获取系统构架:
1
2
| $ uname -a
Linux h1.lab.zz.ac 6.14.0-1018-oracle #18~24.04.1-Ubuntu SMP Wed Dec 3 15:40:15 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
|
aarch64,是arm64架构,通过wget 下载:
1
2
| wget https://github.com/nezhahq/agent/releases/download/v1.14.1/nezha-agent_linux_arm64.zip
Error parsing proxy URL http://[fe80::1%25eth0]:8888: Invalid IPv6 numeric address.
|
经过询问Geimi:
看来 wget 对这种带有 %eth0 接口标识的 IPv6 代理地址解析支持得并不友好。在 Linux 命令行工具中,处理 Link-local (fe80) 地址时经常会遇到这种解析歧义。
既然 wget 报错,我们直接换一种不依赖系统环境变量格式的方式来解决:使用 curl 下载
你之前的测试证明 curl 在你的环境下运行良好,而且 curl 对各种代理格式的兼容性比 wget 强得多。请直接执行:
1
| curl -L -O --proxy "http://[fe80::1%eth0]:8888" https://github.com/nezhahq/agent/releases/download/v1.14.1/nezha-agent_linux_arm64.zip
|
参数说明:-L 跟踪重定向(GitHub 必须),-O 保存为同名文件,--proxy 直接指定代理。
这个系统已经有变量了,直接运行:
1
| curl -L -O https://github.com/nezhahq/agent/releases/download/v1.14.1/nezha-agent_linux_arm64.zip
|
下载成功nezha-agent_linux_arm64.zip,解压,并运行一次,生成原始配置文件:
1
2
3
4
5
6
7
8
9
10
11
12
| bosh@h1:unzip nezha-agent_linux_arm64.zip
Archive: nezha-agent_linux_arm64.zip
inflating: nezha-agent
bosh@h1:~/testnezha$ ./nezha-agent
2026/01/01 02:07:59 init config failed: server address should not be empty
bosh@h1:~/testnezha$ rm nezha-agent_linux_arm64.zip
bosh@h1:~/testnezha$ ls -al
total 15824
drwxrwxr-x 2 bosh bosh 4096 Jan 1 02:08 .
drwxr-xr-x 17 bosh bosh 4096 Jan 1 01:59 ..
-rw------- 1 bosh bosh 448 Jan 1 02:07 config.yml
-rwxr-xr-x 1 bosh bosh 16187576 Oct 9 13:32 nezha-agent
|
修改配置文件中的部分字段:
1
2
3
4
5
6
| client_secret: "" #哪吒面板的密钥
debug: false #改为true
disable_auto_update: false #改为true
disable_command_execute: false
disable_force_update: false #改为true
server: "" #哪吒面板的地址:ip:8008
|
运行 ./nezha-agent -c config.yml
1
2
3
4
| ./nezha-agent -c config.yml
I: 02:18:36 NEZHA@2026-01-01 02:18:36>> Connection to 【x.x.x.x】:8008 established
I: 02:18:36 NEZHA@2026-01-01 02:18:36>> 上报系统信息失败: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 【x.x.x.x】:8008: connect: network is unreachable"
……
|
修改系统代理配置:
1
| export https_proxy="http://[fe80::1%25eth0]:8888"
|
运行 ./nezha-agent -c config.yml ,成功链接!