概述

  • 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP、TCP、Ping 监控报警,计划任务和在线终端。

安装准备

test.baidu.com嵌套CDN


testceshi.baidu.com不嵌套CDN

  • 安装bt面板只需要安装nginx服务器做反代

预览

  • 这款探针我17号就安装过了,为了今天给大家带来更加详细的图文教程,我重新重置系统给大家来讲解一下!
  • 预览地址:GOJOGO - TZ

安装过程

哪吒一站式轻监控轻运维系统

哪吒一站式轻监控轻运维系统

  • 可参考我的设置,我的设置是域名有SSL证书,如果你的没有申请可先设置为http,申请下来再设置https。
  • http://你的域名:8008
  • http://你的域名:8008/oauth2/callback

哪吒一站式轻监控轻运维系统

  • 获取OAuth Apps的Client ID和Client secrets
  • 创建好OAuth Apps后复制ID以及key

哪吒一站式轻监控轻运维系统

  • 防火墙放行8008、5555端口

由于我的是Centos 8.2 所以需要安装curl

sudo dnf install curl

检查

curl

安装面板

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
CN=true ./nezha.sh

哪吒一站式轻监控轻运维系统

  • 输入1回车
  • 接着就要输入前面记录下来的GitHub账号ID、OAuth Apps的Client ID、OAuth Apps的Client secrets了
  • 按照提示输入

哪吒一站式轻监控轻运维系统

  • 到这里已经完成90%的步骤了
  • 可以访问http://域名:8008查看,用你的GitHub账号验证登录。

设置反代

#PROXY-START/
location /
{
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $host;
}
location /ws
{
proxy_pass http://你的服务器IP:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}

哪吒一站式轻监控轻运维系统

哪吒一站式轻监控轻运维系统

更新信息

哪吒一站式轻监控轻运维系统

到需要被监控的机器执行脚本

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
CN=true ./nezha.sh

哪吒一站式轻监控轻运维系统

  • 输入8回车
  • 接着就要输入前面记录下来的ID、密钥了
  • 按照提示输入

哪吒一站式轻监控轻运维系统

  • 解析到面板所在IP的域名 就是我前面所介绍需要用到的域名
  • 到这里就已经完成全部了

美化CSS

<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://gitee.com/darki/img/raw/master/1631081013043.webp) !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>

<!--Logo和版权-->
<script>
window.onload = function(){
var avatar=document.querySelector(".item img")
var footer=document.querySelector("div.is-size-7")
footer.innerHTML="GOJOGO - 监控"
footer.style.visibility="visible"
avatar.src="https://www.gojogo.cn/favicon.ico"
avatar.style.visibility="visible"
}
</script>

常见问题

  • 国内服务器出现curl: (7) Failed to connect to raw.githubusercontent.com
    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