改进 macOS 上 Homebrew 服务安装方式,增加了简单的自查 bug 方式和 Homebrew 脚本报错反馈途径 (#69)
This commit is contained in:
parent
29fe30eef8
commit
b38e3197fc
@ -247,19 +247,11 @@ Using Homebrew to install the Agent on macOS
|
||||
|
||||
The content of this section is adapted from [🐿️松鼠收集🌰](https://blog.mre.red/archives/install_nezha_monitoring_agent_service_with_homebrew), with the permission of the original author.
|
||||
|
||||
* Adding the Homebrew third-party repository
|
||||
::: danger
|
||||
Please ensure to set environment variables first, and then proceed with the installation of Nezha-agent using Homebrew!
|
||||
|
||||
As the package has not yet been submitted to the official Homebrew Core repository, it is currently available in the third-party Homebrew repository maintained by the author of the blog mentioned above.
|
||||
|
||||
```sh
|
||||
brew tap brewforge/chinese
|
||||
```
|
||||
|
||||
* Installing the Nezha Agent
|
||||
|
||||
```sh
|
||||
brew install nezha-agent
|
||||
```
|
||||
Due to the creation of service configuration files (PLIST) by Homebrew during software installation, if you install first and then add environment variables, it will fail to start due to missing parameters!
|
||||
:::
|
||||
|
||||
* Adding environment variables
|
||||
|
||||
@ -269,6 +261,14 @@ echo 'export HOMEBREW_NEZHA_AGENT_SERVER="your server and port, in the format yo
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
* Installing the Nezha Agent
|
||||
|
||||
As the package has not yet been submitted to the official Homebrew Core repository, it is currently available in the [third-party Homebrew repository](https://github.com/Brewforge/homebrew-chinese) maintained by the author of the blog mentioned above.
|
||||
|
||||
```sh
|
||||
brew install brewforge/chinese/nezha-agent
|
||||
```
|
||||
|
||||
* Starting the Nezha Agent service through Homebrew
|
||||
|
||||
```sh
|
||||
@ -293,6 +293,23 @@ brew services stop nezha-agent
|
||||
brew rm nezha-agent
|
||||
```
|
||||
|
||||
* Error handling first check environment variables
|
||||
|
||||
```sh
|
||||
echo $HOMEBREW_NEZHA_AGENT_PASSWORD
|
||||
echo $HOMEBREW_NEZHA_AGENT_SERVER
|
||||
```
|
||||
|
||||
* If the environment variable configuration is correct, attempt reinstallation
|
||||
|
||||
```sh
|
||||
brew services stop nezha-agent
|
||||
brew reinstall nezha-agent
|
||||
brew services start nezha-agent
|
||||
```
|
||||
|
||||
* If the issue persists, please proceed to the [third-party Homebrew repository](https://github.com/Brewforge/homebrew-chinese) and submit a ticket
|
||||
|
||||
<br/>
|
||||
|
||||
### Installing Agent on OpenWRT
|
||||
|
@ -294,23 +294,10 @@ launchctl remove nezha_agent
|
||||
|
||||
***本节内容改编自 [🐿️松鼠收集🌰](https://blog.mre.red/archives/install_nezha_monitoring_agent_service_with_homebrew),改编已获得原作者授权***
|
||||
|
||||
* 添加 Homebrew 第三方仓库
|
||||
::: danger
|
||||
请注意,此 Homebrew 仓库由第三方维护,与哪吒监控无关。
|
||||
Nezha 项目组不对该仓库的可用性和安全性等方面作出背书。在使用前,请自行评估风险!!
|
||||
请务必先添加环境变量,再通过 Homebrew 安装 nezha-agent !
|
||||
因 Homebrew 在软件安装时创建服务所需 plist 文件,若先安装再添加环境变量,会因缺少参数而启动失败!
|
||||
:::
|
||||
*由于暂未提交到 Homebrew Core 官方库,暂时放在上述博客作者参与维护的第三方 Homebrew 仓库中*
|
||||
|
||||
|
||||
```sh
|
||||
brew tap brewforge/chinese
|
||||
```
|
||||
|
||||
* 安装 Nezha Agent
|
||||
|
||||
```sh
|
||||
brew install nezha-agent
|
||||
```
|
||||
|
||||
* 添加环境变量
|
||||
|
||||
@ -320,6 +307,19 @@ echo 'export HOMEBREW_NEZHA_AGENT_SERVER="你的服务器和端口,格式 your
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
* 安装 Nezha Agent
|
||||
|
||||
::: danger
|
||||
请注意,此 Homebrew 仓库由第三方维护,与哪吒监控无关。
|
||||
Nezha 项目组不对该仓库的可用性和安全性等方面作出背书。在使用前,请自行评估风险!!
|
||||
:::
|
||||
|
||||
*由于暂未提交到 Homebrew Core 官方库,暂时放在上述博客作者参与维护的 [第三方 Homebrew 仓库](https://github.com/Brewforge/homebrew-chinese) 中*
|
||||
|
||||
```sh
|
||||
brew install brewforge/chinese/nezha-agent
|
||||
```
|
||||
|
||||
* 通过 Homebrew 启动 Nezha Agent 服务
|
||||
|
||||
```sh
|
||||
@ -343,6 +343,24 @@ brew services stop nezha-agent
|
||||
```sh
|
||||
brew rm nezha-agent
|
||||
```
|
||||
|
||||
* 报错时先检查环境变量
|
||||
|
||||
```sh
|
||||
echo $HOMEBREW_NEZHA_AGENT_PASSWORD
|
||||
echo $HOMEBREW_NEZHA_AGENT_SERVER
|
||||
```
|
||||
|
||||
* 若环境变量配置正确,再尝试重装
|
||||
|
||||
```sh
|
||||
brew services stop nezha-agent
|
||||
brew reinstall nezha-agent
|
||||
brew services start nezha-agent
|
||||
```
|
||||
|
||||
* 若仍未解决,请前往上述 [第三方 Homebrew 仓库](https://github.com/Brewforge/homebrew-chinese) 提交工单
|
||||
|
||||
</details>
|
||||
<br/>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user