哪吒面板作者倉庫
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
創(chuàng)建一個OAuth Apps,
打開:
https://github.com/settings/developers?然后點擊New OAuth App按鈕,填入你第一個域名
https://你的域名
https://你的域名/oauth2/callback
輸入完成后,能看到OAuth Apps的Client ID和Client secrets兩個數(shù)值,(其中Client secrets需要自己創(chuàng)建一下)保存下來。
4、部署面板
國外機
curl -L?https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh?-o nezha.sh && chmod +x nezha.sh && ./nezha.sh
國內(nèi)機
curl -L?https://raw.sevencdn.com/naiba/nezha/master/script/install.sh?-o nezha.sh && chmod +x nezha.sh && ./nezha.sh
選擇1開始安裝面板
所涉及到的數(shù)值,前面都有提到。
進入服務器寶塔后臺,創(chuàng)建一個站點,用你帶套的那個域名。
然后網(wǎng)站設置,添加反向代理
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
國內(nèi)機
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 ,創(chuàng)建新的機器人(bot)時,會提供的 token(在提示 Use this token to access the HTTP API:后面一行)這里 'bot' 三個字母不可少;然后獲取自己TG的數(shù)字Id, 和這個機器人 @userinfobot 對話可獲得一串數(shù)字;這兩個保存下來,一會備用。
進入面板機后臺,報警——先添加通知方式,格式為
https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA#
其中bot后面的XXX為機器人的token,chat_id為你自己TG的ID。
然后添加報警規(guī)則,常用的離線規(guī)則為
[{"Type":"offline","Duration":30}]文章來源:http://www.zghlxwxcb.cn/news/detail-842954.html
設置后記得設為啟動就行。更多類似于監(jiān)控cpu、內(nèi)存報警等等,就查看作者倉庫吧~文章來源地址http://www.zghlxwxcb.cn/news/detail-842954.html
到了這里,關于哪吒面板VPS探針搭建教程,便攜服務器狀態(tài)監(jiān)控的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!