From bad1de210ea854f8936ebbb4099f721edab6945e Mon Sep 17 00:00:00 2001 From: hhhkkk520 Date: Mon, 30 May 2022 17:34:00 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E4=B8=AD?= =?UTF-8?q?=E6=96=87Agent=E5=AE=89=E8=A3=85=E4=BB=8B=E7=BB=8D=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0MacOS=E5=AE=89=E8=A3=85=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/agent.md | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/guide/agent.md b/docs/guide/agent.md index b919c13c..84d86315 100644 --- a/docs/guide/agent.md +++ b/docs/guide/agent.md @@ -49,6 +49,59 @@ curl -L https://jihulab.com/nezha/nezha/-/raw/master/script/install.sh -o nezha. [哪吒探针 - Windows 客户端安装](https://nyko.me/2020/12/13/nezha-windows-client.html)
+### MacOS安装Agent +***本节内容改编自[Mitsea Blog](https://blog.mitsea.com/e796f93db38d49e4b18df234c6ee75f5),改编已获得原作者授权*** +
+ ++ 首先在管理面板中添加一台服务器 ++ 前往 [Release](https://github.com/naiba/nezha/releases) 页下载 Agent 二进制文件,根据 CPU 架构选择下载 darwin amd64 还是 arm64 的 Agent +如 Intel CPU 下载 amd64,Apple Silicon 下载 arm64 版本。下载完成后解压 Agent 二进制文件,如解压到下载文件夹 ++ 新建一个名为 `nezha_agent.plist` 的文件并保存,修改文件内容如下: +```xml + + + + + Disabled + + Label + nezha_agent + Program + 在这里修改 Agent 二进制文件的的路径,如:/Users/123/Downloads/nezha-agent + ProgramArguments + + 在这里修改 Agent 二进制文件的的路径,同上 + --password + 通信密钥,如:529664783eeb23cc25 + --server + 通信网址和RPC端口,如:data.example.com:5555 + + RunAtLoad + + + +``` ++ 在 Terminal 中使用下面的命令加载 plist 文件到 launchd 里,**注意替换文件路径** +```shell +launchctl load /Users/123/Desktop/nezha_agent.plist +``` ++ 启动进程 +```shell +launchctl start nezha_agent +``` ++ 检查进程是否运行 +```shell +launchctl list | grep nezha_agent +``` ++ 停止进程并移除 +```shell +launchctl stop nezha_agent +``` +```shell +launchctl remove nezha_agent +``` +
+ ### OpenWRT安装Agent **如何使 旧版OpenWRT/LEDE 自启动** From c6cb8873c38fc6df9cd4279f4ca3664b4f94bbd4 Mon Sep 17 00:00:00 2001 From: hhhkkk520 Date: Mon, 30 May 2022 18:25:23 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E8=8B=B1?= =?UTF-8?q?=E6=96=87Agent=E5=AE=89=E8=A3=85=E6=89=8B=E5=86=8C=E4=B8=AD?= =?UTF-8?q?=E6=96=B0=E5=A2=9EMacOS=E5=AE=89=E8=A3=85=E4=BB=8B=E7=BB=8D?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E4=B8=AD=E6=96=87Agent=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=89=8B=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en_US/guide/agent.md | 57 +++++++++++++++++++++++++++++++++++++++ docs/guide/agent.md | 21 +++++++++------ 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/docs/en_US/guide/agent.md b/docs/en_US/guide/agent.md index a8c4cc15..c03dd4e2 100644 --- a/docs/en_US/guide/agent.md +++ b/docs/en_US/guide/agent.md @@ -42,6 +42,63 @@ curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.s [哪吒探针 - Windows 客户端安装](https://nyko.me/2020/12/13/nezha-windows-client.html)(Chinese)
+### Installing Agent on MacOS +***This section is adapted from [Mitsea Blog](https://blog.mitsea.com/e796f93db38d49e4b18df234c6ee75f5), with permission from the original author*** +
+::: warning +If you are prompted with "macOS cannot verify this app" during installation, please go to system settings to allow the app to run. +::: + ++ First add a server in the admin panel ++ Go to the [Release](https://github.com/naiba/nezha/releases) page to download the Agent binary and choose whether to download the darwin amd64 or arm64 Agent depending on the CPU architecture +For example, download the amd64 version for Intel CPU and the arm64 version for Apple Silicon. After downloading, extract the Agent binary file, e.g. to the Download folder ++ Create a new file named `nezha_agent.plist` and save it, edit the contents of the file: +```xml + + + + + Disabled + + Label + nezha_agent + Program + Change the path of the Agent binary here, e.g. /Users/123/Downloads/nezha-agent + ProgramArguments + + Change the path of the Agent binary here, e.g. /Users/123/Downloads/nezha-agent + --password + Communication Secret, eg: 529664783eeb23cc25 + --server + Communication URL and RPC port, eg:data.example.com:5555 + + RunAtLoad + + + +``` ++ Use the following command in Terminal to load the plist file into launchd + **Be sure to change the file path** +```shell +launchctl load /Users/123/Desktop/nezha_agent.plist +``` ++ Start Service +```shell +launchctl start nezha_agent +``` ++ Check if the service is running +```shell +launchctl list | grep nezha_agent +``` ++ Stop service and remove +```shell +launchctl stop nezha_agent +``` +```shell +launchctl remove nezha_agent +``` +
+ ### Installing Agent on OpenWRT **How to make the old version of OpenWRT/LEDE self-boot?** diff --git a/docs/guide/agent.md b/docs/guide/agent.md index 84d86315..2afda9fa 100644 --- a/docs/guide/agent.md +++ b/docs/guide/agent.md @@ -9,13 +9,13 @@ 你需要提前在管理面板中设置好通信域名,此域名不可以接入CDN,这里以前面提到过的示例通信域名 “data.example.com” 来做演示 进入后台管理面板,转到“设置”页,在“未接入CDN的面板服务器域名/IP”项中填入通信域名,然后点击"保存"
-### Linux一键安装 +### 在 Linux 中一键安装 * 首先在管理面板中添加一台服务器 * 点击新添加的服务器旁,绿色的Linux图标按钮,复制一键安装命令 * 在被控端服务器中运行复制的一键安装命令,等待安装完成后返回到Dashboard主页查看服务器是否上线
-### Windows一键安装 +### 在 Windows 中一键安装 * 首先在管理面板中添加一台服务器 * 点击新添加的服务器旁,绿色的Windows图标按钮,复制一键安装命令 @@ -24,8 +24,10 @@ * 等待安装完成后返回Dashboard主页查看服务器是否上线

-## 其他方式安装Agent -### Linux安装Agent + +## 其他方式安装Agent + +### 在 Linux 中安装Agent * 首先在管理面板中添加一台服务器 * 在被控服务器中,运行脚本(位于中国大陆的服务器请使用镜像): @@ -43,16 +45,19 @@ curl -L https://jihulab.com/nezha/nezha/-/raw/master/script/install.sh -o nezha. * 等待安装完成后返回Dashboard主页查看服务器是否上线
-### Windows安装Agent +### 在 Windows 中安装Agent - 请参考社区文章: [哪吒探针 - Windows 客户端安装](https://nyko.me/2020/12/13/nezha-windows-client.html)
-### MacOS安装Agent +### 在 MacOS 中安装Agent ***本节内容改编自[Mitsea Blog](https://blog.mitsea.com/e796f93db38d49e4b18df234c6ee75f5),改编已获得原作者授权***
- +::: warning +安装过程中如提示“macOS无法验证此app“,请前往系统设置手动允许程序运行 +::: + + 首先在管理面板中添加一台服务器 + 前往 [Release](https://github.com/naiba/nezha/releases) 页下载 Agent 二进制文件,根据 CPU 架构选择下载 darwin amd64 还是 arm64 的 Agent 如 Intel CPU 下载 amd64,Apple Silicon 下载 arm64 版本。下载完成后解压 Agent 二进制文件,如解压到下载文件夹 @@ -102,7 +107,7 @@ launchctl remove nezha_agent ```
-### OpenWRT安装Agent +### 在 OpenWRT 中安装Agent **如何使 旧版OpenWRT/LEDE 自启动** - 请参考项目: