Skip to main content

moregeek program

夜莺5.8正式版单机版安装和使用-多极客编程

环境版本

  • centos7
  • mysql5.7
  • redis5
  • prometheus-2.36.1
  • n9e-5.8.0
  • telegraf-1.22.4

单机版对于很多中小公司足够用了,简单高效、快速直接,建议使用云主机,性能不够了直接升配,可以应对每秒上报的数据点小于100万的情形,如果只是监控机器(每台机器每个周期大概采集200个数据点)采集周期频率设置10秒的话,支撑上限是5万台。

  • 系统架构图

夜莺5.8正式版单机版安装和使用_sed

安装n9e

1.开始安装

mkdir -p /data/soft/n9e
cd /data/soft/n9e
wget https://github.com/ccfos/nightingale/releases/download/v5.8.0/n9e-5.8.0.tar.gz
tar xf n9e-5.8.0.tar.gz
mysql -uroot -p123456 < docker/initsql/a-n9e.sql

2.配置

sed -i "s#1234#123456#g" etc/server.conf 
sed -i "s#1234#123456#g" etc/webapi.conf
## 生成32位随机数
## cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1
## xgBiP5fwu63QXCqAY9tmxwQ5HNXhLo0N
## cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1
## zMEgjbh4zYrUniQNDOHKdARghuqqkBxl

sed -i '/^SigningKey/c SigningKey = "xgBiP5fwu63QXCqAY9tmxwQ5HNXhLo0N"' etc/webapi.conf
sed -i '/^user001/c user001 = "zMEgjbh4zYrUniQNDOHKdARghuqqkBxl"' etc/webapi.conf

3.配置启动

sed -i "s#/root/gopath/src/n9e/n9e#/data/soft/n9e/n9e#g" etc/service/n9e-server.service 
sed -i "s#/root/gopath/src/n9e#/data/soft/n9e#g" etc/service/n9e-server.service
sed -i "s#/root/gopath/src/n9e/n9e#/data/soft/n9e/n9e#g" etc/service/n9e-webapi.service
sed -i "s#/root/gopath/src/n9e#/data/soft/n9e#g" etc/service/n9e-webapi.service
cp etc/service/n9e-server.service /etc/systemd/system/
cp etc/service/n9e-webapi.service /etc/systemd/system/

systemctl daemon-reload
systemctl enable n9e-server
systemctl restart n9e-server
systemctl status n9e-server

systemctl enable n9e-webapi
systemctl restart n9e-webapi
systemctl status n9e-webapi

server默认会监听在19000端口,webapi会监听在18000端口

4.登录

http://ip:18000默认账号root 密码root.2020

telegraf采集端

1.linux基础模块(centos7安装)

mkdir -p /opt/telegraf
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.4_linux_amd64.tar.gz
tar xf telegraf-1.22.4_linux_amd64.tar.gz
cp telegraf-1.22.4/usr/bin/telegraf /opt/telegraf/

cat > /opt/telegraf/telegraf.conf <<EOF
[global_tags]
platform = "39wang"

[agent]
## 默认数据收集间隔10s一次
interval = "60s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
## 默认主机名
hostname = ""
omit_hostname = false

[[outputs.opentsdb]]
host = "http://192.168.31.167"
port = 19000
http_batch_size = 50
http_path = "/opentsdb/put"
debug = false
separator = "_"

[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = true

[[inputs.disk]]
mount_points = ["/","/data1","/data2"]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
[[inputs.diskio]]
devices = ["sda", "sdb", "vd*"]
[[inputs.kernel]]

[[inputs.mem]]
fieldpass = ["*available", "*total","*percent","*used"]

[[inputs.swap]]
fieldpass = ["*used","*total", "*percent"]

[[inputs.processes]]

[[inputs.system]]
fielddrop = ["uptime_format"]

[[inputs.net]]
interfaces = ["eth0"]
ignore_protocol_stats = true
[[inputs.netstat]]
EOF

cat > /etc/systemd/system/telegraf.service <<EOF
[Unit]
Descriptinotallow="telegraf"
After=network.target

[Service]
Type=simple

ExecStart=/opt/telegraf/telegraf --config telegraf.conf
WorkingDirectory=/opt/telegraf

Restart=on-failure
SuccessExitStatus=0
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=telegraf

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable telegraf
systemctl restart telegraf
systemctl status telegraf

2.linux基础模块(centos6安装)

https://dl.influxdata.com/telegraf/releases/telegraf-1.22.4-1.x86_64.rpm
yum install telegraf-1.22.4-1.x86_64.rpm -y

cat > /etc/telegraf/telegraf.conf<<EOF
[global_tags]
platform = "39wang"

[agent]
## 默认数据收集间隔10s一次
interval = "60s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
## 默认主机名
hostname = ""
omit_hostname = false

[[outputs.opentsdb]]
host = "http://192.168.31.167"
port = 19000
http_batch_size = 50
http_path = "/opentsdb/put"
debug = false
separator = "_"

[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = true

[[inputs.disk]]
mount_points = ["/","/data1","/data2"]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

[[inputs.diskio]]
devices = ["sda", "sdb", "vd*"]

[[inputs.kernel]]

[[inputs.mem]]
fieldpass = ["*available", "*total","*percent","*used"]

[[inputs.swap]]
fieldpass = ["*used","*total", "*percent"]

[[inputs.processes]]

[[inputs.system]]
fielddrop = ["uptime_format"]

[[inputs.net]]
interfaces = ["eth0"]
ignore_protocol_stats = true
[[inputs.netstat]]
EOF
/etc/init.d/telegraf restart

大盘监控模板

  • Linux基础监控大盘模板

{
"name": "Linux基础监控大盘模板-平台版",
"tags": "",
"configs": {
"var": [
{
"name": "platform",
"selected": "39wang",
"definition": "web",
"options": [
"39wang"
],
"multi": false
}
],
"version": "2.0.0",
"panels": [
{
"id": "cbe1edf4-aa58-4473-b889-b575486d7bdd",
"type": "row",
"name": "cpu",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 0,
"i": "cbe1edf4-aa58-4473-b889-b575486d7bdd",
"isResizable": false
},
"collapsed": false,
"panels": [
{
"targets": [
{
"refId": "A",
"expr": "cpu_usage_active{cpu='cpu-total',platform=\"$platform\"}"
}
],
"name": "cpu使用率",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 80
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 24,
"x": 0,
"y": 1,
"i": "7e81f68b-6b21-4b0a-accf-873d9701947f",
"isResizable": true
},
"id": "7e81f68b-6b21-4b0a-accf-873d9701947f"
}
]
},
{
"id": "2a6e29a8-c799-4ae9-ad74-e6c15a5ec749",
"type": "row",
"name": "内存",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 1,
"i": "2a6e29a8-c799-4ae9-ad74-e6c15a5ec749",
"isResizable": false
},
"collapsed": false,
"panels": [
{
"targets": [
{
"refId": "A",
"expr": "(mem_total{platform=\"$platform\"} - mem_available{platform=\"$platform\"})/mem_total{platform=\"$platform\"} * 100"
}
],
"name": "内存使用率",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 88
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 0,
"y": 9,
"i": "ee085a33-8b84-48fa-929b-90fc26e651c3",
"isResizable": true
},
"id": "ee085a33-8b84-48fa-929b-90fc26e651c3"
},
{
"version": "2.0.0",
"name": "内存剩余大小",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 8,
"y": 9,
"i": "0f0123ae-3f9f-4e27-a4fe-a313b32ed7e4",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "mem_available{platform=\"$platform\"}"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "0f0123ae-3f9f-4e27-a4fe-a313b32ed7e4"
},
{
"version": "2.0.0",
"name": "内存总大小",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 16,
"y": 9,
"i": "0833bac0-8bb1-4e08-832b-3da6f098be63",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "mem_total{platform=\"$platform\"}"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "0833bac0-8bb1-4e08-832b-3da6f098be63"
}
]
},
{
"id": "9c590ce2-ddd1-4d7e-9d09-22df781bc8e2",
"type": "row",
"name": "磁盘",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 2,
"i": "9c590ce2-ddd1-4d7e-9d09-22df781bc8e2",
"isResizable": false
},
"collapsed": false,
"panels": [
{
"targets": [
{
"refId": "A",
"expr": "disk_used_percent{path='/',platform=\"$platform\"}"
},
{
"refId": "B",
"expr": "disk_used_percent{path='/data1',platform=\"$platform\"}"
},
{
"refId": "C",
"expr": "disk_used_percent{path='/data2',platform=\"$platform\"}"
}
],
"name": "磁盘使用率(%)",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 70
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 0,
"y": 3,
"i": "b3b7373b-b54e-47c5-a3a4-dc07024ab628",
"isResizable": true
},
"id": "b3b7373b-b54e-47c5-a3a4-dc07024ab628"
},
{
"version": "2.0.0",
"name": "磁盘剩余大小",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 8,
"y": 3,
"i": "df88a1d6-12ed-4384-b429-cdea49f2d64a",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "disk_free{path='/',platform=\"$platform\"}"
},
{
"refId": "B",
"expr": "disk_free{path='/data1',platform=\"$platform\"}"
},
{
"refId": "C",
"expr": "disk_free{path='/data2',platform=\"$platform\"}"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "df88a1d6-12ed-4384-b429-cdea49f2d64a"
},
{
"version": "2.0.0",
"name": "磁盘总大小",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 16,
"y": 3,
"i": "a802277a-3708-4fe0-b553-1b9d88259d71",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "disk_total{path='/',platform=\"$platform\"}"
},
{
"refId": "B",
"expr": "disk_total{path='/data1',platform=\"$platform\"}"
},
{
"refId": "C",
"expr": "disk_total{path='/data2',platform=\"$platform\"}"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "a802277a-3708-4fe0-b553-1b9d88259d71"
},
{
"targets": [
{
"refId": "A",
"expr": "(disk_inodes_used{path='/',platform=\"$platform\"}/disk_inodes_total{path='/',platform=\"$platform\"})*100"
},
{
"refId": "B",
"expr": "(disk_inodes_used{path='/data1',platform=\"$platform\"}/disk_inodes_total{path='/data1',platform=\"$platform\"})*100",
"legendFormat": ""
},
{
"refId": "C",
"expr": "(disk_inodes_used{path='/data2',platform=\"$platform\"}/disk_inodes_total{path='/data2',platform=\"$platform\"})*100",
"legendFormat": ""
}
],
"name": "磁盘inodes使用率",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 70
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 0,
"y": 10,
"i": "4b182b78-018e-4071-81d6-ca4971130daf",
"isResizable": true
},
"id": "4b182b78-018e-4071-81d6-ca4971130daf"
},
{
"targets": [
{
"refId": "A",
"expr": "rate(diskio_io_time{name='vda',platform=\"$platform\"}[1m])/10"
},
{
"refId": "B",
"expr": "rate(diskio_io_time{name='vdb',platform=\"$platform\"}[1m])/10"
},
{
"expr": "rate(diskio_io_time{name='sda',platform=\"$platform\"}[1m])/10",
"refId": "C"
}
],
"name": "磁盘IO使用率",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 50
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 8,
"y": 10,
"i": "90e720ce-afbd-461b-bdc5-c9cfbc104c72",
"isResizable": true
},
"id": "90e720ce-afbd-461b-bdc5-c9cfbc104c72"
}
]
},
{
"id": "e19ad144-9667-44ca-b252-d234763f4bef",
"type": "row",
"name": "系统负载",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 3,
"i": "e19ad144-9667-44ca-b252-d234763f4bef",
"isResizable": false
},
"collapsed": true,
"panels": []
},
{
"targets": [
{
"refId": "A",
"expr": "system_load1{platform=\"$platform\"}"
}
],
"name": "1分钟负载",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 0,
"y": 4,
"i": "8b7204e8-f5d4-4ee5-ba59-2fe794bfafbe",
"isResizable": true
},
"id": "8b7204e8-f5d4-4ee5-ba59-2fe794bfafbe"
},
{
"targets": [
{
"refId": "A",
"expr": "system_load5{platform=\"$platform\"}"
}
],
"name": "5分钟负载",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 8,
"y": 4,
"i": "92f366b2-f5a3-47c0-b875-5f6a25f37a07",
"isResizable": true
},
"id": "92f366b2-f5a3-47c0-b875-5f6a25f37a07"
},
{
"targets": [
{
"refId": "A",
"expr": "system_load15{platform=\"$platform\"}"
}
],
"name": "15分钟负载",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 8,
"x": 16,
"y": 4,
"i": "e7f3631d-b9ed-4d52-b425-df2f8e31cd01",
"isResizable": true
},
"id": "e7f3631d-b9ed-4d52-b425-df2f8e31cd01"
},
{
"id": "0236b298-79d2-4554-a4c8-37edea35be0e",
"type": "row",
"name": "swap分区",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 11,
"i": "0236b298-79d2-4554-a4c8-37edea35be0e",
"isResizable": false
},
"collapsed": true,
"panels": []
},
{
"targets": [
{
"refId": "A",
"expr": "swap_used_percent{platform=\"$platform\"} "
}
],
"name": "swap分区使用率",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "percent"
},
"thresholds": {
"steps": [
{
"value": 80
}
]
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 24,
"x": 0,
"y": 12,
"i": "e6ef8a87-a816-4256-8920-58251d9084a6",
"isResizable": true
},
"id": "e6ef8a87-a816-4256-8920-58251d9084a6"
},
{
"id": "3c36b76e-1a6f-4f5c-a5aa-cf6898e3e5a8",
"type": "row",
"name": "网络",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 19,
"i": "3c36b76e-1a6f-4f5c-a5aa-cf6898e3e5a8",
"isResizable": false
},
"collapsed": true,
"panels": []
},
{
"version": "2.0.0",
"name": "入站流量(秒)",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 0,
"y": 20,
"i": "f67d63a9-2e71-430d-906b-5bd0cec99612",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "rate(net_bytes_recv{platform=\"$platform\"}[5m])"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "f67d63a9-2e71-430d-906b-5bd0cec99612"
},
{
"version": "2.0.0",
"name": "出站流量(秒)",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 12,
"y": 20,
"i": "21566ef8-363c-44c1-bd54-4991ab4f3986",
"isResizable": true
},
"targets": [
{
"refId": "A",
"expr": "rate(net_bytes_sent{platform=\"$platform\"}[5m])"
}
],
"options": {
"standardOptions": {
"util": "bytesSI"
},
"legend": {
"displayMode": "hidden"
},
"tooltip": {
"mode": "all",
"sort": "desc"
},
"thresholds": {
"style": "line",
"steps": []
}
},
"links": [],
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"id": "21566ef8-363c-44c1-bd54-4991ab4f3986"
},
{
"id": "1a64ee64-26ba-4fcf-a26b-fb0157ec79ed",
"type": "row",
"name": "进程",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 27,
"i": "1a64ee64-26ba-4fcf-a26b-fb0157ec79ed",
"isResizable": false
},
"collapsed": true,
"panels": []
},
{
"targets": [
{
"refId": "A",
"expr": "processes_total{platform=\"$platform\"}"
}
],
"name": "进程总数",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 0,
"y": 28,
"i": "a906376d-73d0-4541-b3e3-67b7356eb933",
"isResizable": true
},
"id": "a906376d-73d0-4541-b3e3-67b7356eb933"
},
{
"targets": [
{
"refId": "A",
"expr": "processes_zombies{platform=\"$platform\"}"
}
],
"name": "假死进程数",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 12,
"y": 28,
"i": "bc32e03a-fc8a-4ecc-9649-671451d85a88",
"isResizable": true
},
"id": "bc32e03a-fc8a-4ecc-9649-671451d85a88"
},
{
"id": "e3aa88ea-8fa0-46c9-8e4b-d2c9cf5fd65a",
"type": "row",
"name": "连接数",
"layout": {
"h": 1,
"w": 24,
"x": 0,
"y": 35,
"i": "e3aa88ea-8fa0-46c9-8e4b-d2c9cf5fd65a",
"isResizable": false
},
"collapsed": true,
"panels": []
},
{
"targets": [
{
"refId": "A",
"expr": "netstat_tcp_established{platform=\"$platform\"}"
}
],
"name": "已建立的连接数",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 0,
"y": 36,
"i": "142f6260-978c-4414-bd9f-2a7674fd570c",
"isResizable": true
},
"id": "142f6260-978c-4414-bd9f-2a7674fd570c"
},
{
"targets": [
{
"refId": "A",
"expr": "netstat_tcp_close_wait{platform=\"$platform\"}"
}
],
"name": " 等待关闭的连接数",
"links": [],
"options": {
"tooltip": {
"mode": "all",
"sort": "desc"
},
"legend": {
"displayMode": "hidden"
},
"standardOptions": {
"util": "none"
},
"thresholds": {
"steps": []
}
},
"custom": {
"drawStyle": "lines",
"lineInterpolation": "smooth",
"fillOpacity": 0.5,
"stack": "off"
},
"version": "2.0.0",
"type": "timeseries",
"layout": {
"h": 7,
"w": 12,
"x": 12,
"y": 36,
"i": "f0a3f1cd-8e72-4840-9304-e52fbb67308f",
"isResizable": true
},
"id": "f0a3f1cd-8e72-4840-9304-e52fbb67308f"
}
]
}
}

告警模板

[
{
"name": "5分钟系统负载超过CPU核数",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "system_load5{platform=\"web\"}>system_n_cpus{platform=\"web\"}",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "cpu使用率超过85%,请关注!",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "cpu_usage_active{platform=\"web\",cpu=\"cpu-total\"}>85",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "swap分区使用率超过50%",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "swap_used_percent{platform=\"web\"} > 50",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "TCP连接数超过2000",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "netstat_tcp_established{platform=\"web\"} > 2000",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "内存使用率超过88%,请关注!",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "(mem_total{platform=\"web\"} - mem_available{platform=\"web\"})/mem_total{platform=\"web\"} * 100 >88",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "根/磁盘inodes使用率超过70%",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "(disk_inodes_used{path='/',platform=\"web\"}/disk_inodes_total{path='/',platform=\"web\"})*100>70",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
},
{
"name": "根/磁盘使用率超过70%",
"note": "",
"prod": "",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 2,
"disabled": 0,
"prom_for_duration": 120,
"prom_ql": "disk_used_percent{path='/',platform=\"web\"}>70",
"prom_eval_interval": 60,
"enable_stime": "00:00",
"enable_etime": "23:59",
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"email"
],
"notify_repeat_step": 60,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": []
}
]


©著作权归作者所有:来自51CTO博客作者feko大魔王的原创作品,请联系作者获取转载授权,否则将追究法律责任

#yyds干货盘点#linux设置环境变量-多极客编程

我们通过设置Linux的环境变量,可以方便我们的程序调用,比如我想把NodeJs加入环境变量/root/nodejs/bin/永久性更改对所有用户生效加入环境变量vim /etc/profile我们在最后一行加入PATH="$PATH:/root/nodejs/bin/"PATH就是系统的环境变量,而$PATH是之前系统设置的环境变量,我们要把他加上,然后在这个基础上加入我们的nodejs目录(环

python之多任务编程进程-多极客编程

一、进程概述1. 进程的介绍在Python程序中,想要实现多任务可以使用进程来完成,进程是实现多任务的一种方式。2. 进程的概念一个正在运行的程序或者软件就是一个进程,它是操作系统进行资源分配的基本单位,也就是说每启动一个进程,操作系统都会给其分配一定的运行资源(内存资源)保证进程的运行。比如:现实生活中的公司可以理解成是一个进程,公司提供办公资源(电脑、办公桌椅等),真正干活的是员工,员工可以理

#yyds干货盘点#linux命令之usr、ps、kill-多极客编程

usr和目录结构1、/usr中的usr,指的是Unix System Resource,而不是User。2、/usr/bin下面的都是系统预装的可执行程序,会随着系统升级而改变。3、/usr/share/bin 可以通过web访问的程序一般放在这里。4、/usr/local/bin目录是给用户放置自己的可执行程序的地方,推荐放在这里,不会被系统升级而覆盖同名文件。5、local 目录下的都不是系统

说透io多路复用模型-多极客编程

作者:京东零售 石朝阳在说IO多路复用模型之前,我们先来大致了解下Linux文件系统。在Linux系统中,不论是你的鼠标,键盘,还是打印机,甚至于连接到本机的socket client端,都是以文件描述符的形式存在于系统中,诸如此类,等等等等,所以可以这么说,一切皆文件。来看一下系统定义的文件描述符说明:从上面的列表可以看到,文件描述符0,1,2都已经被系统占用了,当系统启动的时候,这三个描述符就

walle 2.0最新部署流程-多极客编程

环境centos7python3.6(yum install python3 python36-devel -y)pip3(python3 -m pip install –upgrade pip)mysql5.6(预先部署)nginx1.22(预先部署)特性类gitlab的RESTful API,类gitlab的权限模型,将来打通gitlab,良心的惊喜空间管理。意味着有独立的空间资源:环境管理、

40-zabbix在grafana中展示和zabbix性能优化以及zabbix高可用集群搭建-多极客编程

Zabbix 利用 Grafana 进行图形展示Grafana 是一款采用 go 语言编写的开源应用,主要用于大规模指标数据的可视化展现,是网络架构和应用分析中最流行的时序数据展示工具,目前已经支持绝大部分常用的时序数据库使用 Grafana 显示Zabbix的监控数据过程安装 grafana安装 zabbix 插件创建 zabbix 数据源导入 dashboard 模板安装 Grafana 包包

#yyds干货盘点#linux设置环境变量-多极客编程

我们通过设置Linux的环境变量,可以方便我们的程序调用,比如我想把NodeJs加入环境变量/root/nodejs/bin/永久性更改对所有用户生效加入环境变量vim /etc/profile我们在最后一行加入PATH="$PATH:/root/nodejs/bin/"PATH就是系统的环境变量,而$PATH是之前系统设置的环境变量,我们要把他加上,然后在这个基础上加入我们的nodejs目录(环

cdh问题及维护汇总-多极客编程

目录:一、HIVE错误二、HDFS错误三、oozie错误四、Kafka错误五、Hbase错误六、Yarn和CM错误七、维护及添加服务八、Spark九、其他错误十、日志路径维护十一、Cloudera Management Service角色迁移“无意中发现了一个巨牛的人工智能教程,忍不住分享一下给大家。教程不仅是零基础,通俗易懂,而且非常风趣幽默,像看小说一样!觉得太牛了,所以分享给大家。点​​这里

python之多任务编程进程-多极客编程

一、进程概述1. 进程的介绍在Python程序中,想要实现多任务可以使用进程来完成,进程是实现多任务的一种方式。2. 进程的概念一个正在运行的程序或者软件就是一个进程,它是操作系统进行资源分配的基本单位,也就是说每启动一个进程,操作系统都会给其分配一定的运行资源(内存资源)保证进程的运行。比如:现实生活中的公司可以理解成是一个进程,公司提供办公资源(电脑、办公桌椅等),真正干活的是员工,员工可以理

istio整体架构组件解析-多极客编程

Istio在微服务之间建立连接,接管通信功能,对业务微服务屏蔽通信细节,同时通过流量控制、策略控制、遥测统计、Istio安全机制等对微服务进行监控和管理,使得微服务架构更加健壮、安全和易扩展。Istio整体架构分为数据平面(Data Plane)和控制平面(Control Plane)两部分。一、数据平面数据平面除了负责实际流量转发工作的数据转发代理服务istio/proxy之外,还有几个关键组件

说透io多路复用模型-多极客编程

作者:京东零售 石朝阳在说IO多路复用模型之前,我们先来大致了解下Linux文件系统。在Linux系统中,不论是你的鼠标,键盘,还是打印机,甚至于连接到本机的socket client端,都是以文件描述符的形式存在于系统中,诸如此类,等等等等,所以可以这么说,一切皆文件。来看一下系统定义的文件描述符说明:从上面的列表可以看到,文件描述符0,1,2都已经被系统占用了,当系统启动的时候,这三个描述符就

walle 2.0最新部署流程-多极客编程

环境centos7python3.6(yum install python3 python36-devel -y)pip3(python3 -m pip install –upgrade pip)mysql5.6(预先部署)nginx1.22(预先部署)特性类gitlab的RESTful API,类gitlab的权限模型,将来打通gitlab,良心的惊喜空间管理。意味着有独立的空间资源:环境管理、