今天看到有人说哪吒面板这款探针,看了一下,感觉挺不错的
自己尝试部署了一下,哪吒面板,YES!
不过开发者的并没有写一个详细的部署教程,我这里就从头到尾说清楚一点吧
包括部署面板、添加服务器、配置SSL、套CDN
DEMO:https://tz.haoduck.com/
暂时有四个主题,如下面的图所示,我的探针用的是透明版的。

默认

透明版默认主题

CakeMine-Hotaru

Dark
开始
一·域名解析需要的操作
开始之前,请先确定你搭建探针的域名
强烈建议用两个(子)域名做解析
第一个是面板的域名,套CDN比较方便
第二个仅仅解析到面板服务器的域名,用于客户端连接服务端试用(这个可以没有,但是不建议,如果直接用IP的话,迁移面板后会非常麻烦!)
比如我的tz.surplus.top作为面板的域名,还有一个tzzzz.surplus.top是用来记录面板服务器的IP(其实不是这个域名,因为我写出来就暴露了我的IP了,所以就当它是吧)
暂且将两个域名都解析到部署面板服务器的IP,我之前改本地hosts部署没有成功
GitHub上需要的操作
创建一个OAuth Apps
先打开 https://github.com/settings/developers,然后点击New OAuth App

参考图片填写:

1 2
| http://你的域名:8008 http://你的域名:8008/oauth2/callback
|
然后点击 Register application
OAuth Apps的Client ID和Client secrets
看图操作

服务器上的操作
放行端口
请在 阿里云或者腾讯云和宝塔的防火墙放行 8008
5555
端口,这是默认的,如果你程序中改为其他的,防火墙放行相应的端口
面板配置
这里原作者提供了一键脚本
1
| curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh
|
1 2 3
| curl -L https://raw.sevencdn.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh CN=true ./nezha.sh
|

输入1
回车
然后输入前面记下来的OAuth Apps的Client ID
和Client secrets
了
接着按照提示输入

到这里面板服务算是完成了大部分了
可以访问http://域名:8008
查看,用你的GitHub账号验证登录
反代、SSL、CDN
宝塔设置方法:

然后修改配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| 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; }
|
然后就配置SSL,这里就不多说了
访问下 https://域名/
确保可以正常访问了,然后就回到Github的OAuth Apps设置
打开 https://github.com/settings/developers
Look at photo

改好之后就可以对8008
端口取消放行了
客户端(被监控机器)需要的操作
通过https://域名/login
登录后台


到需要被监控的机器执行脚本
1
| curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && ./nezha.sh
|
1 2 3
| curl -L https://raw.sevencdn.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh CN=true ./nezha.sh
|

输入8
回车
按照提示输入之前记下的密钥

“解析到面板所在IP的域名”就是指本文中第一步的”第二个域名”,也可以直接填IP(不建议)
如果没出错,到此就是完成了
有多台被监控机器时,按照此步骤在控制面板添加服务器,在被监控机执行脚本填写密钥。
新版本不需要输入ID了
美化&魔改主题(透明主题设置)
登录后台,转到设置,使用默认主题,在自定义代码
处填写
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
| <style>
@media only screen and (min-width: 1200px) { .ui.container { width: 80% !important; } }
@media only screen and (max-width: 767px) { .ui.card>.content>.header:not(.ui), .ui.cards>.card>.content>.header:not(.ui) { margin-top: 0.4em !important; } }
i.icon { color: #000; width: 1.2em !important; }
body { content: " " !important; background: fixed !important; z-index: -1 !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; background-position: top !important; background-repeat: no-repeat !important; background-size: cover !important; background-image: url(https://api.surplus.top/img) !important; font-family: Arial,Helvetica,sans-serif !important; }
.ui.large.menu { border: 0 !important; border-radius: 0px !important; background-color: rgba(255, 255, 255, 55%) !important; }
.ui.menu .active.item { background-color: transparent !important; }
.ui.dropdown .menu { border: 0 !important; border-radius: 0 !important; background-color: rgba(255, 255, 255, 80%) !important; }
.nezha-primary-btn { background-color: transparent !important; color: #000 !important; }
#app .ui.fluid.accordion { background-color: #fbfbfb26 !important; border-radius: 0.4rem !important; }
.ui.four.cards>.card { border-radius: 0.6rem !important; background-color: #fafafaa3 !important; }
.status.cards .wide.column { padding-top: 0 !important; padding-bottom: 0 !important; height: 3.3rem !important; }
.status.cards .three.wide.column { padding-right: 0rem !important; }
.status.cards .wide.column:nth-child(1) { margin-top: 2rem !important; }
.status.cards .wide.column:nth-child(2) { margin-top: 2rem !important; }
.status.cards .description { padding-bottom: 0 !important; }
.status.cards .flag { margin-right: 0.5rem !important; }
.status.cards .header > .info.icon { margin-right: 0 !important; }
.nezha-secondary-font { color: #21ba45 !important; }
.ui.progress { border-radius: 50rem !important; }
.ui.progress .bar { min-width: 1.8em !important; border-radius: 15px !important; line-height: 1.65em !important; }
.ui.fine.progress> .bar { background-color: #21ba45 !important; }
.ui.progress> .bar { background-color: #000 !important; }
.ui.progress.fine .bar { background-color: #21ba45 !important; }
.ui.progress.warning .bar { background-color: #ff9800 !important; }
.ui.progress.error .bar { background-color: #e41e10 !important; }
.ui.progress.offline .bar { background-color: #000 !important; }
.status.cards .outline.icon { margin-right: 1px !important; }
i.arrow.alternate.circle.down.outline.icon { color: #21ba45 !important; }
i.arrow.alternate.circle.up.outline.icon { color: red !important; }
.ui.right.center.popup { margin: -3px 0 0 0.914286em !important; -webkit-transform-origin: left 50% !important; transform-origin: left 50% !important; }
.ui.bottom.left.popup { margin-left: 1px !important; margin-top: 3px !important; }
.ui.top.left.popup { margin-left: 0 !important; margin-bottom: 10px !important; }
.ui.top.right.popup { margin-right: 0 !important; margin-bottom: 8px !important; }
.ui.left.center.popup { margin: -3px .91428571em 0 0 !important; -webkit-transform-origin: right 50% !important; transform-origin: right 50% !important; }
.ui.right.center.popup:before, .ui.left.center.popup:before { border: 0px solid #fafafaeb !important; background: #fafafaeb !important; }
.ui.top.popup:before { border-color: #fafafaeb transparent transparent !important; }
.ui.popup:before { border-color: #fafafaeb transparent transparent !important; }
.ui.bottom.left.popup:before { border-radius: 0 !important; border: 1px solid transparent !important; border-color: #fafafaeb transparent transparent !important; background: #fafafaeb !important; -webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important; box-shadow: 0px 0px 0 0 #fafafaeb !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
.ui.bottom.right.popup:before { border-radius: 0 !important; border: 1px solid transparent !important; border-color: #fafafaeb transparent transparent !important; background: #fafafaeb !important -webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important; box-shadow: 0px 0px 0 0 #fafafaeb !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
.ui.top.left.popup:before { border-radius: 0 !important; border: 1px solid transparent !important; border-color: #fafafaeb transparent transparent !important; background: #fafafaeb !important; -webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important; box-shadow: 0px 0px 0 0 #fafafaeb !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
.ui.top.right.popup:before { border-radius: 0 !important; border: 1px solid transparent !important; border-color: #fafafaeb transparent transparent !important; background: #fafafaeb !important; -webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important; box-shadow: 0px 0px 0 0 #fafafaeb !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
.ui.left.center.popup:before { border-radius: 0 !important; border: 1px solid transparent !important; border-color: #fafafaeb transparent transparent !important; background: #fafafaeb !important; -webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important; box-shadow: 0px 0px 0 0 #fafafaeb !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
.status.cards .ui.content.popup { min-width: 20rem !important; line-height: 2rem !important; border-radius: 5px !important; border: 1px solid transparent !important; background-color: #fafafaeb !important; font-family: Arial,Helvetica,sans-serif !important; }
.ui.content { margin: 0 !important; padding: 1em !important; }
.ui.table { background: RGB(225,225,225,0.6) !important; }
.ui.table thead th { background: transparent !important; }
.service-status .good { background-color: #21ba45 !important; }
.service-status .danger { background-color: red !important; }
.service-status .warning { background-color: orange !important; }
.ui.inverted.segment, .ui.primary.inverted.segment { color: #000 !important; font-weight: bold !important; background-color: #fafafaa3 !important; } </style>
<script> window.onload = function(){ var avatar=document.querySelector(".item img") var footer=document.querySelector("div.is-size-7") footer.innerHTML="天鸡不可泄露 and 我扒的CSS" footer.style.visibility="visible" avatar.src="https://ii.do/favicon.ico" avatar.style.visibility="visible" } </script>
|
已使用随机背景,若要切换请更改33
行的background-image: url(https://api.surplus.top/img) !important;
的https://api.surplus.top/img
更改为你喜欢的图片直链

如图所示
常见问题
国内服务器出现curl: (7) Failed to connect to raw.githubusercontent.com
运行脚本:
1
| echo 199.232.68.133 raw.githubusercontent.com >> /etc/hosts
|
修改服务器备注后变成”离线”久不恢复
在安装客户端(被监控)的服务器上执行systemctl restart nezha-agent
重启程序
启动nezha-agent还是一直显示离线
检查配置有没有写对cat /etc/systemd/system/nezha-agent.service | grep ExecStart
相关
项目地址:https://github.com/naiba/nezha
参考:https://haoduck.com/644.html
https://ii.do/43.html