[comment]: # translation:outdated

[comment]: # ({22d75789-22d75789})
# 1 Zabbix agent

[comment]: # ({/22d75789-22d75789})

[comment]: # ({46b00e5b-46b00e5b})
#### 概述

这些检查通过与Zabbix agent的通信来收集数据。

存在[passive and active](/manual/appendix/items/activepassive)
agent检查。在配置监控项时，您可以选择所需的类型：

-   *Zabbix agent* - 用于被动检查
-   *Zabbix agent (active)* - 用于主动检查

[comment]: # ({/46b00e5b-46b00e5b})

[comment]: # ({ab69441b-ab69441b})
#### 支持的 监控项 键

该表格提供了可按监控项系列分组的Zabbix agent 监控项所使用的监控项键详细信息.

另请参阅:

-   [Items supported by
    platform](/manual/appendix/items/supported_by_platform)
-   [Item keys supported by Zabbix agent
    2](/manual/config/items/itemtypes/zabbix_agent/zabbix_agent2)
-   [Item keys specific for Windows
    agent](/manual/config/items/itemtypes/zabbix_agent/win_keys)
-   [Minimum permission level for Windows agent
    items](/manual/appendix/items/win_permissions)

[comment]: # ({/ab69441b-ab69441b})

[comment]: # ({801c55c5-6ef16440})


**必选与可选参数**

不带尖括号的参数是必选的。用尖括号 **<** **>** 标记的参数是可选的。

**命令行工具的使用**

请注意，当在命令行中使用 zabbix_agentd 或 zabbix_get 测试或使用 监控项 键时，还需考虑 shell 语法。

例如，如果某个键参数需要用双引号括起来，则必须显式转义双引号，否则它们会被 shell 作为特殊字符截断，而不会被传递给 Zabbix 工具。

示例：

    zabbix_agentd -t 'vfs.dir.count[/var/log,,,"file,dir",,0]'

    zabbix_agentd -t vfs.dir.count[/var/log,,,\"file,dir\",,0]

[comment]: # ({/801c55c5-6ef16440})

[comment]: # ({d48fdbc9-531dbc08})


##### 内核数据

| 监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 注释 |
| **kernel.maxfiles** | <   | <   | <   |
| Maximum number of opened files supported by OS. | integer |     |     |
| **kernel.maxproc** | <   | <   | <   |
| Maximum number of processes supported by OS. | integer |     |     |
| **kernel.openfiles** | <   | <   | <   |
| Return the number of currently open file descriptors. | integer |     | 该 监控项 自 Zabbix 6.0 起支持。 |

[comment]: # ({/d48fdbc9-531dbc08})

[comment]: # ({5cc5ae3d-597a0b85})


##### 日志数据

请参阅[log monitoring](log_items)上的更多信息。

监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 备注 |
| **log**\[file,\<regexp\>,\<encoding\>,\<maxlines\>,\<mode\>,\<output\>,\<maxdelay\>,\<options\>,\<persistent\_dir\>\] | <   | <   | <   |
| Monitoring of a log file. | 日志 | **file** - 日志文件file的完整路径及名称<br>**regexp** - 描述所需模式的正则表达式[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**maxlines** - agent每秒发送给Zabbix server或proxy的最大新行数。该参数会覆盖[zabbix\_agentd.conf](/manual/appendix/config/zabbix_agentd)中的'MaxLinesPerSecond'值<br>**mode** (自version 2.0起)- 可选值:<br>*all* (默认), *skip* - 跳过旧数据处理(仅影响新建的监控项)<br>**output** (自version 2.2起) - 可选的输出格式化模板。转义序列**\\0**会被替换为匹配的文本部分(从匹配开始的首字符到匹配结束的末字符)，而**\\N**(N=1...9)会被替换为第N个匹配组(若N超过捕获组数量则返回空string)<br>**maxdelay** (自version 3.2起) - 最大延迟秒数。类型: float。取值: 0 - (默认)永不忽略日志file行; > 0.0 - 为get在"maxdelay"秒内分析的最新行而忽略旧行。使用前请阅读[使用-maxdelay-参数](log_items#使用-maxdelay-参数)说明!<br>**options** (自version 4.4.7起) - 附加选项:<br>*mtime-noreread* - 非唯一记录，仅当file大小变化时重读(忽略修改时间变化)。(该参数自5.0.2起废弃，因现已忽略mtime)<br>**persistent\_dir** (自5.0.18/5.4.9版本起，仅限Unix系统的zabbix\_agentd；Agent2不支持) - 持久化文件存储目录的绝对路径。另见[日志持久化文件注意事项-监控项](log_items#日志持久化文件注意事项-监控项)的补充说明 | 该监控项必须配置为[主动检查](/manual/appendix/items/activepassive#主动检查)<br>若file缺失或权限不足，监控项将转为不支持状态<br><br>若`output`留空 - 则返回包含匹配文本的整行。注意除'Result is TRUE'外的所有全局正则表达式类型始终返回整行，此时`output`参数被忽略<br><br>使用`output`参数的内容提取操作在agent端执行<br><br>示例:<br>=> log[/var/log/syslog]<br>=> log[/var/log/syslog,error]<br>=> log[/home/zabbix/logs/logfile,,,100]<br><br>*使用`output`参数从日志记录提取数字:*<br>=> log[/app1/app.log,"task run [0-9.]+ sec, processed ([0-9]+) records, [0-9]+ errors",,,,\\1] → 将匹配日志记录"2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"并仅发送'6080'到服务器。由于发送的是数值，可将该监控项的"信息类型"设为"数值(无符号)"并用于图表、触发器等功能<br><br>*使用`output`参数在发送前重写日志记录:*<br>=> log[/app1/app.log,"([0-9 :-]+) task run ([0-9.]+) sec, processed ([0-9]+) records, ([0-9]+) errors",,,,"\\1 RECORDS: \\3, ERRORS: \\4, DURATION: \\2"] → 将匹配日志记录"2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"并发送修改后的记录"2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08"到服务器 |
| **log.count**\[file,\<regexp\>,\<encoding\>,\<maxproclines\>,\<mode\>,\<maxdelay\>,\<options\>,\<persistent\_dir\>\] | <   | <   | <   |
| Count of matched lines in a monitored log file. | integer | **file** - 日志file的完整路径及名称<br>**regexp** - 描述所需模式的正则表达式[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**maxproclines** - agent每秒分析的最大新行数（不得超过10000）。默认值为[zabbix\_agentd.conf](/manual/appendix/config/zabbix_agentd)中'MaxLinesPerSecond'的10倍。<br>**mode** - 可选值：<br>*all*（默认），*skip* - 跳过旧数据处理（仅影响新创建的监控项）。<br>**maxdelay** - 最大延迟秒数。类型：float。取值：0 -（默认）永不忽略日志file行；> 0.0 - 为get在"maxdelay"秒内分析的最新行而忽略旧行。使用前请阅读[使用-maxdelay-参数](log_items#使用-maxdelay-参数)说明！<br>**options**（自version 4.4.7起） - 附加选项：<br>*mtime-noreread* - 非唯一记录，仅当file大小变化时重读（忽略修改时间变化）。（该参数自5.0.2起弃用，因现已忽略mtime。）<br>**persistent\_dir**（自5.0.18/5.4.9版本起，仅限Unix系统的zabbix\_agentd；Agent2不支持） - 持久化文件存储目录的绝对路径。另见[日志持久化文件注意事项-监控项](log_items#日志持久化文件注意事项-监控项)的附加说明。 | 监控项必须配置为[主动检查](/manual/appendix/items/activepassive#主动检查)。<br><br><br>匹配行数统计自agent上次日志检查后的新增行，因此取决于监控项的update间隔。<br>若file缺失或权限不足，监控项将转为不支持状态。<br><br>该监控项不支持Windows事件日志。<br><br>自Zabbix 3.2.0起支持。
| **logrt**\[file\_regexp,\<regexp\>,\<encoding\>,\<maxlines\>,\<mode\>,\<output\>,\<maxdelay\>,\<options\>,\<persistent\_dir\>\] | <   | <   | <   |
| Monitoring of a log file that is rotated. | 日志 | **file\_regexp** - file的绝对路径，其中file名称使用正则[expression](/manual/regular_expressions)指定。注意正则表达式仅适用于file名称，不需要匹配整个名称（例如，/path/to/agent将匹配zabbix\_agentd.log）<br>**regexp** - 描述所需内容模式的正则[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**maxlines** - agent每秒发送到Zabbix server或proxy的最大新行数。此参数会覆盖[zabbix\_agentd.conf](/manual/appendix/config/zabbix_agentd)中的'MaxLinesPerSecond'值<br>**mode** (自version 2.0起) - 可能的值：<br>*all* (默认), *skip* - 跳过旧数据处理（仅影响新创建的监控项）<br>**output** (自version 2.2起) - 可选的输出格式化模板。**\\0**转义序列被替换为匹配的文本部分（从匹配开始的第一个字符到匹配结束的字符），而**\\N**（其中N=1...9）转义序列被替换为第N个匹配组（如果N超过捕获组数量则为空string）<br>**maxdelay** (自version 3.2起) - 最大延迟秒数。类型：float。值：0 - (默认)永不忽略日志file行；> 0.0 - 忽略旧行以便get在"maxdelay"秒内分析的最新行。使用前请阅读[使用-maxdelay-参数](log_items#使用-maxdelay-参数)说明！<br>**options** (自version 4.0起；*mtime-reread*、*mtime-noreread*选项自4.4.7起) - 日志file轮转类型及其他选项。可能的值：<br>*rotate* (默认),<br>*copytruncate* - 注意*copytruncate*不能与*maxdelay*一起使用。此时*maxdelay*必须为0或未指定；参见[关于处理copytruncate日志文件轮转的注意事项](log_items#关于处理copytruncate日志文件轮转的注意事项)说明,<br>*mtime-reread* - 非唯一记录，修改时间或大小变化时重新读取（默认）,<br>*mtime-noreread* - 非唯一记录，仅大小变化时重新读取（忽略修改时间变化）<br>**persistent\_dir** (自5.0.18、5.4.9版本起，仅限Unix系统的zabbix\_agentd；Agent2不支持) - 存储持久化文件的目录绝对路径名。另见[日志持久化文件注意事项-监控项](log_items#日志持久化文件注意事项-监控项)的附加说明 | 监控项必须配置为[主动检查](/manual/appendix/items/activepassive#主动检查)<br>日志轮转基于文件的最后修改时间<br><br>注意logrt设计用于处理一个当前活动的日志file，同时轮转其他几个匹配的非活动文件。例如，如果一个目录有许多活动日志文件，应为每个文件创建单独的logrt监控项。否则如果一个logrt监控项拾取过多文件，可能导致memory耗尽和监控崩溃<br><br>如果`output`留空 - 返回包含匹配文本的整行。注意除'Result is TRUE'外的所有全局正则表达式类型总是返回整个匹配行，`output`参数被忽略<br><br>使用`output`参数的内容提取发生在agent上<br><br>在`file regexp`参数中，日志目录路径和日志file正则表达式必须用正确的目录分隔符分隔：<br> - Windows上分隔符必须是反斜杠(\\)<br> - 其他系统上必须是正斜杠(/)<br>Windows上其他位置可能容忍正斜杠，除了分隔日志目录路径和日志file正则表达式的位置（见下例）<br><br>Windows示例：<br>=> logrt["c:/dir1/dir2/dir3&#92;filename.\*\\.log","pattern_to_match"] → 将从"c:/dir1/dir2/dir3"中file名称以"filename"开头且以匹配".log"的任何扩展名结尾的日志文件收集数据<br>=> logrt["//example.com/share/dir1/dir2/dir3\\filename.\*\\.log","pattern_to_match"] → 将从网络共享"//example.com/share/dir1/dir2/dir3"中file名称以"filename"开头且以匹配".log"的任何扩展名结尾的日志文件收集数据<br><br>其他系统示例：<br>=> logrt\["/home/zabbix/logs/\^logfile\[0-9\]{1,3}$",,,100\] → 将匹配"logfile1"之类的file（不匹配".logfile1"）<br>=> logrt\["/home/user/\^logfile\_.\*\_\[0-9\]{1,3}$","pattern\_to\_match","UTF-8",100\] → 将从"logfile\_abc\_1"或"logfile\_\_001"等文件收集数据<br><br>*使用`output`参数从日志记录中提取数字：*<br>=> logrt\[/app1/\^test.\*log$,"task run \[0-9.\]+ sec, processed (\[0-9\]+) records, \[0-9\]+ errors",,,,\\1\] → 将匹配日志记录"2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"并仅发送'6080'到服务器。由于发送的是数值，此监控项的"信息类型"可设为"数值（无符号）"，该值可用于图表、触发器等等<br><br>*使用`output`参数在发送到服务器前重写日志记录：*<br>=> logrt\[/app1/\^test.\*log$,"(\[0-9 :-\]+) task run (\[0-9.\]+) sec, processed (\[0-9\]+) records, (\[0-9\]+) errors",,,,"\\1 RECORDS: \\3, ERRORS: \\4, DURATION: \\2"\] → 将匹配日志记录"2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"并发送修改后的记录"2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08"到服务器 |
| **logrt.count**\[file\_regexp,\<regexp\>,\<encoding\>,\<maxproclines\>,\<mode\>,\<maxdelay\>,\<options\>,\<persistent\_dir\>\] | <   | <   | <   |
| Count of matched lines in a monitored log file that is rotated. | integer | **file\_regexp** - file的绝对路径，其中file名称使用正则[expression](/manual/regular_expressions)指定。注意正则表达式仅适用于file名称，且无需匹配完整名称（例如/path/to/agent将匹配zabbix\_agentd.log）<br>**regexp** - 描述所需内容模式的正则[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**maxproclines** - agent每秒分析的最大新行数（不得超过10000）。默认值为[zabbix\_agentd.conf](/manual/appendix/config/zabbix_agentd)中'MaxLinesPerSecond'的10倍<br>**mode** - 可选值：<br>*all*（默认），*skip* - 跳过旧数据处理（仅影响新建的监控项）<br>**maxdelay** - 最大延迟秒数。类型：float。取值：0 -（默认）永不忽略日志file行；> 0.0 - 为get在"maxdelay"秒内分析的最新行而忽略旧行。使用前请阅读[使用-maxdelay-参数](log_items#使用-maxdelay-参数)说明！<br>**options**（自version 4.0起；*mtime-reread*、*mtime-noreread*选项自4.4.7起）- 日志file轮转类型及其他选项。可选值：<br>*rotate*（默认）<br>*copytruncate* - 注意*copytruncate*不能与*maxdelay*同时使用。此时*maxdelay*必须为0或不指定；参见[关于处理copytruncate日志文件轮转的注意事项](log_items#关于处理copytruncate日志文件轮转的注意事项)说明<br>*mtime-reread* - 非唯一记录，若修改时间或大小变化则重读（默认）<br>*mtime-noreread* - 非唯一记录，仅当大小变化时重读（忽略修改时间变化）<br>**persistent\_dir**（自5.0.18/5.4.9版本起，仅限Unix系统的zabbix\_agentd；Agent2不支持）- 存储持久化文件的目录绝对路径。另见[日志持久化文件注意事项-监控项](log_items#日志持久化文件注意事项-监控项)的附加说明 | 该监控项必须配置为[主动检查](/manual/appendix/items/activepassive#主动检查)<br><br>匹配行数统计自agent上次检查后的新行，因此取决于监控项的update间隔<br><br>日志轮转基于文件的最后修改时间<br><br>此监控项不支持Windows事件日志<br><br>自Zabbix 3.2.0起支持<br>在`file regexp`参数中，日志目录路径与日志file正则表达式必须用正确的目录分隔符分隔：<br> - Windows系统必须使用反斜杠（\）<br> - 其他系统必须使用正斜杠（/）<br>Windows系统中其他位置可能允许使用正斜杠，但分隔日志目录路径与日志file正则表达式的分隔符除外（参见下方示例）：<br><br>Windows示例：<br>=> logrt.count["c:/dir1/dir2/dir3&#92;filename.\*\\.log","pattern_to_match"] → 将统计"c:/dir1/dir2/dir3"目录中日志文件内"pattern_to_match"模式的匹配次数<br>=> logrt.count["//example.com/share/dir1/dir2/dir3\\filename.\*\\.log","pattern_to_match"] → 将统计网络共享"//example.com/share/dir1/dir2/dir3"上日志文件内"pattern_to_match"模式的匹配次数<br><br>其他系统示例：<br>=> logrt.count["/home/zabbix/logs/^logfile[0-9]{1,3}\$",,,100] → 将统计"/home/zabbix/logs"目录中日志文件内"^logfile[0-9]{1,3}\$"模式的匹配次数<br>=> logrt.count["/home/user/^logfile_.*_[0-9]{1,3}\$","pattern_to_match","UTF-8",100] → 将统计"/home/user"目录中日志文件内"pattern_to_match"模式的出现次数 |

[comment]: # ({/5cc5ae3d-597a0b85})

[comment]: # ({f51b20ca-06d13165})


##### Modbus 数据

| 监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 注释 |
| **modbus.get**\[endpoint,<slave id>,<function>,<address>,<count>,<type>,<endianness>,<offset>\] | <   | <   | <   |
| Reads Modbus data. | JSON object | **endpoint** - 定义为 `protocol://connection_string` 的端点<br>**slave id** - 从站ID<br>**function** - Modbus功能码<br>**address** - 首个寄存器/线圈/输入的地址<br>**count** - 要读取的记录数<br>**type** - 数据类型<br>**endianness** - 字节序配置<br>**offset** - 从 '地址' 开始将被丢弃结果的寄存器数量<br><br>查看参数的 [detailed description](/manual/appendix/items/modbus) | 自Zabbix 5.2.0起支持 |

[comment]: # ({/f51b20ca-06d13165})

[comment]: # ({c3c0e137-8ffc49c1})
##### 网络数据

| 监控项 键值 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 注释 |
| **net.dns**\[<ip>,name,<type>,<timeout>,<count>,<protocol>\] | <   | <   | <   |
| Checks if DNS service is up. | 0 - DNS不可用（服务器未响应或DNS解析失败）<br><br>1 - DNS可用 | **ip** - DNS服务器IP地址（留空则使用默认DNS服务器，Windows上仅支持Zabbix agent 2，Zabbix agent忽略此参数）<br>**name** - 需query的DNS名称<br>**type** - 查询的记录类型（默认为*SOA*）<br>**timeout**（Windows上忽略，除非使用Zabbix agent 2 version 6.0.1或更新版本）- 请求超时时间（秒，默认1秒）<br>**count**（Windows上忽略，除非使用Zabbix agent 2 version 6.0.1或更新版本）- 请求重试次数（默认2次）<br>**protocol**（自version 3.0起）- 执行DNS queries的协议：*udp*（默认）或*tcp* | 示例：<br>=> net.dns\[8.8.8.8,example.com,MX,2,1\]<br><br>`type`可能的取值：<br>*ANY*, *A*, *NS*, *CNAME*, *MB*, *MG*, *MR*, *PTR*, *MD*, *MF*, *MX*, *SOA*, *NULL*, *WKS*（Windows上的Zabbix agent及所有OS的Zabbix agent 2不支持）, *HINFO*, *MINFO*, *TXT*, *AAAA*, *SRV*<br><br>不支持国际化域名，请使用IDNA编码名称替代。<br><br>SRV记录类型自Zabbix 1.8.6（Unix）和2.0.0（Windows）起支持。<br><br>Zabbix 2.0之前的命名方式（仍支持）：*net.tcp.dns* |
| **net.dns.record**\[<ip>,name,<type>,<timeout>,<count>,<protocol>\] | <   | <   | <   |
| Performs a DNS query. | 包含所需信息类型的字符string | **ip** - DNS服务器IP地址（留空则使用默认DNS服务器，Windows上忽略，除非使用Zabbix agent 2 version 6.0.1或更新版本）<br>**name** - 需query的DNS名称<br>**type** - 查询的记录类型（默认为*SOA*）<br>**timeout**（Windows上忽略，除非使用Zabbix agent 2 version 6.0.1或更新版本）- 请求超时时间（秒，默认1秒）<br>**count**（Windows上忽略，除非使用Zabbix agent 2 version 6.0.1或更新版本）- 请求重试次数（默认2次）<br>**protocol**（自version 3.0起）- 执行DNS queries的协议：*udp*（默认）或*tcp* | 示例：<br>=> net.dns.record\[8.8.8.8,example.com,MX,2,1\]<br><br>`type`可能的取值：<br>*ANY*, *A*, *NS*, *CNAME*, *MB*, *MG*, *MR*, *PTR*, *MD*, *MF*, *MX*, *SOA*, *NULL*, *WKS*（Windows上的Zabbix agent及所有OS的Zabbix agent 2不支持）, *HINFO*, *MINFO*, *TXT*, *AAAA*, *SRV*<br><br>不支持国际化域名，请使用IDNA编码名称替代。<br><br>SRV记录类型自Zabbix 1.8.6（Unix）和2.0.0（Windows）起支持。<br><br>Zabbix 2.0之前的命名方式（仍支持）：*net.tcp.dns.query* |
| **net.if.collisions**\[if\] | <   | <   | <   |
| Number of out-of-window collisions. | integer | **if** - 网络接口名称 |     |
| **net.if.discovery** | <   | <   | <   |
| List of network interfaces. Used for low-level discovery. | JSON object |     | 自Zabbix 2.0起支持。<br><br>FreeBSD、OpenBSD和NetBSD自Zabbix 2.2起支持。<br><br>某些Windows版本（如Server 2008）可能需要安装最新更新以支持接口名称中的非ASCII字符。 |
| **net.if.in**\[if,<mode>\] | <   | <   | <   |
| Incoming traffic statistics on network interface. | integer | **if** - 网络接口名称（Unix）；网络接口完整描述或IPv4地址；或大括号内的网络接口GUID（Windows）<br>**mode** - 可选值：<br>*bytes* - 字节数（默认）<br>*packets* - 数据包数<br>*errors* - 错误数<br>*dropped* - 丢弃包数<br>*overruns (fifo)* - FIFO缓冲区错误数<br>*frame* - 数据包帧错误数<br>*compressed* - 设备驱动接收的压缩包数<br>*multicast* - 设备驱动接收的多播帧数 | Windows上，监控项优先从64位计数器获取值（如果可用）。64位接口统计计数器自Windows Vista和Windows Server 2008引入。若64位计数器不可用，agent将使用32位计数器。<br><br>Windows上的多字节接口名称自Zabbix 1.8.6起支持。<br><br>示例：<br>=> net.if.in\[eth0,errors\]<br>=> net.if.in\[eth0\]<br><br>可通过net.if.discovery或net.if.list 监控项获取Windows网络接口描述。<br><br>可结合*每秒变化*预处理步骤使用此键值以get每秒字节数统计。 |
| **net.if.out**\[if,<mode>\] | <   | <   | <   |
| Outgoing traffic statistics on network interface. | integer | **if** - 网络接口名称（Unix）；网络接口完整描述或IPv4地址；或大括号内的网络接口GUID（Windows）<br>**mode** - 可选值：<br>*bytes* - 字节数（默认）<br>*packets* - 数据包数<br>*errors* - 错误数<br>*dropped* - 丢弃包数<br>*overruns (fifo)* - FIFO缓冲区错误数<br>*collisions (colls)* - 接口检测到的冲突数<br>*carrier* - 设备驱动检测到的载波丢失数<br>*compressed* - 设备驱动发送的压缩包数 | Windows上，监控项优先从64位计数器获取值（如果可用）。64位接口统计计数器自Windows Vista和Windows Server 2008引入。若64位计数器不可用，agent将使用32位计数器。<br><br>Windows上的多字节接口名称自Zabbix agent 1.8.6 version起支持。<br><br>示例：<br>=> net.if.out\[eth0,errors\]<br>=> net.if.out\[eth0\]<br><br>可通过net.if.discovery或net.if.list 监控项获取Windows网络接口描述。<br><br>可结合*每秒变化*预处理步骤使用此键值以get每秒字节数统计。 |
| **net.if.total**\[if,<mode>\] | <   | <   | <   |
| Sum of incoming and outgoing traffic statistics on network interface. | integer | **if** - 网络接口名称（Unix）；网络接口完整描述或IPv4地址；或大括号内的网络接口GUID（Windows）<br>**mode** - 可选值：<br>*bytes* - 字节数（默认）<br>*packets* - 数据包数<br>*errors* - 错误数<br>*dropped* - 丢弃包数<br>*overruns (fifo)* - FIFO缓冲区错误数<br>*compressed* - 设备驱动发送或接收的压缩包数 | Windows上，监控项优先从64位计数器获取值（如果可用）。64位接口统计计数器自Windows Vista和Windows Server 2008引入。若64位计数器不可用，agent将使用32位计数器。<br><br>示例：<br>=> net.if.total\[eth0,errors\]<br>=> net.if.total\[eth0\]<br><br>可通过net.if.discovery或net.if.list 监控项获取Windows网络接口描述。<br><br>可结合*每秒变化*预处理步骤使用此键值以get每秒字节数统计。<br><br>注意：仅当net.if.in和net.if.out在您的平台上均支持丢弃包统计时，此功能才可用。 |
| **net.tcp.listen**\[port\] | <   | <   | <   |
| Checks if this TCP port is in LISTEN state. | 0 - 非LISTEN状态<br><br>1 - 处于LISTEN状态 | **port** - TCP端口号 | 示例：<br>=> net.tcp.listen\[80\]<br><br>Linux自Zabbix 1.8.4起支持<br><br>自Zabbix 3.0.0起，在Linux内核2.6.14及以上版本中，优先从内核NETLINK接口获取监听TCP套接字信息（如果可能）。否则从/proc/net/tcp和/proc/net/tcp6文件获取。 |
| **net.tcp.port**\[<ip>,port\] | <   | <   | <   |
| Checks if it is possible to make TCP connection to specified port. | 0 - 无法连接<br><br>1 - 可连接 | **ip** - IP或DNS名称（默认127.0.0.1）<br>**port** - 端口号 | 示例：<br>=> net.tcp.port\[,80\] → 可用于测试80端口Web服务器可用性。<br><br>简单TCP性能测试请使用net.tcp.service.perf\[tcp,<ip>,<port>\]<br><br>注意：这些检查可能导致系统守护进程日志中出现额外消息（SMTP和SSH会话通常会被记录）。 |
| **net.tcp.service**\[service,<ip>,<port>\] | <   | <   | <   |
| Checks if service is running and accepting TCP connections. | 0 - 服务不可用<br><br>1 - 服务运行中 | **service** - 可选值：<br>*ssh*, *ldap*, *smtp*, *ftp*, *http*, *pop*, *nntp*, *imap*, *tcp*, *https*, *telnet*（参见[details](/manual/appendix/items/service_check_details)）<br>**ip** - IP或DNS名称（默认127.0.0.1）<br>**port** - 端口号（默认使用标准服务端口） | 示例：<br>=> net.tcp.service\[ftp,,45\] → 可用于测试45端口FTP服务器可用性。<br><br>注意：这些检查可能导致系统守护进程日志中出现额外消息（SMTP和SSH会话通常会被记录）。<br><br>目前不支持加密协议检查（如993端口IMAP或995端口POP）。临时解决方案：对此类检查请使用net.tcp.port。<br><br>Windows上的LDAP和HTTPS检查仅Zabbix agent 2支持。<br><br>注意：telnet检查会寻找login提示符（末尾的':'）。<br><br>*https*和*telnet*服务自Zabbix 2.0起支持。 |
| **net.tcp.service.perf**\[service,<ip>,<port>\] | <   | <   | <   |
| Checks performance of TCP service. | float<br><br>0 - 服务不可用<br><br>秒数 - 连接服务所耗时间 | **service** - 可选值：<br>*ssh*, *ldap*, *smtp*, *ftp*, *http*, *pop*, *nntp*, *imap*, *tcp*, *https*, *telnet*（参见[details](/manual/appendix/items/service_check_details)）<br>**ip** - IP或DNS名称（默认127.0.0.1）<br>**port** - 端口号（默认使用标准服务端口） | 示例：<br>=> net.tcp.service.perf\[ssh\] → 可用于测试SSH服务器初始响应速度。<br><br>目前不支持加密协议检查（如993端口IMAP或995端口POP）。临时解决方案：对此类检查请使用net.tcp.service.perf\[tcp,<ip>,<port>\]。<br><br>Windows上的LDAP和HTTPS检查仅Zabbix agent 2支持。<br><br>注意：telnet检查会寻找login提示符（末尾的':'）。<br><br>*https*和*telnet*服务自Zabbix 2.0起支持。 |
| **net.tcp.socket.count**\[<laddr>,<lport>,<raddr>,<rport>,<state>\] | <   | <   | <   |
| Return the number of TCP sockets that match parameters. | integer | **laddr** - 本地IPv4/6地址或CIDR子网<br>**lport** - 本地端口号或服务名称<br>**raddr** - 远程IPv4/6地址或CIDR子网<br>**rport** - 远程端口号或服务名称<br>**state** - 连接状态（*established*, *syn\_sent*, *syn\_recv*, *fin\_wait1*, *fin\_wait2*, *time\_wait*, *close*, *close\_wait*, *last\_ack*, *listen*, *closing*） | 该监控项仅在Linux上的Zabbix agent/agent 2支持。Zabbix agent 2上64位Windows也支持。<br><br>示例：<br>=> net.tcp.socket.count\[,80,,,established\] → 返回本地TCP端口80处于*established*状态的连接数<br><br>该监控项自Zabbix 6.0起支持。 |
| **net.udp.listen**\[port\] | <   | <   | <   |
| Checks if this UDP port is in LISTEN state. | 0 - 非LISTEN状态<br><br>1 - 处于LISTEN状态 | **port** - UDP端口号 | 示例：<br>=> net.udp.listen\[68\]<br><br>Linux自Zabbix 1.8.4起支持 |
| **net.udp.service**\[service,<ip>,<port>\] | <   | <   | <   |
| Checks if service is running and responding to UDP requests. | 0 - 服务不可用<br><br>1 - 服务运行中 | **service** - *ntp*（参见[details](/manual/appendix/items/service_check_details)）<br>**ip** - IP或DNS名称（默认127.0.0.1）<br>**port** - 端口号（默认使用标准服务端口） | 示例：<br>=> net.udp.service\[ntp,,45\] → 可用于测试45端口NTP服务可用性。<br><br>该监控项自Zabbix 3.0.0起支持，但早期版本中*ntp*服务可通过net.tcp.service\[\] 监控项使用。 |
| **net.udp.service.perf**\[service,<ip>,<port>\] | <   | <   | <   |
| Checks performance of UDP service. | float<br><br>0 - 服务不可用<br><br>秒数 - 等待服务响应的耗时 | **service** - *ntp*（参见[details](/manual/appendix/items/service_check_details)）<br>**ip** - IP或DNS名称（默认127.0.0.1）<br>**port** - 端口号（默认使用标准服务端口） | 示例：<br>=> net.udp.service.perf\[ntp\] → 可用于测试NTP服务响应时间。<br><br>该监控项自Zabbix 3.0.0起支持，但早期版本中*ntp*服务可通过net.tcp.service\[\] 监控项使用。 |
| **net.udp.socket.count**\[<laddr>,<lport>,<raddr>,<rport>,<state>\] | <   | <   | <   |
| Return the number of UDP sockets that match parameters. | integer | **laddr** - 本地IPv4/6地址或CIDR子网<br>**lport** - 本地端口号或服务名称<br>**raddr** - 远程IPv4/6地址或CIDR子网<br>**rport** - 远程端口号或服务名称<br>**state** - 连接状态（*established*, *unconn*） | 该监控项仅在Linux上的Zabbix agent/agent 2支持。Zabbix agent 2上64位Windows也支持。<br><br>示例：<br>=> net.udp.socket.count\[,,,,established\] → 返回处于连接状态的UDP套接字数<br><br>该监控项自Zabbix 6.0起支持。 |

[comment]: # ({/c3c0e137-8ffc49c1})

[comment]: # ({af55fcc2-ab88c2ca})
##### 处理数据

| 监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 备注 |
| **proc.cpu.util**\[<name>,<user>,<type>,<cmdline>,<mode>,<zone>\] | <   | <   | <   |
| Process CPU utilization percentage. | float | **name** - 进程名称（默认为*所有进程*）<br>**user** - 用户名（默认为*所有用户*）<br>**type** - CPU利用率类型：<br>*total*（默认）、*user*、*system*<br>**cmdline** - 按命令行过滤（支持正则[概述](/manual/regular_expressions#概述)）<br>**mode** - 数据采集模式：*avg1*（默认）、*avg5*、*avg15*<br>**zone** - 目标区域：*current*（默认）、*all*。该参数仅在Solaris系统上支持 | 示例：<br>=> proc.cpu.util\[,root\] → "root"用户下运行的所有进程的CPU利用率<br>=> proc.cpu.util\[zabbix\_server,zabbix\] → zabbix用户下运行的zabbix\_server进程的CPU利用率<br><br>返回值基于单核CPU利用率百分比。例如完全占用两个核心的进程CPU利用率为200%。<br><br>进程CPU利用率数据由采集器收集，最多支持1024个唯一（按名称、用户和命令行区分）queries。超过24小时未访问的queries将从采集器中移除。<br><br>*注意*：当`zone`参数设置为*current*（或默认值）时，若agent在不支持区域的Solaris系统上编译，但运行在支持区域的新版Solaris系统上，则agent将返回NOTSUPPORTED（agent无法将结果限制在当前区域）。但此情况下仍支持*all*参数。<br><br>该监控项从Zabbix 3.0.0版本开始支持，可在多个平台上使用（参见[Items supported by platform](/manual/appendix/items/supported_by_platform)）。 |
| **proc.mem**\[<name>,<user>,<mode>,<cmdline>,<memtype>\] | <   | <   | <   |
| Memory used by process in bytes. | integer - with `mode` as *max*, *min*, *sum*<br><br>float - with `mode` as *avg* | **name** - process name (default is *all processes*)<br>**user** - user name (default is *all users*)<br>**mode** - possible values:<br>*avg*, *max*, *min*, *sum* (default)<br>**cmdline** - filter by command line (it is a regular [概述](/manual/regular_expressions#概述))<br>**memtype** - [type of memory](/manual/appendix/items/proc_mem_notes) used by process | Examples:<br>=> proc.mem\[,root\] → memory used by all processes running under the "root" user<br>=> proc.mem\[zabbix\_server,zabbix\] → memory used by all zabbix\_server processes running under the zabbix user<br>=> proc.mem\[,oracle,max,oracleZABBIX\] → memory used by the most memory-hungry process running under oracle having oracleZABBIX in its command line<br><br>*Note*: When several processes use shared memory, the sum of memory used by processes may result in large, unrealistic values.<br><br>See [notes](/manual/appendix/items/proc_mem_num_notes) on selecting processes with `name` and `cmdline` parameters (Linux-specific).<br><br>When this 监控项 is invoked from the command line and contains a command line parameter (e.g. using the agent test mode: `zabbix_agentd -t proc.mem[,,,apache2]`), one extra process will be counted, as the agent will count itself.<br><br>The `memtype` parameter is supported on several [platforms](/manual/appendix/items/supported_by_platform) since Zabbix 3.0.0. |
| **proc.num**\[<name>,<user>,<state>,<cmdline>,<zone>\] | <   | <   | <   |
| The number of processes. | integer | **name** - 进程名称（默认为*所有进程*）<br>**user** - 用户名（默认为*所有用户*）<br>**state**（*disk*和*trace*选项自version 3.4.0起支持） - 可选值：<br>*all*（默认），<br>*disk* - 不可中断睡眠，<br>*run* - 运行中，<br>*sleep* - 可中断睡眠，<br>*trace* - 已停止，<br>*zomb* - 僵尸进程<br>**cmdline** - 按命令行过滤（支持正则表达式[概述](/manual/regular_expressions#概述)）<br>**zone** - 目标区域：*current*（默认），*all*。该参数仅支持Solaris系统 | 示例：<br>=> proc.num\[,mysql\] → 运行mysql用户下的进程数量<br>=> proc.num\[apache2,www-data\] → 运行www-data用户下的apache2进程数量<br>=> proc.num\[,oracle,sleep,oracleZABBIX\] → 命令行包含oracleZABBIX且运行oracle用户下的睡眠状态进程数量<br><br>关于使用`name`和`cmdline`参数（Linux专有）选择进程，参见[notes](/manual/appendix/items/proc_mem_num_notes)。<br><br>在Windows系统上，仅支持`name`和`user`参数。<br><br>当该监控项从命令行调用且包含命令行参数时（例如使用agent测试模式：`zabbix_agentd -t proc.num[,,,apache2]`），由于agent会统计自身，因此实际计数会多出一个进程。<br><br>*注意*：如果在Solaris系统上，当agent编译时不支持zone功能但运行在支持zone的新版Solaris时，将`zone`参数设为*current*（或默认值）会导致agent返回NOTSUPPORTED（因为agent无法将结果限制在当前zone）。但此情况下仍支持*all*参数。 |

[comment]: # ({/af55fcc2-ab88c2ca})

[comment]: # ({b778ea75-b9de65a2})
##### 传感器数据

| 监控项 键值 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 说明 |
| **sensor**\[device,sensor,<mode>\] | <   | <   | <   |
| Hardware sensor reading. | float | **device** - 设备名称；当mode参数省略时可使用正则[概述](/manual/regular_expressions#概述)<br>**sensor** - 传感器名称；当mode参数省略时可使用正则[概述](/manual/regular_expressions#概述)<br>**mode** - 可选值：<br>*avg*, *max*, *min*（若省略此参数，则device和sensor按字面值处理） | 读取Linux 2.4系统的/proc/sys/dev/sensors文件<br><br>示例：<br>=> sensor\[w83781d-i2c-0-2d,temp1\]<br><br>Zabbix 1.8.4版本前使用*sensor\[temp1\]*格式 |
| ^ | ^   | ^   | 读取Linux 2.6+系统的/sys/class/hwmon目录<br><br>详见Linux系统下[sensor](/manual/appendix/items/sensor) 监控项的详细说明 |
| ^ | ^   | ^   | 读取OpenBSD系统的*hw.sensors* MIB<br><br>示例：<br>=> sensor\[cpu0,temp0\] → 单个CPU温度<br>=> sensor\["cpu\[0-2\]$",temp,avg\] → 前三个CPU的平均温度<br><br>自Zabbix 1.8.4起支持OpenBSD系统 |

[comment]: # ({/b778ea75-b9de65a2})

[comment]: # ({c2f90496-3e2abe66})
##### 系统数据

监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 备注 |
| **system.boottime** | <   | <   | <   |
| System boot time. | integer (Unix时间戳) |     |     |
| **system.cpu.discovery** | <   | <   | <   |
| List of detected CPUs/CPU cores. Used for low-level discovery. | JSON object |     | 自2.4.0版本起支持所有平台。 |
| **system.cpu.intr** | <   | <   | <   |
| Device interrupts. | integer |     |     |
| **system.cpu.load**\[<cpu>,<mode>\] | <   | <   | <   |
| [CPU load](http://en.wikipedia.org/wiki/Load_(computing)). | float | **cpu** - 可选值:<br>*all* (默认), *percpu* (自 version 2.0起; 总负载除以在线CPU数量)<br>**mode** - 可选值:<br>*avg1* (一分钟平均值, 默认), *avg5*, *avg15* | 当在Windows的Zabbix agent上启动采集器进程时，会初始化以下性能计数器并用于此监控项: `\System\Processor Queue Length`<br><br>示例:<br>=> system.cpu.load\[,avg5\]. |
| **system.cpu.num**\[<type>\] | <   | <   | <   |
| Number of CPUs. | integer | **类型** - 可选值:<br>*online* (默认), *max* | 示例:<br>=> system.cpu.num |
| **system.cpu.switches** | <   | <   | <   |
| Count of context switches. | integer |     |     |
| **system.cpu.util**\[<cpu>,<type>,<mode>,<logical\_or\_physical>\] | <   | <   | <   |
| CPU utilization percentage. | float | **cpu** - *<CPU编号>* 或 *all* (默认值)<br>**type** - 可选值:<br>*user* (默认值), *idle*, *nice*, *system* (Windows默认值), *iowait*, *interrupt*, *softirq*, *steal*, *guest* (Linux内核2.6.24及以上版本), *guest\_nice* (Linux内核2.6.33及以上版本).<br>详见该参数的[platform-specific](/manual/appendix/items/supported_by_platform)说明.<br>**mode** - 可选值:<br>*avg1* (一分钟平均值, 默认值), *avg5*, *avg15*<br>**logical\_or\_physical** (自version 5.0.3起; 仅AIX系统) - 可选值: *logical* (默认值), *physical*. 该参数仅AIX系统支持. | Windows系统中该值通过*Processor Time*性能计数器获取. 注意从Windows 8开始, 其任务管理器基于*Processor Utility*性能计数器显示CPU利用率, 而早期版本使用*Processor Time*计数器(参见[more details](/manual/appendix/items/system_cpu_util)).<br><br>示例:<br>=> system.cpu.util\[0,user,avg5\]<br><br>旧命名方式: *system.cpu.idleX, system.cpu.niceX, system.cpu.systemX, system.cpu.userX* |
| **system.hostname**\[<type>, <transform>\] | <   | <   | <   |
| System host name. | string | **type** (在version 5.4.7之前仅Windows支持) - 可选值: *netbios* (Windows默认), *主机* (Linux默认), *shorthost* (自version 5.4.7起; 返回主机名第一个点之前的部分，对于不含点的名称返回完整string)。<br>**transform** (自version 5.4.7起) - 可选值:<br>*none* (默认), *lower* (转换为小写) | 该值在Windows上通过GetComputerName() (用于**netbios**)或gethostname() (用于**主机**)函数获取，在其他系统上通过从uname()系统API输出中获取`nodename`。<br><br>返回值示例:<br>*Linux系统*:<br>=> system.hostname → linux-w7x1<br>=> system.hostname → example.com<br>=> system.hostname\[shorthost\] → example<br>*Windows系统*:<br>=> system.hostname → WIN-SERV2008-I6<br>=> system.hostname\[主机\] → Win-Serv2008-I6LonG<br>=> system.hostname\[主机,lower\] → win-serv2008-i6long<br><br>另见[配置](/manual/appendix/install/windows_agent#配置)。 |
| **system.hw.chassis**\[<info>\] | <   | <   | <   |
| Chassis information. | string | **info** - 可选值为 *full*（默认）、*model*、*serial*、*type* 或 *vendor* | 示例:<br>=> system.hw.chassis\[full\] → 惠普 HP Pro 3010 小型立式电脑 CZXXXXXXXX 台式机<br><br>该键值依赖于 [SMBIOS](http://en.wikipedia.org/wiki/System_Management_BIOS) 表的可用性。<br>若sysfs访问失败，将尝试从sysfs读取DMI表，否则直接读取 memory。<br><br>由于需要从sysfs或 memory 读取数据，因此要求**root权限**。<br><br>自Zabbix 2.0起支持该功能。 |
| **system.hw.cpu**\[<cpu>,<info>\] | <   | <   | <   |
| CPU information. | string 或 integer | **cpu** - *<CPU编号>* 或 *all* (默认值)<br>**info** - 可选值:<br>*full* (默认值), *curfreq*, *maxfreq*, *model* 或 *vendor* | 示例:<br>=> system.hw.cpu\[0,vendor\] → AuthenticAMD<br><br>从 /proc/cpuinfo 和 /sys/devices/system/cpu/\[cpunum\]/cpufreq/cpuinfo\_max\_freq 收集信息。<br><br>若指定CPU编号及*curfreq*或*maxfreq*参数，则返回数值型频率值(Hz)。<br><br>自Zabbix 2.0起支持。
| **system.hw.devices**\[<type>\] | <   | <   | <   |
| Listing of PCI or USB devices. | 文本 | **类型** (自 version 2.0 起) - *pci* (默认) 或 *usb* | 示例:<br>=> system.hw.devices\[pci\] → 00:00.0 主机 桥接器: Advanced Micro Devices \[AMD\] RS780 主机 桥接<br>\[..\]<br><br>返回 lspci 或 lsusb 工具的输出(执行时不带任何参数)。 |
| **system.hw.macaddr**\[<interface>,<format>\] | <   | <   | <   |
| Listing of MAC addresses. | string | **interface** - *all*（默认）或正则[概述](/manual/regular_expressions#概述)<br>**format** - *full*（默认）或*short* | 列出名称匹配给定`interface`正则[概述](/manual/regular_expressions#概述)的接口MAC地址（*all*表示列出所有接口）。<br><br>示例：<br>=> system.hw.macaddr\["eth0$",full\] → \[eth0\] 00:11:22:33:44:55<br><br>若`format`指定为*short*，则不会列出接口名称及重复的MAC地址。<br><br>自Zabbix 2.0起支持。
| **system.localtime**\[<type>\] | <   | <   | <   |
| System time. | integer - 使用 `type` 作为 *utc*<br><br>string - 使用 `type` 作为 *local* | **type** (自 version 2.0 起) - 可选值:<br>*utc* - (默认) 自纪元时间(1970年1月1日 00:00:00 UTC)起的秒数<br>*local* - 以 'yyyy-mm-dd,hh:mm:ss.nnn,+hh:mm' 格式表示的时间<br> | 必须仅作为 [被动检查](/manual/appendix/items/activepassive#被动检查) 使用。<br><br>示例:<br>=> system.localtime\[local\] → create 一个 监控项 并使用此键值在 *Clock* [dashboard widget](/manual/web_interface/frontend_sections/monitoring/dashboard/widgets/clock) 中显示 主机 时间。 |
| **system.run**\[command,<mode>\] | <   | <   | <   |
| Run specified command on the host. | 命令的文本结果<br><br>1 - 当`mode`为*nowait*时（无论命令结果如何） | **command** - 待执行的命令<br>**mode** - 可选值:<br>*wait* - 等待执行结束（默认值）,<br>*nowait* - 不等待 | 监控项的返回值包含命令产生的标准输出和标准错误。[退出码检查](/manual/appendix/command_execution#退出码检查)不会被执行。<br>另见: [Command execution](/manual/appendix/command_execution)<br><br>为正确处理返回值，命令结果必须是`text`数据类型。空结果同样允许。<br><br>返回值限制为16MB（包括会被截断的尾部空格）；[文本数据限制](/manual/config/items/item#文本数据限制)同样适用。<br><br>注意 system.run 监控项 默认被禁用。了解如何[enable them](/manual/config/items/restrict_checks)。<br><br>示例:<br>=> system.run\[ls -l /\] → 根目录的详细file列表。 |
| **system.stat**\[resource,<type>\] | <   | <   | <   |
| System statistics. | integer 或 float | **ent** - 该分区有权获得的处理器单元数量 (float)<br>**kthr,<类型>** - 内核线程状态信息:<br>*r* - 可运行内核线程的平均数量 (float)<br>*b* - 被置于虚拟内存管理器等待队列中的内核线程平均数量 (float)<br>**memory,<类型>** - 虚拟和实际memory的使用情况:<br>*avm* - 活跃虚拟页数 (integer)<br>*fre* - 空闲列表大小 (integer)<br>**page,<类型>** - 页面错误和分页活动信息:<br>*fi* - 每秒file页面调入数 (float)<br>*fo* - 每秒file页面调出数 (float)<br>*pi* - 从分页空间调入的页数 (float)<br>*po* - 调出到分页空间的页数 (float)<br>*fr* - 释放的页数(页面替换) (float)<br>*sr* - 页面替换算法扫描的页数 (float)<br>**faults,<类型>** - 陷阱和中断率:<br>*in* - 设备中断数 (float)<br>*sy* - 系统调用数 (float)<br>*cs* - 内核线程上下文切换数 (float)<br>**cpu,<类型>** - 处理器时间使用百分比细分:<br>*us* - 用户态时间 (float)<br>*sy* - 系统态时间 (float)<br>*id* - 空闲时间 (float)<br>*wa* - 系统存在未完成磁盘/NFS I/O请求时的空闲时间 (float)<br>*pc* - 消耗的物理处理器数量 (float)<br>*ec* - 消耗的授权容量百分比 (float)<br>*lbusy* - 表示在用户和系统级别执行时逻辑处理器的利用率百分比 (float)<br>*app* - 表示共享池中可用的物理处理器数量 (float)<br>**disk,<类型>** - 磁盘统计信息:<br>*bps* - 表示每秒传输到驱动器的数据量(读取或写入)，单位为字节 (integer)<br>*tps* - 表示每秒向物理磁盘/磁带发出的传输次数 (float) | 该监控项仅[supported](/manual/appendix/items/supported_by_platform)于AIX系统。<br>请注意这些监控项中的以下限制:<br>=> system.stat[cpu,app] - 仅支持类型为"Shared"的AIX LPAR<br>=> system.stat[cpu,ec] - 支持类型为"Shared"和"Dedicated"的AIX LPAR("Dedicated"始终返回100(百分比))<br>=> system.stat[cpu,lbusy] - 仅支持类型为"Shared"的AIX LPAR<br>=> system.stat[cpu,pc] - 支持类型为"Shared"和"Dedicated"的AIX LPAR<br>=> system.stat[ent] - 支持类型为"Shared"和"Dedicated"的AIX LPAR |
| **system.sw.arch** | <   | <   | <   |
| Software architecture information. | string |     | 示例:<br>=> system.sw.arch → i686<br><br>该信息来自uname()函数。<br><br>自Zabbix 2.0起支持。 |
| **system.sw.os**\[<info>\] | <   | <   | <   |
| Operating system information. | string | **info** - 可能取值:<br>*full* (默认值), *short* 或 *name* | 示例:<br>=> system.sw.os\[short\] → Ubuntu 2.6.35-28.50-generic 2.6.35.11<br><br>信息获取来源(注意并非所有文件和选项在所有发行版中都存在):<br>/proc/version (*full*)<br>/proc/version\_signature (*short*)<br>PRETTY\_NAME 参数来自支持该功能的系统的 /etc/os-release 文件，或 /etc/问题.net (*name*)<br><br>自 Zabbix 2.0 版本起支持。 |
| **system.sw.packages**\[<regexp>,<manager>,<format>\] | <   | <   | <   |
| Listing of installed packages. | 文本 | **regexp** - *all*（默认）或正则表达式[概述](/manual/regular_expressions#概述)<br>**manager** - *all*（默认）或包管理器<br>**format** - *full*（默认）或*short* | 列出（按字母顺序）名称匹配给定`package`正则表达式[概述](/manual/regular_expressions#概述)的已安装软件包（*all*表示列出全部）。<br><br>示例：<br>=> system.sw.packages\[mini,dpkg,short\] → python-minimal, python2.6-minimal, ubuntu-minimal<br><br>支持的包管理器（执行命令）：<br>dpkg (dpkg --get-selections)<br>pkgtool (ls /var/log/packages)<br>rpm (rpm -qa)<br>pacman (pacman -Q)<br><br>若`format`指定为*full*，软件包按包管理器分组（每个管理器单独一行，以方括号中的名称开头）。<br>若`format`指定为*short*，软件包不分组且单行列出。<br><br>Zabbix 2.0起支持。
| **system.swap.in**\[<device>,<type>\] | <   | <   | <   |
| Swap in (from device into memory) statistics. | integer | **device** - 用于交换的设备（默认为*all*）<br>**type** - 可选值：<br>*count*（交换入次数）、*sectors*（交换入的扇区数）、*pages*（交换入的页数）。<br>详见该参数的[platform-specific](/manual/appendix/items/supported_by_platform)说明。 | 示例：<br>=> system.swap.in\[,pages\]<br><br>数据来源：<br>/proc/swaps, /proc/partitions, /proc/stat (Linux 2.4)<br>/proc/swaps, /proc/diskstats, /proc/vmstat (Linux 2.6) |
| **system.swap.out**\[<device>,<type>\] | <   | <   | <   |
| Swap out (from memory onto device) statistics. | integer | **device** - 用于交换的设备（默认为*all*）<br>**type** - 可选值：<br>*count*（交换出次数）、*sectors*（交换出的扇区数）、*pages*（交换出的页数）。<br>详见该参数的[platform-specific](/manual/appendix/items/supported_by_platform)详细信息。 | 示例：<br>=> system.swap.out\[,pages\]<br><br>该信息的来源为：<br>/proc/swaps, /proc/partitions, /proc/stat (Linux 2.4)<br>/proc/swaps, /proc/diskstats, /proc/vmstat (Linux 2.6) |
| **system.swap.size**\[<device>,<type>\] | <   | <   | <   |
| Swap space size in bytes or in percentage from total. | integer - 用于字节<br><br>float - 用于百分比 | **device** - 交换空间使用的设备（默认为*all*）<br>**type** - 可选值：<br>*free*（空闲交换空间，默认值）、*pfree*（空闲交换空间百分比）、*pused*（已用交换空间百分比）、*total*（总交换空间）、*used*（已用交换空间）<br>注意：在Windows系统中，若交换空间大小为0，则不支持*pfree*和*pused*参数。<br>详见[platform-specific](/manual/appendix/items/supported_by_platform)获取该参数的详细信息。 | 示例：<br>=> system.swap.size\[,pfree\] → 空闲交换空间百分比<br><br>若未指定*device*参数，Zabbix agent将仅统计交换设备（文件），物理memory将被忽略。例如，在Solaris系统中，*swap -s*命令包含部分物理memory和交换设备（与*swap -l*不同）。<br><br>注意：在虚拟化（VMware ESXi、VirtualBox）Windows平台上，此键可能报告错误的交换空间大小/百分比。此时可使用`perf_counter[\700(_Total)\702]`键获取正确的交换空间百分比。 |
| **system.uname** | <   | <   | <   |
| Identification of the system. | string |     | 返回值示例(Unix):<br>FreeBSD localhost 4.2-RELEASE FreeBSD 4.2-RELEASE \#0: Mon Nov i386<br><br>返回值示例(Windows):<br>Windows ZABBIX-WIN 6.0.6001 Microsoft® Windows Server® 2008 Standard Service Pack 1 x86<br><br>在Unix系统中，自Zabbix 2.2.0版本起，该监控项的值通过uname()系统调用获取。在此之前是通过执行"uname -a"命令获取。该监控项的值可能与"uname -a"的输出有所不同，且不包含"uname -a"基于其他来源打印的附加信息。<br><br>在Windows系统中，自Zabbix 3.0版本起，该监控项的值从Win32\_OperatingSystem和Win32\_Processor WMI类中获取。在此之前是通过易变的Windows API和未公开的注册表键获取。操作系统名称(包括版本)可能会被翻译为用户显示语言。在某些Windows版本中，它包含商标符号和额外的空格。<br><br>请注意，在Windows系统中监控项返回的是操作系统架构，而在Unix系统中返回的是CPU架构。 |
| **system.uptime** | <   | <   | <   |
| System uptime in seconds. | integer |     | 在[配置](/manual/config/items/item#配置)中，使用**s**或**uptime**单位来get可读值。 |
| **system.users.num** | <   | <   | <   |
| Number of users logged in. | integer |     | **who** 命令在 agent 端用于获取该值。 |

[comment]: # ({/c2f90496-3e2abe66})

[comment]: # ({7ea16e22-c56d4a08})
##### 虚拟文件系统数据

监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 备注 |
| **vfs.dev.discovery** | <   | <   | <   |
| List of block devices and their type. Used for low-level discovery. | JSON object |     | 该 监控项 仅支持Linux平台。<br><br>自Zabbix 4.4.0版本起支持。 |
| **vfs.dev.read**\[<device>,<type>,<mode>\] | <   | <   | <   |
| Disk read statistics. | integer - 在*sectors*、*operations*、*bytes*中使用`type`<br><br>float - 在*sps*、*ops*、*bps*中使用`type`<br><br>*注意*: 如果使用update间隔为三小时或更长^**[2](#footnotes)**^，将始终返回'0' | **device** - 磁盘设备（默认为*all* ^**[3](#footnotes)**^）<br>**type** - 可选值: *sectors*、*operations*、*bytes*、*sps*、*ops*、*bps*<br>注意'类型'参数的支持和默认值取决于平台。详见[platform-specific](/manual/appendix/items/supported_by_platform)。<br>*sps*、*ops*、*bps*分别代表: 每秒扇区数、每秒操作数、每秒字节数。<br>**mode** - 可选值: *avg1*（一分钟平均值，默认）、*avg5*、*avg15*。<br>该参数仅在`sps`、`ops`、`bps`中使用`type`时支持。 | 您可以使用相对设备名称（例如`sda`）以及可选的/dev/前缀（例如`/dev/sda`）。<br><br>支持LVM逻辑卷。<br><br>不同操作系统'类型'参数的默认值：<br>AIX - operations<br>FreeBSD - bps<br>Linux - sps<br>OpenBSD - operations<br>Solaris - bytes<br><br>示例：<br>=> vfs.dev.read\[,operations\]<br><br>在支持的平台上，*sps*、*ops*和*bps*过去限制为8个设备（7个独立设备和1个*all*）。自Zabbix 2.0.1起，此限制已提升至1024个设备（1023个独立设备和1个*all*）。 |
| **vfs.dev.write**\[<device>,<type>,<mode>\] | <   | <   | <   |
| Disk write statistics. | integer - 使用`type`计量单位：*sectors*（扇区）、*operations*（操作数）、*bytes*（字节）<br><br>float - 使用`type`计量单位：*sps*（每秒扇区数）、*ops*（每秒操作数）、*bps*（每秒字节数）<br><br>*注意*：若采用update时间间隔≥3小时^**[2](#footnotes)**^，将始终返回'0' | **device** - 磁盘设备（默认为*all*全部设备^**[3](#footnotes)**^）<br>**type** - 可选值：*sectors*、*operations*、*bytes*、*sps*、*ops*、*bps*<br>注意'类型'参数的支持情况及默认值因平台而异，详见[platform-specific](/manual/appendix/items/supported_by_platform)说明。<br>*sps*、*ops*、*bps*分别表示：每秒扇区数、每秒操作数、每秒字节数。<br>**mode** - 可选值：*avg1*（一分钟平均值，默认）、*avg5*、*avg15*。<br>该参数仅在使用`type`计量单位sps/ops/bps时生效。 | 支持使用相对设备名（如`sda`）及可选的/dev/前缀（如`/dev/sda`）。<br><br>支持LVM逻辑卷。<br><br>不同操作系统'类型'参数的默认值：<br>AIX - operations<br>FreeBSD - bps<br>Linux - sps<br>OpenBSD - operations<br>Solaris - bytes<br><br>示例：<br>=> vfs.dev.write\[,operations\]<br><br>在支持的平台上，*sps*/*ops*/*bps*曾限制为8个设备（7个独立设备+1个*all*）。自Zabbix 2.0.1起限制提升至1024个（1023个独立设备+1个*all*）。 |
| **vfs.dir.count**\[dir,<regex\_incl>,<regex\_excl>,<types\_incl>,<types\_excl>,<max\_depth>,<min\_size>,<max\_size>,<min\_age>,<max\_age>,<regex\_excl\_dir>\] | <   | <   | <   |
| Directory entry count. | integer | **dir** - 目录的绝对路径<br>**regex\_incl** - 用于描述要包含的实体（file、目录、符号链接）名称模式的正则[概述](/manual/regular_expressions#概述)；若为空则包含所有（默认值）<br>**regex\_excl** - 用于描述要排除的实体（file、目录、符号链接）名称模式的正则[概述](/manual/regular_expressions#概述)；若为空则不排除任何内容（默认值）<br>**types\_incl** - 要统计的目录条目类型，可选值：<br>*file* - 常规file，*dir* - 子目录，*sym* - 符号链接，*sock* - 套接字，*bdev* - 块设备，*cdev* - 字符设备，*fifo* - FIFO，*dev* - 等同于"bdev,cdev"，*all* - 所有类型（默认），即"file,dir,sym,sock,bdev,cdev,fifo"。多个类型需用逗号分隔并加引号。<br>**types\_excl** - 不统计的目录条目类型（参见<types\_incl>）。若某条目类型同时出现在<types\_incl>和<types\_excl>中，则该类型条目不会被统计。<br>**max\_depth** - 遍历子目录的最大深度。**-1**（默认）表示无限制，**0**表示不进入子目录。<br>**min\_size** - 要统计的file最小大小（字节）。更小的文件不会被统计。可使用[内存后缀](/manual/appendix/suffixes#内存后缀)。<br>**max\_size** - 要统计的file最大大小（字节）。更大的文件不会被统计。可使用[内存后缀](/manual/appendix/suffixes#内存后缀)。<br>**min\_age** - 要统计的目录条目的最小存在时间（秒）。更近期的条目不会被统计。可使用[时间后缀](/manual/appendix/suffixes#时间后缀)。<br>**max\_age** - 要统计的目录条目的最大存在时间（秒）。存在时间超过此值的条目不会被统计（基于修改时间）。可使用[时间后缀](/manual/appendix/suffixes#时间后缀)。<br>**regex\_excl\_dir** - 用于描述要排除的目录名称模式的正则[概述](/manual/regular_expressions#概述)。该目录下的所有内容将被排除（与regex\_excl不同） | 不支持环境变量，例如`%APP_HOME%`、`$HOME`和`%TEMP%`。<br><br>伪目录"."和".."从不被统计。<br><br>遍历目录时不会跟随符号链接。<br><br>在Windows上，目录符号链接会被跳过。<br><br>计算条目数量时，`regex_incl`和`regex_excl`会同时应用于文件和目录，但在选择要遍历的子目录时会被忽略（如果regex\_incl为“(?i)\^.+\\.zip$”且未设置max\_depth，则会遍历所有子目录，但仅统计zip类型的文件）。<br><br>执行时间受[configuration](/manual/appendix/config/zabbix_agentd)中agent的超时值限制。由于大型目录遍历可能耗时更长，此时不会返回数据且监控项将变为不支持状态。不会返回部分统计结果。<br><br>按大小过滤时，仅常规文件具有有意义的大小。在Linux和BSD系统下，目录也有非零大小（通常为几KB）。设备大小为零，例如**/dev/sda1**的大小不反映相应分区大小。因此，使用`<min_size>`和`<max_size>`时，建议将`<types_incl>`指定为"*file*"，以避免意外情况。<br><br>示例：<br>⇒ vfs.dir.count\[/dev\] - 监控/dev下的设备数量（Linux）<br>⇒ vfs.dir.count\["C:\\Users\\ADMINI\~1\\AppData\\Local\\Temp"\] - 监控临时目录中的文件数量（Windows）<br><br>自Zabbix 4.0.0起支持。
| **vfs.dir.get**\[dir,<regex\_incl>,<regex\_excl>,<types\_incl>,<types\_excl>,<max\_depth>,<min\_size>,<max\_size>,<min\_age>,<max\_age>,<regex\_excl\_dir>\] | <   | <   | <   |
| Directory entry list. | JSON | **dir** - absolute path to directory<br>**regex\_incl** - regular [概述](/manual/regular_expressions#概述) describing the name pattern of the entity (file, directory, symbolic link) to include; include all if empty (default value)<br>**regex\_excl** - regular [概述](/manual/regular_expressions#概述) describing the name pattern of the entity (file, directory, symbolic link) to exclude; don't exclude any if empty (default value)<br>**types\_incl** - directory entry types to list, possible values:<br>*file* - regular file, *dir* - subdirectory, *sym* - symbolic link, *sock* - socket, *bdev* - block device, *cdev* - character device, *fifo* - FIFO, *dev* - synonymous with "bdev,cdev", *all* - all types (default), i.e. "file,dir,sym,sock,bdev,cdev,fifo". Multiple types must be separated with comma and quoted.<br>**types\_excl** - directory entry types (see <types\_incl>) to NOT list. If some entry type is in both <types\_incl> and <types\_excl>, directory entries of this type are NOT listed.<br>**max\_depth** - maximum depth of subdirectories to traverse. **-1** (default) - unlimited, **0** - no descending into subdirectories.<br>**min\_size** - minimum size (in bytes) for file to be listed. Smaller files will not be listed. [内存后缀](/manual/appendix/suffixes#内存后缀) can be used.<br>**max\_size** - maximum size (in bytes) for file to be listed. Larger files will not be counted. [内存后缀](/manual/appendix/suffixes#内存后缀) can be used.<br>**min\_age** - minimum age (in seconds) of directory entry to be listed. More recent entries will not be listed. [时间后缀](/manual/appendix/suffixes#时间后缀) can be used.<br>**max\_age** - maximum age (in seconds) of directory entry to be listed. Entries so old and older will not be listed (modification time). [时间后缀](/manual/appendix/suffixes#时间后缀) can be used.<br>**regex\_excl\_dir** - regular [概述](/manual/regular_expressions#概述) describing the name pattern of the directory to exclude. All content of the directory will be excluded (in contrast to regex\_excl) | Environment variables, e.g. `%APP_HOME%`, `$HOME` and `%TEMP%` are not supported.<br><br>Pseudo-directories "." and ".." are never listed.<br><br>Symbolic links are never followed for directory traversal.<br><br>On Windows, directory symlinks are skipped.<br><br>Both `regex_incl` and `regex_excl` are being applied to files and directories when generating entry list, but are ignored when picking subdirectories to traverse (if regex\_incl is “(?i)\^.+\\.zip$” and max\_depth is not set, then all subdirectories will be traversed, but only files of type zip will be listed).<br><br>Execution time is limited by timeout value in agent [configuration](/manual/appendix/config/zabbix_agentd). Since large directory traversal may take longer than that, no data will be returned and the 监控项 will turn unsupported. Partial list will not be returned.<br><br>When filtering by size, only regular files have meaningful sizes. Under Linux and BSD, directories also have non-zero sizes (a few Kb typically). Devices have zero sizes, e.g. the size of **/dev/sda1** does not reflect the respective partition size. Therefore, when using `<min_size>` and `<max_size>`, it is advisable to specify `<types_incl>` as "*file*", to avoid surprises.<br><br>Examples:<br>⇒ vfs.dir.get\[/dev\] - retrieves device list in /dev (Linux)<br>⇒ vfs.dir.get\["C:\\Users\\ADMINI\~1\\AppData\\Local\\Temp"\] - retrieves file list in temporary directory (Windows)<br><br>Supported since Zabbix 6.0.0. |
| **vfs.dir.size**\[dir,<regex\_incl>,<regex\_excl>,<mode>,<max\_depth>,<regex\_excl\_dir>\] | <   | <   | <   |
| Directory size (in bytes). | integer | **dir** - 目录的绝对路径<br>**regex\_incl** - 用于描述要包含的实体（file、目录、符号链接）名称模式的正则[概述](/manual/regular_expressions#概述)；若为空则包含所有（默认值）<br>**regex\_excl** - 用于描述要排除的实体（file、目录、符号链接）名称模式的正则[概述](/manual/regular_expressions#概述)；若为空则不排除任何内容（默认值）<br>**mode** - 可选值：<br>*apparent*（默认）- 获取file的表观大小而非磁盘使用量（相当于`du -sb dir`），*disk* - 获取磁盘使用量（相当于`du -s -B1 dir`）。与du命令不同，vfs.dir.size 监控项在计算目录大小时会考虑隐藏文件（在目录内相当于`du -sb .[^.]* *`）。<br>**max\_depth** - 遍历子目录的最大深度。**-1**（默认）- 无限制，**0** - 不进入子目录。<br>**regex\_excl\_dir** - 用于描述要排除的目录名称模式的正则[概述](/manual/regular_expressions#概述)。该目录的所有内容将被排除（与regex\_excl不同） | 仅计算*zabbix*用户至少具有读取权限的目录。<br><br>在Windows上会跳过所有符号链接，且硬链接仅计算一次。<br><br>对于大型目录或低速驱动器，此监控项可能因[agent](/manual/appendix/config/zabbix_agentd)和[server](/manual/appendix/config/zabbix_server)/[proxy](/manual/appendix/config/zabbix_proxy)配置文件中的超时设置而超时。请根据需要增加超时值。<br><br>示例：<br>⇒ vfs.dir.size\[/tmp,log\] - 计算/tmp中包含'日志'的所有文件大小<br>⇒ vfs.dir.size\[/tmp,log,\^.+\\.old$\] - 计算/tmp中名称包含'日志'的所有文件大小，排除名称以'.old'结尾的文件<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support)。<br><br>自Zabbix 3.4.0起支持。
| **vfs.file.cksum**\[file,<mode>\] | <   | <   | <   |
| File checksum, calculated by the UNIX cksum algorithm. | integer - 使用 `mode` 作为 *crc32*<br><br>string - 使用 `mode` 作为 *md5*, *sha256* | **file** - file的完整路径<br>**mode** - *crc32* (默认), *md5*, *sha256* | 示例:<br>=> vfs.file.cksum\[/etc/passwd\]<br><br>返回值示例 (分别对应crc32/md5/sha256):<br>675436101<br>9845acf68b73991eb7fd7ee0ded23c44<br>ae67546e4aac995e5c921042d0cf0f1f7147703aa42bfbfb65404b30f238f2dc<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support).<br><br>Zabbix 6.0起支持`mode`参数. |
| **vfs.file.contents**\[file,<encoding>\] | <   | <   | <   |
| Retrieving contents of a file. | 文本 | **file** - file的完整路径<br>**encoding** - 代码页 [编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置) | 如果file为空或仅包含LF/CR字符，则返回空的string。<br><br>返回值限制为16MB（包括被截断的尾部空白字符）；[文本数据限制](/manual/config/items/item#文本数据限制)同样适用。<br><br>字节顺序标记（BOM）不会出现在输出中。<br><br>示例：<br>=> vfs.file.contents\[/etc/passwd\] |
| **vfs.file.exists**\[file,<types\_incl>,<types\_excl>\] | <   | <   | <   |
| Checks if file exists. | 0 - not found<br><br>1 - file of the specified type exists | **file** - full path to file<br>**types\_incl** - list of file types to include, possible values: *file* (regular file, default (if types\_excl is not set)), *dir* (directory), *sym* (symbolic link), *sock* (socket), *bdev* (block device), *cdev* (character device), *fifo* (FIFO), *dev* (synonymous with "bdev,cdev"), *all* (all mentioned types, default if types\_excl is set).<br>**types\_excl** - list of file types to exclude, see types\_incl for possible values (by default no types are excluded) | Multiple types must be separated with a comma and the entire set enclosed in quotes "".<br>On Windows the double quotes have to be backslash '\\' escaped and the whole 监控项 key enclosed in double quotes when using the command line utility for calling zabbix\_get.exe or agent2.<br><br>If the same type is in both <types\_incl> and <types\_excl>, files of this type are excluded.<br><br>Examples:<br>=> vfs.file.exists\[/tmp/application.pid\]<br>=> vfs.file.exists\[/tmp/application.pid,"file,dir,sym"\]<br>=> vfs.file.exists\[/tmp/application\_dir,dir\]<br><br>The file size limit depends on [large file support](/manual/appendix/items/large_file_support).<br><br>Note that the 监控项 may turn unsupported on Windows if a directory is searched within a non-existing directory, e.g. vfs.file.exists\[C:\\no\\dir,dir\] (where 'no' does not exist). |
| **vfs.file.get**\[file\] | <   | <   | <   |
| Return information about a file. | JSON object | **file** - file的完整路径 | UNIX-like系统支持的file类型: 常规file, 目录, 符号链接, 套接字, 块设备, 字符设备, FIFO<br><br>Windows支持的file类型: 常规file, 目录, 符号链接<br><br>示例:<br>=> vfs.file.get\[/etc/passwd\] → 返回包含/etc/passwd file信息的JSON(类型, 用户, 权限, SID, uid等)<br><br>file大小限制取决于[large file support](/manual/appendix/items/large_file_support).<br><br>自Zabbix 6.0起支持 |
| **vfs.file.md5sum**\[file\] | <   | <   | <   |
| MD5 checksum of file. | 字符 string (MD5哈希值来自 file) | **file** - file的完整路径 | 示例:<br>=> vfs.file.md5sum\[/usr/local/etc/zabbix\_agentd.conf\]<br><br>返回值示例:<br>b5052decb577e0fffd622d6ddc017e82<br><br>file的大小限制取决于 [large file support](/manual/appendix/items/large_file_support). |
| **vfs.file.owner**\[file,<ownertype>,<resulttype>\] | <   | <   | <   |
| Retrieve owner of a file. | 字符 string | **file** - file的完整路径<br>**ownertype** - *user* (默认) 或 *group* (仅Unix)<br>**resulttype** - *name* (默认) 或 *id*; 对于id - 在Unix上返回uid/gid，在Windows上返回SID | 示例:<br>=> vfs.file.owner\[/tmp/zabbix\_server.log\] → 返回/tmp/zabbix\_server.log的file所有者<br>=> vfs.file.owner\[/tmp/zabbix\_server.log,,id\] → 返回/tmp/zabbix\_server.log的file所有者ID<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support).<br><br>自Zabbix 6.0起支持。 |
| **vfs.file.permissions**\[file\] | <   | <   | <   |
| Return a 4-digit string containing the octal number with Unix permissions. | string | **file** - file的完整路径 | Windows系统不支持此功能.<br><br>示例:<br>=> vfs.file.permissions\[/etc/passwd\] → 返回/etc/passwd的权限, 例如'0644'<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support).<br><br>自Zabbix 6.0版本起支持该功能.
| **vfs.file.regexp**\[file,regexp,<encoding>,<start line>,<end line>,<output>\] | <   | <   | <   |
| Find string in a file. | 包含匹配的string的行，或由可选的`output`参数指定 | **file** - file的完整路径<br>**regexp** - 描述所需模式的正则[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**start line** - 要搜索的首行编号（默认为file的第一行）<br>**end line** - 要搜索的末行编号（默认为file的最后一行）<br>**output** - 可选的输出格式化模板。转义序列**\\0**会被替换为匹配的文本部分（从匹配开始的首字符到匹配结束的末字符），而**\\N**（其中N=1...9）会被替换为第N个匹配组（如果N超过捕获组数量则返回空string） | 仅返回第一个匹配行。<br>如果没有行匹配表达式则返回空string。<br><br>字节顺序标记（BOM）会被排除在输出之外。<br><br>使用`output`参数的内容提取发生在agent上。<br><br>`start line`、`end line`和`output`参数从version 2.2版本开始支持。<br><br>示例：<br>=> vfs.file.regexp\[/etc/passwd,zabbix\]<br>=> vfs.file.regexp\[/path/to/some/file,"(\[0-9\]+)$",,3,5,\\1\]<br>=> vfs.file.regexp\[/etc/passwd,"\^zabbix:.:(\[0-9\]+)",,,,\\1\] → 获取用户*zabbix*的ID<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support)。 |
| **vfs.file.regmatch**\[file,regexp,<encoding>,<start line>,<end line>\] | <   | <   | <   |
| Find string in a file. | 0 - 未找到匹配项<br><br>1 - 找到匹配项 | **file** - file的完整路径<br>**regexp** - 描述所需模式的正则[概述](/manual/regular_expressions#概述)<br>**encoding** - 代码页[编码设置](/manual/config/items/itemtypes/zabbix_agent#编码设置)<br>**start line** - 搜索起始行号（默认为file的首行）<br>**end line** - 搜索结束行号（默认为file的末行） | 字节顺序标记(BOM)将被忽略<br><br>从version 2.2版本开始支持`start line`和`end line`参数<br><br>示例:<br>=> vfs.file.regmatch\[/var/log/app.log,error\]<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support) |
| **vfs.file.size**\[file,<mode>\] | <   | <   | <   |
| File size (in bytes). | integer | **file** - file的完整路径<br>**mode** - 可选值:<br>*bytes* (默认) 或 *lines* (空行也会被计数) | file必须对用户*zabbix*具有读取权限.<br><br>示例:<br>=> vfs.file.size\[/var/log/syslog\]<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support).<br><br>参数`mode`从Zabbix 6.0开始支持.
| **vfs.file.time**\[file,<mode>\] | <   | <   | <   |
| File time information. | integer (Unix时间戳) | **file** - file的完整路径<br>**mode** - 可选值:<br>*modify* (默认) - 最后修改file内容的时间,<br>*access* - 最后读取file的时间,<br>*change* - 最后更改file属性的时间 | 示例:<br>=> vfs.file.time\[/etc/passwd,modify\]<br><br>file的大小限制取决于[large file support](/manual/appendix/items/large_file_support). |
| **vfs.fs.discovery** | <   | <   | <   |
| List of mounted filesystems and their types. Used for low-level discovery. | JSON object |     | 自Zabbix 2.0起支持。<br><br>{\#FSDRIVETYPE}宏自Zabbix 3.0起在Windows系统中支持。<br><br>{\#FSLABEL}宏自Zabbix 6.0起在Windows系统中支持。 |
| **vfs.fs.get** | <   | <   | <   |
| List of mounted filesystems, their types, disk space and inode statistics. Can be used for low-level discovery. | JSON object |     | {\#FSLABEL}宏自Zabbix 6.0起在Windows系统中得到支持。<br><br>自Zabbix 6.0.11版本起，该监控项能够报告file系统中inode计数为零的情况，这种情况可能出现在采用动态inode的file系统（例如btrfs）中。 |
| **vfs.fs.inode**\[fs,<mode>\] | <   | <   | <   |
| Number or percentage of inodes. | integer - 用于数值<br><br>float - 用于百分比 | **fs** - 文件系统<br>**mode** - 可选值:<br>*total* (默认), *free*, *used*, *pfree* (空闲百分比), *pused* (已用百分比) | 自Zabbix 6.0.11起，当inode计数为零时（如采用动态inode的file系统btrfs），该监控项在pfree/pused模式下将不再显示为不支持状态。对于此类file系统，pfree/pused值将分别报告为"100"和"0"。<br><br>示例:<br>=> vfs.fs.inode\[/,pfree\] |
| **vfs.fs.size**\[fs,<mode>\] | <   | <   | <   |
| Disk space in bytes or in percentage from total. | integer - 用于字节<br><br>float - 用于百分比 | **fs** - 文件系统<br>**mode** - 可能取值:<br>*total* (默认), *free*, *used*, *pfree* (空闲百分比), *pused* (已用百分比) | 若文件系统未挂载，则返回挂载点所在本地文件系统的大小。<br><br>示例:<br>=> vfs.fs.size\[/tmp,free\]<br><br>file 系统的保留空间会被计入，但在使用 *free* 模式时不包括在内。 |

[comment]: # ({/7ea16e22-c56d4a08})

[comment]: # ({3874e6aa-d68d46db})


##### 虚拟内存数据

监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 备注 |
| **vm.memory.size**\[<mode>\] | <   | <   | <   |
| Memory size in bytes or in percentage from total. | integer - 用于字节<br><br>float - 用于百分比 | **mode** - 可选值:<br>*total* (默认值), *active*, *anon*, *buffers*, *cached*, *exec*, *file*, *free*, *inactive*, *pinned*, *shared*, *slab*, *wired*, *used*, *pused* (已使用, 百分比), *available*, *pavailable* (可用, 百分比)<br>另请参阅 [platform-specific](/manual/appendix/items/supported_by_platform) 支持和 [additional details](/manual/appendix/items/vm.memory.size_params) 关于此参数。 | 该 监控项 接受三类参数:<br><br>1) *total* - memory 总量;<br>2) 平台特定的 memory 类型: *active*, *anon*, *buffers*, *cached*, *exec*, *file*, *free*, *inactive*, *pinned*, *shared*, *slab*, *wired*;<br>3) 用户级估算的 memory 使用和可用量: *used*, *pused*, *available*, *pavailable*. |

[comment]: # ({/3874e6aa-d68d46db})

[comment]: # ({cea4874f-69e92c44})


##### Web 监控数据

| 监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 注释 |
| **web.page.get**\[host,<path>,<port>\] | <   | <   | <   |
| Get content of web page. | 网页源代码文本（包含头部信息） | **主机** - 主机名或URL（格式为`scheme://host:port/path`，其中仅*主机*为必填项）。<br>允许的URL方案：*http*、*https*^**[4](#footnotes)**^。未指定协议时默认为*http*。若指定URL，则`path`和`port`必须为空。在连接需要认证的服务器时指定用户名/密码（例如：`http://user:password@www.example.com`）仅在使用cURL支持时可用^**[4](#footnotes)**^。<br>主机名支持[Punycode](https://en.wikipedia.org/wiki/Punycode)。<br>**path** - HTML文档路径（默认为/）<br>**port** - 端口号（HTTP默认为80） | 当`host`中指定的资源不存在或不可用时，此监控项将转为不支持状态。<br><br>`host`可以是主机名、域名、IPv4或IPv6地址。但对于IPv6地址，Zabbix agent必须启用IPv6支持编译。<br><br>示例：<br>=> web.page.get\[www.example.com,index.php,80\]<br>=> web.page.get\[https://www.example.com\]<br>=> web.page.get\[https://blog.example.com/?s=zabbix\]<br>=> web.page.get\[localhost:80\]<br>=> web.page.get\["\[::1\]/server-status"\] |
| **web.page.perf**\[host,<path>,<port>\] | <   | <   | <   |
| Loading time of full web page (in seconds). | float | **主机** - 主机名或URL（格式为`scheme://host:port/path`，其中仅*主机*为必填项）。<br>允许的URL方案：*http*、*https*^**[4](#footnotes)**^。未指定协议时默认为*http*。若指定URL，则`path`和`port`必须为空。在连接需要认证的服务器时指定用户名/密码（例如：`http://user:password@www.example.com`）仅在使用cURL支持时可用^**[4](#footnotes)**^。<br>主机名支持[Punycode](https://en.wikipedia.org/wiki/Punycode)。<br>**path** - HTML文档路径（默认为/）<br>**port** - 端口号（HTTP默认为80） | 当`host`中指定的资源不存在或不可用时，此监控项将转为不支持状态。<br><br>`host`可以是主机名、域名、IPv4或IPv6地址。但对于IPv6地址，Zabbix agent必须启用IPv6支持编译。<br><br>示例：<br>=> web.page.perf\[www.example.com,index.php,80\]<br>=> web.page.perf\[https://www.example.com\] |
| **web.page.regexp**\[host,<path>,<port>,regexp,<length>,<output>\] | <   | <   | <   |
| Find string on a web page. | 匹配的string，或按可选参数`output`指定返回 | **主机** - 主机名或URL（格式为`scheme://host:port/path`，其中仅*主机*为必填项）。<br>允许的URL方案：*http*、*https*^**[4](#footnotes)**^。未指定协议时默认为*http*。若指定URL，则`path`和`port`必须为空。在连接需要认证的服务器时指定用户名/密码（例如：`http://user:password@www.example.com`）仅在使用cURL支持时可用^**[4](#footnotes)**^。<br>主机名支持[Punycode](https://en.wikipedia.org/wiki/Punycode)。<br>**path** - HTML文档路径（默认为/）<br>**port** - 端口号（HTTP默认为80）<br>**regexp** - 描述匹配模式的正则[概述](/manual/regular_expressions#概述)<br>**length** - 返回的最大字符数<br>**output** - 可选的输出格式化模板。转义序列**\\0**会被替换为匹配的文本部分（从匹配开始的首字符到匹配结束的末字符），而**\\N**（N=1...9）会被替换为第N个捕获组（若N超过捕获组数量则返回空string）。 | 当`host`中指定的资源不存在或不可用时，此监控项将转为不支持状态。<br><br>`host`可以是主机名、域名、IPv4或IPv6地址。但对于IPv6地址，Zabbix agent必须启用IPv6支持编译。<br><br>使用`output`参数的内容提取操作在agent端执行。<br><br>`output`参数自version 2.2版本起支持。<br><br>示例：<br>=> web.page.regexp\[www.example.com,index.php,80,OK,2\]<br>=> web.page.regexp\[https://www.example.com,,,OK,2\] |

[comment]: # ({/cea4874f-69e92c44})

[comment]: # ({ddae320c-24553242})


##### Zabbix 指标

| 监控项 键 | <   | <   | <   |
|--|--|------|------|
| Description | 返回值 | 参数 | 注释 |
| **agent.hostmetadata** | <   | <   | <   |
| Agent host metadata. | string |     | 返回HostMetadata或HostMetadataItem参数的值，若未定义则返回空string<br><br>自Zabbix 6.0起支持 |
| **agent.hostname** | <   | <   | <   |
| Agent host name. | string |     | 返回:<br>被动检查时 - agent配置file中Hostname参数列出的首个主机名称;<br>主动检查时 - 当前主机名 |
| **agent.ping** | <   | <   | <   |
| Agent availability check. | 无 - 不可用<br><br>1 - 可用 |     | 使用**nodata()**触发器函数检查主机不可用状态 |
| **agent.variant** | <   | <   | <   |
| Variant of Zabbix agent (Zabbix agent or Zabbix agent 2). | integer |     | 返回值示例:<br>1 - Zabbix agent<br>2 - Zabbix agent 2 |
| **agent.version** | <   | <   | <   |
| Version of Zabbix agent. | string |     | 返回值示例:<br>6.0.3 |
| **zabbix.stats**\[<ip>,<port>\] | <   | <   | <   |
| Return a set of Zabbix server or proxy internal metrics remotely. | JSON object | **ip** - 要远程查询的服务器/proxies的IP/DNS/网络掩码列表(默认为127.0.0.1)<br>**port** - 要远程查询的server/proxy端口(默认为10051) | 注意：统计请求仅会接受目标实例上'StatsAllowedIP'[server](/manual/appendix/config/zabbix_server)/[proxy](/manual/appendix/config/zabbix_proxy)参数中列出的地址<br><br>此监控项返回一组选定的内部指标。详情参见[暴露的指标](/manual/appendix/items/remote_stats#暴露的指标) |
| **zabbix.stats**\[<ip>,<port>,queue,<from>,<to>\] | <   | <   | <   |
| Return number of monitored items in the queue which are delayed on Zabbix server or proxy remotely. | JSON object | **ip** - 要远程查询的服务器/proxies的IP/DNS/网络掩码列表(默认为127.0.0.1)<br>**port** - 要远程查询的server/proxy端口(默认为10051)<br>**queue** - 常量(按原样使用)<br>**from** - 至少延迟(默认为6秒)<br>**to** - 最多延迟(默认为无限) | 注意：统计请求仅会接受目标实例上'StatsAllowedIP'[server](/manual/appendix/config/zabbix_server)/[proxy](/manual/appendix/config/zabbix_proxy)参数中列出的地址 |

[comment]: # ({/ddae320c-24553242})

[comment]: # ({20fbd028-7c273fec})
##### 脚注

^**1**^ Linux系统特定说明。Zabbix agent必须对*/proc*文件系统具有只读访问权限。来自www.grsecurity.org的内核补丁会限制非特权用户的访问权限。

^**2**^ `vfs.dev.read[]`、`vfs.dev.write[]`：如果监控项值超过3小时未被访问，Zabbix agent将终止"陈旧"的设备连接。这种情况可能发生在系统具有动态变化路径的设备，或设备被手动移除时。还需注意，如果这些监控项使用update间隔为3小时或更长，将始终返回'0'。

^**3**^ `vfs.dev.read[]`、`vfs.dev.write[]`：如果第一个参数使用默认值*all*，则该键将返回汇总统计信息，包括所有块设备如sda、sdb及其分区(sda1、sda2、sdb3...)以及基于这些块设备/分区的多设备(MD raid)和逻辑卷(LVM)。在这种情况下，返回值应仅被视为相对值(随时间动态变化)而非绝对值。

^**4**^ 仅当agent编译时支持cURL时，才支持SSL(HTTPS)。否则监控项将变为不支持状态。

[comment]: # ({/20fbd028-7c273fec})

[comment]: # ({fc4df521-5a56e81d})
#### 编码设置

为确保获取的数据未被损坏，您可以指定
处理检查的正确编码（例如'vfs.file.contents'）
在`encoding`参数中。支持的编码列表（代码页
标识符）可在文档中找到
[libiconv](http://www.gnu.org/software/libiconv/) (GNU项目) 或位于
Microsoft Windows SDK文档中的"代码页标识符"部分

如果未在`encoding`参数中指定编码，则以下
应用的解决策略包括：

- 如果未指定编码（或为空string），则默认采用UTF-8编码，数据将按"原样"处理；
-  BOM分析 - 适用于监控项 'vfs.file.contents'
    'vfs.file.regexp', 'vfs.file.regmatch'. 系统会尝试
    通过使用字节顺序标记（BOM）确定正确的编码
    file的开头。如果BOM不存在 - 标准
    分辨率（见上文）将被替代应用。

[comment]: # ({/fc4df521-5a56e81d})

[comment]: # ({be25972d-be25972d})
#### 故障排查 agent 监控项

-   如果与被动agent一起使用，服务器配置中的*Timeout*值可能需要大于agent配置file中的*Timeout*。否则监控项可能无法get任何值，因为服务器对agent的请求首先超时。

[comment]: # ({/be25972d-be25972d})
