监控服务器状态,夜莺( nightingale)方案介绍
创始人
2024-09-26 04:53:07
0

前提

选择一台服务器,部署一个监控服务端,然后在各个windows或者linux中部署数据采集节点。

类似如下结构

在这里插入图片描述

目前我这边采用的技术是

https://flashcat.cloud/product/nightingale/

Nightingale 的解决方案

1 部署内容

服务端(服务端为 centos7 为例子)需要部署的清单:
prometheus(新版本不需要了)
mysql
redis
n9e

客户端需要部署的清单:
linux版本categraf
windwos版本categraf

2 开始进行部署

本次演示的采用 CentOS7 操作系统,其中 mysql redis 可以复用已经安装好的

2.1 部署prometheus(新版本不需要了)

下载安装包:
https://github.com/prometheus/prometheus/releases/download/v2.28.0/prometheus-2.28.0.linux-amd64.tar.gz

选择一台服务器
上传安装包
prometheus-2.28.0.linux-amd64.tar.gz

执行以下命令

mkdir -p /opt/prometheus tar xf prometheus-2.28.0.linux-amd64.tar.gz cp -far prometheus-2.28.0.linux-amd64/*  /opt/prometheus/ 

执行安装文件

# install prometheus mkdir -p /opt/prometheus wget https://s3-gz01.didistatic.com/n9e-pub/prome/prometheus-2.28.0.linux-amd64.tar.gz -O prometheus-2.28.0.linux-amd64.tar.gz tar xf prometheus-2.28.0.linux-amd64.tar.gz cp -far prometheus-2.28.0.linux-amd64/*  /opt/prometheus/  # service  cat </etc/systemd/system/prometheus.service [Unit] Description="prometheus" Documentation=https://prometheus.io/ After=network.target  [Service] Type=simple  ExecStart=/opt/prometheus/prometheus  --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m   Restart=on-failure SuccessExitStatus=0 LimitNOFILE=65536 StandardOutput=syslog StandardError=syslog SyslogIdentifier=prometheus   [Install] WantedBy=multi-user.target EOF  systemctl daemon-reload systemctl enable prometheus systemctl restart prometheus systemctl status prometheus 

Prometheus访问端口为:9090

2.2 部署mysql

可复用现有的,或参考博主文档

2.3 部署redis

可复用现有的,或参考博主文档

2.4 部署n9e并导入n9e数据库

cd /opt wget https://github.com/ccfos/nightingale/releases/download/v7.0.0/n9e-v7.0.0-linux-amd64.tar.gz  mkdir -p /opt/n9e tar -C /opt/n9e -xzf n9e-v7.0.0-linux-amd64.tar.gz 

配置mysql和redis的路径

cd /opt/n9e/etc vi config.toml 

创建n9e_v6数据库
将n9e.sql导入 n9e_v6数据库中

cd /opt/n9e nohup ./n9e &> n9e.log & # 注意,如果有异常,请查看 n9e.log 文件 

访问端口 17000

IP:17000 账号 root 密码 root.2020

在这里插入图片描述

4、监控linux服务器

下载并解压文件

cd /opt/softwarePackage wget https://github.com/flashcatcloud/categraf/releases/download/v0.3.76/categraf-v0.3.76-linux-amd64.tar.gz tar -C /opt/categraf -xzf categraf-v0.3.76-linux-amd64.tar.gz 
cd /opt/categraf/conf vi config.toml # 编辑配置文件 

启动

nohup ./categraf &> stdout.log & 

4.1 在管控台修改标签

查看上报过来的监控对象
在这里插入图片描述

因为目前是采用服务器hostname进行标识的,有时候不好分辨,所以需要打备注一下

5、监控windowd服务器

wget https://github.com/flashcatcloud/categraf/releases/download/v0.3.76/categraf-v0.3.76-windows-amd64.zip unzip categraf-v0.3.76-windows-amd64.zip 

修改配置文件

conf/config.toml

启动
categraf.exe

6、导入监控大盘

在这里插入图片描述
在这里插入图片描述

7、配置报警

以邮箱告警为例子

先配置邮件地址

在这里插入图片描述
在这里插入图片描述

配置告警规则

在这里插入图片描述
当服务器失联的时候,会进行告警并发送邮件

在这里插入图片描述

相关内容

热门资讯

推荐十款!hhpoker真的假... 推荐十款!hhpoker真的假的,wePOker其实真实是有挂,玩家教你(有挂实测)-哔哩哔哩;是一...
三分钟工具!wpk输赢机制,w... 三分钟工具!wpk输赢机制,wepoker私人局规律,2024新版教程(有挂透明挂)-哔哩哔哩,we...
如何分辨真伪!经典联盟牛牛有外... 如何分辨真伪!经典联盟牛牛有外挂,川麻圈跑得快原来是有挂猫腻,必备教程(有挂讲解)-哔哩哔哩;1、不...
一起来讨论(aapoker下载... 一起来讨论(aapoker下载)外挂透明挂辅助挂(透视辅助)软件透明挂(有挂科普)-哔哩哔哩;超受欢...
每日必看!poker辅助器免费... 每日必看!poker辅助器免费安装,wepOKEr原来果真是有挂,总结教程(有挂动态)-哔哩哔哩;1...
9分钟了解(德扑胜率)外挂透明... 9分钟了解(德扑胜率)外挂透明挂辅助工具(辅助透视)软件透明挂(有挂经验)-哔哩哔哩;相信小伙伴都知...
5分钟技术!governoro... 5分钟技术!governorofpoker3辅助,wepoker有辅助功能,AI教程(有挂网页版)-...
3分钟透明挂!wepoke辅助... 《wpk线上德州俱乐部软件透明挂》是一款多人竞技的wpk线上德州俱乐部辅助透视游戏,你将微扑克对手来...
必备科技!江西中至游戏辅助,中... 必备科技!江西中至游戏辅助,中至打炸原来是有挂猫腻,安装教程(有挂技巧)-哔哩哔哩;一、江西中至游戏...
新手必备(wepoke真的有挂... 新手必备(wepoke真的有挂)外挂透明挂辅助神器(辅助透视)软件透明挂(有挂来袭)-哔哩哔哩是一款...