哪吒监控面板VPS探针搭建教程_便携服务器状态监控

哪吒监控面板VPS探针搭建教程_便携服务器状态监控

哪吒面板作者仓库
https://github.com/naiba/nezha

准备工作
准备一个域名
注册一个github的账户
准备一条vps作为面板机器,并搭建好宝塔面板。

1、安装宝塔
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh

2解析域名,例如 vps.domain.com 和 88.domain.com 都A指向到面板IP

3 注册github

创建一个OAuth Apps,
打开:
https://github.com/settings/developers 然后点击New OAuth App按钮,填入你第一个域名

https://你的域名
https://你的域名/oauth2/callback
输入完成后,能看到OAuth Apps的Client ID和Client secrets两个数值,(其中Client secrets需要自己创建一下)保存下来。

4、部署面板
国外机

curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh

国内机

curl -L https://raw.sevencdn.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh
选择1开始安装面板
所涉及到的数值,前面都有提到。

进入服务器宝塔后台,创建一个站点,用你带套的那个域名。
然后网站设置,添加反向代理

location /
{
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $host;
}

location /ws
{
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}

location /terminal
{
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}

4.申请ssl,可以跳过
这个比较简单,直接在宝塔上完成就行。

5.被控机的安装
登陆面板机后台,添加一个主机,会生成秘钥,然后在被控机上输入代码(其实和安装主控的代码是一样的)
国外机

curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh
国内机

curl -L https://raw.sevencdn.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh
选择8,然后第一个输入你刚才不带套的那个域名,端口默认,秘钥就是刚才添加主机时的那个秘钥。

6.TG机器人设置
先申请一个机器人 @Botfather ,然后/newbot ,创建新的机器人(bot)时,会提供的 token(在提示 Use this token to access the HTTP API:后面一行)这里 ‘bot’ 三个字母不可少;然后获取自己TG的数字Id, 和这个机器人 @userinfobot 对话可获得一串数字;这两个保存下来,一会备用。

进入面板机后台,报警——先添加通知方式,格式为

https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA#
其中bot后面的XXX为机器人的token,chat_id为你自己TG的ID。

然后添加报警规则,常用的离线规则为

[{“Type”:”offline”,”Duration”:30}]

设置后记得设为启动就行。更多类似于监控cpu、内存报警等等,就查看作者仓库吧~

教程来源于梅塔沃克:https://iweec.com

视频教程:https://www.bilibili.com/video/BV1HY411J7YB/?share_source=copy_web&vd_source=848a1c5b498da833bb32415b446b2de4

编辑:二八源码,如若转载,请注明来源出处:https://www.28286.cn/website/2745.html

文章来源网络及投稿,仅供研究学习!如商用自行联系版权方!如发现侵犯了您的权益请与我们联系删除!
(0)
二八源码的头像二八源码
上一篇 2026年 5月 20日
下一篇 2024年 1月 23日

发表回复

登录后才能评论