默认安装指令:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/nezhahq/scripts/main/extras/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 x.x.x.x:5555 1145141919810
替换字段如下:
海外服务器将 https://raw.githubusercontent.com/nezhahq/scripts/main/extras/install.ps1 替换为
https://huan-starvm.github.io/app/nezha-v0/install.ps1
国内服务器将 https://raw.githubusercontent.com/nezhahq/scripts/main/extras/install.ps1 替换为
https://gitee.com/starvm/storage/raw/master/app/nezha-v0/install.ps1
默认下的agent是0.20.5
可以自行下了后替换里面的download字段去更改agent版本
agent版本合集:https://github.com/nezhahq/agent/releases
Usage:
nezha-agent service <install/uninstall/start/stop/restart> [flags]
------------------------------------------------------------------
Windows端agent安装配置
1.环境准备
环境: Windows 服务器
软件:
点击下载(探针agent和nssm都要下载准备好)
2.设置NSSM
以管理员身份运行 cmd(记住要是管理员,不然权限不够)
输入:nssm install <名字随便取,默认nezha>
nssm install nezha
弹出 UI,设置如下:
启动参数格式为:-s {Serverip}:{Port} -p {AgentKey} -d
注意:没有这个花括号{}。上面agent和nssm路径不要弄反。
例如:-s fccp.in:5555 -p KG9Hy202506052ZTT -d
自己对应修改,填写完毕后, 点击 install servce。记得nssm start nezha 启动。就可以在前端看到上线啦。
参数项来源:
一般NSSM命令:
- 安装服务命令
nssm install
nssm install
nssm install[ ] - 删除服务
nssm remove
nssm remove
nssm removeconfirm - 启动、停止服务
nssm start
nssm stop
nssm restart - 查询服务状态
nssm status - 服务控制命令
nssm pause
nssm continue
nssm rotate
备注:如果机器中装有360,记得在360-系统修复-信任区,添加信任文件,以免进程被误杀!
评论 (0)