Merge branch 'master' into master
This commit is contained in:
commit
50437b9ab2
14
README.md
14
README.md
@ -4,7 +4,7 @@
|
||||
<br>
|
||||
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
|
||||
<br><br>
|
||||
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.12.28&logo=github&style=for-the-badge"> <img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.8.3-brightgreen?style=for-the-badge&logo=linux">
|
||||
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.12.29&logo=github&style=for-the-badge"> <img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.8.3-brightgreen?style=for-the-badge&logo=linux">
|
||||
<br>
|
||||
<br>
|
||||
<p>:trollface: <b>哪吒监控</b> 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,计划任务和在线终端。</p>
|
||||
@ -38,6 +38,18 @@ CN=true sudo ./nezha.sh
|
||||
|
||||
_\* 使用 WatchTower 可以自动更新面板,Windows 终端可以使用 nssm 配置自启动(见尾部教程)_
|
||||
|
||||
|
||||
**Windows 一键安装 Agent (请使用 Powershell 管理员权限)**
|
||||
|
||||
```powershell
|
||||
set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/naiba/nezha/master/script/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 dashboard_host:grpc_port secret
|
||||
```
|
||||
|
||||
|
||||

|
||||
|
||||
*如遇此图请选择 Y*
|
||||
|
||||
### Agent 自定义
|
||||
|
||||
#### 自定义监控的网卡和硬盘分区
|
||||
|
@ -44,7 +44,9 @@
|
||||
data-tooltip="点击复制安装命令">
|
||||
<i class="linux icon"></i>
|
||||
</button>
|
||||
<button class="ui icon mini button" data-tooltip="尚未支持,请下载release手动安装">
|
||||
<button class="ui icon green mini button"
|
||||
data-clipboard-text="{{if $.Conf.GRPCHost}}set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/naiba/nezha/master/script/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 {{$.Conf.GRPCHost}}:{{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}请先在设置页面配置 未接入CDN的面板服务器域名/IP{{end}}"
|
||||
data-tooltip="点击复制安装命令">
|
||||
<i class="windows icon"></i>
|
||||
</button>
|
||||
<button class="ui icon mini button" data-tooltip="尚未支持,请下载release手动安装">
|
||||
@ -130,4 +132,4 @@
|
||||
})
|
||||
}
|
||||
</script>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
40
script/install.ps1
Normal file
40
script/install.ps1
Normal file
@ -0,0 +1,40 @@
|
||||
#Get server and key
|
||||
param($server, $key)
|
||||
# Download latest release from github
|
||||
$repo = "naiba/nezha"
|
||||
# x86 or x64
|
||||
if ([System.Environment]::Is64BitOperatingSystem) {
|
||||
$file = "nezha-agent_windows_amd64.zip"
|
||||
}
|
||||
else {
|
||||
$file = "nezha-agent_windows_386.zip"
|
||||
}
|
||||
$releases = "https://api.github.com/repos/$repo/releases"
|
||||
Write-Host "Determining latest nezha release" -BackgroundColor DarkGreen -ForegroundColor White
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name
|
||||
$download = "https://github.com/$repo/releases/download/$tag/$file"
|
||||
Invoke-WebRequest $download -OutFile "C:\nezha.zip"
|
||||
#使用nssm安装服务
|
||||
Invoke-WebRequest "http://nssm.cc/release/nssm-2.24.zip" -OutFile "C:\nssm.zip"
|
||||
#解压
|
||||
Expand-Archive "C:\nezha.zip" -DestinationPath "C:\temp" -Force
|
||||
Expand-Archive "C:\nssm.zip" -DestinationPath "C:\temp" -Force
|
||||
if (!(Test-Path "C:\nezha")) { New-Item -Path "C:\nezha" -type directory }
|
||||
#整理文件
|
||||
Move-Item -Path "C:\temp\nezha-agent.exe" -Destination "C:\nezha\nezha.exe"
|
||||
if ($file = "nezha-agent_windows_amd64.zip") {
|
||||
Move-Item -Path "C:\temp\nssm-2.24\win64\nssm.exe" -Destination "C:\nezha\nssm.exe"
|
||||
}
|
||||
else {
|
||||
Move-Item -Path "C:\temp\nssm-2.24\win32\nssm.exe" -Destination "C:\nezha\nssm.exe"
|
||||
}
|
||||
#清理垃圾
|
||||
Remove-Item "C:\nezha.zip"
|
||||
Remove-Item "C:\nssm.zip"
|
||||
Remove-Item "C:\temp" -Recurse
|
||||
#安装部分
|
||||
C:\nezha\nssm.exe install nezha C:\nezha\nezha.exe -s $server -p $key -d
|
||||
C:\nezha\nssm.exe start nezha
|
||||
#enjoy
|
||||
Write-Host "Enjoy It!" -BackgroundColor DarkGreen -ForegroundColor Red
|
@ -125,7 +125,7 @@ before_show_menu() {
|
||||
|
||||
install_base() {
|
||||
(command -v git >/dev/null 2>&1 && command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v tar >/dev/null 2>&1) ||
|
||||
(install_soft curl wget git tar)
|
||||
(install_soft curl wget git unzip)
|
||||
}
|
||||
|
||||
install_soft() {
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/naiba/nezha/pkg/utils"
|
||||
)
|
||||
|
||||
var Version = "v0.12.28" // !!记得修改 README 中的 badge 版本!!
|
||||
var Version = "v0.12.29" // !!记得修改 README 中的 badge 版本!!
|
||||
|
||||
var (
|
||||
Conf *model.Config
|
||||
|
Loading…
x
Reference in New Issue
Block a user