哪吒监控部署记录

行云流水
2022-12-02 / 2 评论 / 1,580 阅读 / 正在检测是否收录...

前言

哪吒监控 一个开源、轻量的服务器和网站监控、运维工具。本文记录部署过程。

单点登录

github

配置地址: https://github.com/settings/developers

JihuLab

配置地址: https://jihulab.com/-/profile/applications

服务端安装

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

# 国内
curl -L https://jihulab.com/nezha/nezha/-/raw/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true ./nezha.sh

服务端配置

配置接收数据地址

添加主机

nginx反向代理

server {
    listen 443 ssl http2;
    server_name mon.itbunan.xyz;
    server_tokens off;
    ssl_certificate /etc/nginx/cert/mon.itbunan.xyz_bundle.crt;
    ssl_certificate_key /etc/nginx/cert/mon.itbunan.xyz.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

    location /ws {
        proxy_redirect off;
        proxy_pass http://172.17.0.10:8008;
        proxy_set_header Host $host;
        proxy_set_header X-Real_IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
    }

    location /terminal {
        proxy_redirect off;
        proxy_pass http://172.17.0.10:8008;
        proxy_set_header Host $host;
        proxy_set_header X-Real_IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
    }

客户端安装

主流系统自动安装

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

# 国内
curl -L https://jihulab.com/nezha/nezha/-/raw/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true ./nezha.sh

debain手动安装

## 安装依赖命令
apt install -y  wget  unzip curl

## 执行安装脚本
./agent_install.sh

## 启动
/opt/nezha/nezha-agent -s ip:5555  -p 密钥

访问

http://ip:8090

评论 (2)

取消
只有登录/注册用户才可评论
  1. 头像
    565
    中国安徽省 · Windows 10 · Google Chrome
    沙发

    支持博主,一定多分享

    回复
  2. 头像
    4rew6
    中国福建省 · Windows 10 · Google Chrome
    板凳

    终于找到这篇文章了,感谢作者的分享!

    回复