Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
nightingale
提交
76bfb130
N
nightingale
项目概览
DiDi
/
nightingale
9 个月 前同步成功
通知
46
Star
7053
Fork
1161
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nightingale
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
76bfb130
编写于
8月 01, 2023
作者:
U
Ulric Qin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code refactor
上级
184bb78e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
7 deletion
+49
-7
integrations/Network/markdown/net.md
integrations/Network/markdown/net.md
+49
-7
未找到文件。
integrations/Network/markdown/net.md
浏览文件 @
76bfb130
# net_response
# net_response
plugin
网络探测插件,通常用于监控本机某个端口是否在监听,或远端某个端口是否能连通
## code meanings
网络探测插件,通常用于监控本机某个端口是否在监听,或远端某个端口是否能连通。因为 Prometheus 生态的时序库只能存储 float64 类型的值,所以网络探测插件探测的结果也是 float64 类型的值,但是这个值的含义是不同的,具体含义如下:
```
- 0: Success
- 1: Timeout
- 2: ConnectionFailed
- 3: ReadFailed
- 4: StringMismatch
```
如果一切正常,这个值是 0,如果有异常,这个值是 1-4 之间的值,具体含义如上。这个值对应的指标名字是
`net_response_result_code`
。
## Configuration
最核心的配置就是 targets 部分,指定探测的目标,下面的例子:
categraf 的
`conf/input.net_response/net_response.toml`
。
最核心的配置就是 targets 部分,指定探测的目标,下面的例子:
```
toml
[[instances]]
...
...
@@ -27,7 +29,7 @@ targets = [
-
`localhost:6379`
表示探测本机的 6379 端口是否可以连通
-
`:9090`
表示探测本机的 9090 端口是否可以连通
监控数据或告警事件中只是一个 IP 和端口,接收告警的人看到了,可能不清楚只是哪个业务的模块告警了,可以附加一些更有价值的信息放到标签里,比如
例子中
:
监控数据或告警事件中只是一个 IP 和端口,接收告警的人看到了,可能不清楚只是哪个业务的模块告警了,可以附加一些更有价值的信息放到标签里,比如:
```
toml
labels
=
{
region
=
"cloud"
,
product
=
"n9e"
}
...
...
@@ -35,6 +37,46 @@ labels = { region="cloud", product="n9e" }
标识了这是 cloud 这个 region,n9e 这个产品,这俩标签会附到时序数据上,告警的时候自然也会报出来。
完整配置样例如下:
```
toml
[mappings]
# "127.0.0.1:22"= {region="local",ssh="test"}
# "127.0.0.1:22"= {region="local",ssh="redis"}
[[instances]]
targets
=
[
# "127.0.0.1:22",
# "localhost:6379",
# ":9090"
]
# # append some labels for series
# labels = { region="cloud", product="n9e" }
# # interval = global.interval * interval_times
# interval_times = 1
## Protocol, must be "tcp" or "udp"
## NOTE: because the "udp" protocol does not respond to requests, it requires
## a send/expect string pair (see below).
# protocol = "tcp"
## Set timeout
# timeout = "1s"
## Set read timeout (only used if expecting a response)
# read_timeout = "1s"
## The following options are required for UDP checks. For TCP, they are
## optional. The plugin will send the given string to the server and then
## expect to receive the given 'expect' string back.
## string sent to the server
# send = "ssh"
## expected string in answer
# expect = "ssh"
```
## 监控大盘和告警规则
该 README 的同级目录下,提供了 dashboard.json 就是监控大盘的配置,alerts.json 是告警规则,可以导入夜莺使用。
\ No newline at end of file
夜莺内置了仪表盘和告警规则,克隆到自己的业务组即可使用。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录