Windows Zabbix agent 监控项 分为两个列表呈现:
请注意 Windows 版 Zabbix agent 支持的所有 监控项 键值同样适用于新一代 Zabbix agent 2. 参阅仅适用于 agent 2 的 additional item keys.
另请参阅: Minimum permissions for Windows items
下表列出了Windows平台支持并与UNIX Zabbix agent共享的Zabbix agent 监控项:
| 监控项键 | 描述 | 监控项组 |
|---|---|---|
| log | 监控日志file. 此监控项不支持Windows事件日志.persistent_dir参数在Windows上不受支持. |
Log monitoring |
| log.count | 监控日志file中匹配行的计数. 此监控项不支持Windows事件日志.persistent_dir参数在Windows上不受支持. |
|
| logrt | 监控轮转的日志file. 此监控项不支持Windows事件日志.persistent_dir参数在Windows上不受支持. |
|
| logrt.count | 监控轮转日志file中匹配行的计数. 此监控项不支持Windows事件日志.persistent_dir参数在Windows上不受支持. |
|
| modbus.get | 读取Modbus数据. | Modbus |
| net.dns | 检查DNS服务是否运行. 除非使用Zabbix agent 2, 否则 ip, timeout和count参数在Windows上会被忽略. |
Network |
| net.dns.perf | 检查DNS服务性能. 除非使用Zabbix agent 2, 否则 ip, timeout和count参数在Windows上会被忽略. |
|
| net.dns.record | 执行DNS query. 除非使用Zabbix agent 2, 否则 ip, timeout和count参数在Windows上会被忽略. |
|
| net.if.discovery | 网络接口列表. 某些Windows版本(如Server 2008)可能需要安装最新更新以支持接口名称中的非ASCII字符. |
|
| net.if.in | 网络接口的入站流量统计. 在Windows上, 如果可用, 监控项会从64位计数器获取值. 64位接口统计计数器在Windows Vista和Windows Server 2008中引入. 如果64位计数器不可用, agent会使用32位计数器. 支持Windows上的多字节接口名称. 可通过net.if.discovery或net.if.list 监控项获取Windows上的网络接口描述. |
|
| net.if.out | 网络接口的出站流量统计. 在Windows上, 如果可用, 监控项会从64位计数器获取值. 64位接口统计计数器在Windows Vista和Windows Server 2008中引入. 如果64位计数器不可用, agent会使用32位计数器. 支持Windows上的多字节接口名称. 可通过net.if.discovery或net.if.list 监控项获取Windows上的网络接口描述. |
|
| net.if.total | 网络接口的入站和出站流量统计总和. 在Windows上, 如果可用, 监控项会从64位计数器获取值. 64位接口统计计数器在Windows Vista和Windows Server 2008中引入. 如果64位计数器不可用, agent会使用32位计数器. 可通过net.if.discovery或net.if.list 监控项获取Windows上的网络接口描述. |
|
| net.tcp.listen | 检查TCP端口是否处于LISTEN状态. | |
| net.tcp.port | 检查是否可以在指定端口建立TCP连接. | |
| net.tcp.service | 检查服务是否正在运行并接受TCP连接. 在Windows上检查LDAP和HTTPS仅支持Zabbix agent 2. |
|
| net.tcp.service.perf | 检查TCP服务性能. 在Windows上检查LDAP和HTTPS仅支持Zabbix agent 2. |
|
| net.tcp.socket.count | 返回匹配参数的TCP套接字数量. 此监控项在Linux上由Zabbix agent支持, 但在Windows上仅由64位Windows上的Zabbix agent 2支持. |
|
| net.udp.service | 检查服务是否正在运行并响应UDP请求. | |
| net.udp.service.perf | 检查UDP服务性能. | |
| net.udp.socket.count | 返回匹配参数的UDP套接字数量. 此监控项在Linux上由Zabbix agent支持, 但在Windows上仅由64位Windows上的Zabbix agent 2支持. |
|
| proc.get | 操作系统进程列表及其参数.cmdline参数在Windows上不受支持. |
Processes |
| proc.num | 进程数量. 在Windows上, 仅支持 name和user参数. |
|
| system.cpu.discovery | 检测到的CPU/CPU核心列表. | System |
| system.cpu.load | CPU负载. 当在Zabbix agent上启动收集器进程时, 会初始化以下性能计数器并随后用于此监控项: \System\Processor Queue Length |
|
| system.cpu.num | CPU数量. | |
| system.cpu.util | CPU利用率百分比. 使用Processor Time性能计数器获取值. 注意从Windows 8开始, 其任务管理器基于Processor Utility性能计数器显示CPU利用率, 而早期版本使用Processor Time计数器(参见more details). 在Windows上仅支持 type参数的system值. |
|
| system.hostname | 系统主机名. 在Windows上通过GetComputerName()(用于netbios), GetComputerNameExA()(用于fqdn)或gethostname()(用于主机)函数获取值. 另见配置-agent. |
|
| system.localtime | 系统时间. | |
| system.run | 在主机上运行指定命令. | |
| system.sw.arch | 软件架构信息. | |
| system.swap.size | 交换空间大小(字节或占总量的百分比).pused类型参数在Linux上由Zabbix agent支持, 但在Windows上仅由Zabbix agent 2支持.注意此键可能在虚拟化(VMware ESXi, VirtualBox)Windows平台上报告不正确的交换空间大小/百分比. 这种情况下可使用 perf_counter[\700(_Total)\702]键获取正确的交换空间百分比. |
|
| system.uname | 系统标识. 在Windows上此监控项的值从Win32_OperatingSystem和Win32_Processor WMI类获取. 操作系统名称(包括版本)可能被翻译为用户显示语言. 在某些Windows版本上包含商标符号和额外空格. |
|
| system.uptime | 系统运行时间(秒). | |
| vfs.dir.count | 目录条目计数. 在Windows上, 目录符号链接会被跳过且硬链接只计数一次. |
Virtual file systems |
| vfs.dir.get | 目录条目列表. 在Windows上, 目录符号链接会被跳过且硬链接只计数一次. |
|
| vfs.dir.size | 目录大小. 在Windows上任何符号链接都会被跳过且硬链接只计算一次. |
|
| vfs.file.cksum | file校验和, 通过UNIX cksum算法计算. | |
| vfs.file.contents | 检索file内容. | |
| vfs.file.exists | 检查file是否存在. 在Windows上使用命令行工具调用zabbix_get.exe或agent2时, 双引号必须用反斜杠'\'转义且整个监控项键要用双引号括起来. 注意如果在不存在的目录中搜索目录, 此监控项可能在Windows上变为不受支持, 例如 vfs.file.exists[C:\no\dir,dir](其中'no'不存在). |
|
| vfs.file.get | 返回file信息. Windows上支持的file类型: 常规file, 目录, 符号链接 |
|
| vfs.file.md5sum | file的MD5校验和. | |
| vfs.file.owner | 获取file的所有者. | |
| vfs.file.regexp | 在file中检索string. | |
| vfs.file.regmatch | 在file中查找string. | |
| vfs.file.size | file大小. | |
| vfs.file.time | file时间信息. 在Windows XP上 vfs.file.time[file,change]可能等于vfs.file.time[file,access]. |
|
| vfs.fs.discovery | 已挂载文件系统列表及其类型和挂载选项. Windows上支持{#FSLABEL}宏. |
|
| vfs.fs.get | 已挂载文件系统列表及其类型, 可用磁盘空间, inode统计和挂载选项. Windows上支持{#FSLABEL}宏. |
|
| vfs.fs.size | 磁盘空间(字节或占总量的百分比). | |
| vm.memory.size | memory大小(字节或占总量的百分比). | Virtual memory |
| web.page.get | 获取网页内容. | Web monitoring |
| web.page.perf | 完整网页加载时间. | |
| web.page.regexp | 在网页上查找string. | |
| agent.hostmetadata | agent 主机元数据. | Zabbix |
| agent.hostname | agent 主机名. | |
| agent.ping | agent可用性检查. | |
| agent.variant | Zabbix agent变体(Zabbix agent或Zabbix agent 2). | |
| agent.version | Zabbix agent的version. | |
| zabbix.stats | 远程返回一组Zabbix server或proxy内部指标. | |
| zabbix.stats | 远程返回Zabbix server或proxy上延迟的监控监控项队列数量. |
下表提供了仅由 Windows Zabbix agent 支持的 监控项 键的详细信息。
Windows 特有的 监控项 有时是类似功能的近似对应项 agent 监控项,例如 proc_info,在 Windows 上受支持,大致对应 到 proc.mem 监控项,Windows 上不支持。
“监控项”键是完整“监控项”键详细信息的链接。
| 监控项 监控项 键值 | 描述 | 监控项 监控项 所属主机组 |
|---|---|---|
| eventlog | Windows事件日志监控。 | 日志监控 |
| eventlog.count | Windows事件日志中的行数统计。 | |
| net.if.list | 网络接口列表(包含接口类型、状态、IPv4地址、描述)。 | 网络 |
| perf_counter | 任何 Windows 性能计数器的值。 | 性能计数器 |
| perf_counter_en | 任何英文的Windows性能计数器的值。 | |
| perf_instance.discovery | Windows性能计数器的object实例列表。 | |
| perf_instance_en.discovery | 使用英文的 object 名称发现的 Windows 性能计数器的 object 实例列表。 | |
| proc_info | 关于特定进程(们)的各种信息。 | 进程 |
| registry.data | 返回 Windows 注册表项中指定值名称的数据。 | 注册表 |
| registry.get | 位于指定键下的 Windows 注册表值或键的列表。 | |
| service.discovery | Windows服务列表。 | 服务 |
| service.info | 有关服务的信息。 | |
| services | 服务列表。 | |
| vm.vmemory.size | 虚拟 memory 大小(以字节或占总量的百分比表示)。 | 虚拟内存 |
| wmi.get | 执行一个 WMI query 并返回第一个选定的 object。 | WMI |
| wmi.getall | 执行 WMI query 并返回整个响应。 |
不带尖括号的参数是必选的。 标记有尖括号 < > 的参数是可选的。
事件日志监控。
返回值: Log.
参数:
注释:
示例:
eventlog[Application]
eventlog[Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant]
eventlog[Security,,"Failure Audit",,^(529|680)$]
eventlog[System,,"Warning|Error"]
eventlog[System,,,,^1$]
eventlog[Windows PowerShell,,,,,,skip]
eventlog[System,,,,@TWOSHORT] #here a custom regular expression named `TWOSHORT` is referenced (defined as a *Result is TRUE* type, the expression itself being `^1$|^70$`).
Windows事件日志中的行数统计.
返回值: integer.
参数:
注释:
示例:
网络接口列表(包括接口类型、状态、IPv4地址、描述)。
返回值:文本。
备注:
任何Windows性能计数器的值。
返回值:integer、float、string 或 文本(根据请求类型而定)。
参数:
interval 必须介于1至900秒之间(含边界值),默认值为1。注释:
interval 适用于需要多个采样值的计数器(如CPU利用率),该检查每次会返回最近"interval"秒内的平均值;
任意Windows性能计数器的英文名称值.
返回值: integer, float, string 或 文本 (取决于请求类型).
参数:
interval 必须介于1到900秒之间(含边界值),默认值为1.注释:
interval 适用于需要多个采样值的计数器(如CPU利用率),因此每次检查都会返回最近"interval"秒内的平均值;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009.
Windows性能计数器的object实例列表. 用于low-level discovery.
返回值: JSON object.
参数:
Windows性能计数器的object实例列表,使用英文object名称发现。 用于low-level discovery。
返回值:JSON object。
参数:
关于特定进程的各类信息。
返回值: float.
参数:
注释:
attributes:types包括:示例:
proc_info[iexplore.exe,wkset,sum] #retrieve the amount of physical memory taken by all Internet Explorer processes
proc_info[iexplore.exe,pf,avg] #retrieve the average number of page faults for Internet Explorer processes
返回Windows注册表键中指定值名称的数据。
返回值:integer、string 或 文本(取决于值类型)
参数:
注释:
示例:
registry.data["HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting"] #return the data of the default value of this key
registry.data["HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting","EnableZip"] #return the data of the value named "Enable Zip" in this key
位于给定注册表键下的Windows注册表值或键的列表。
返回值:JSON object.
参数:
mode为values时允许使用。包含空格的键必须使用双引号包裹。
示例:
registry.get[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,values,"^DisplayName|DisplayVersion$"] #return the data of the values named "DisplayName" or "DisplayValue" in this key.
The JSON will include details of the key, last subkey, value name, value type and value data.
registry.get[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,values] #return the data of the all values in this key.
The JSON will include details of the key, last subkey, value name, value type and value data.
registry.get[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,keys] #return all subkeys of this key.
The JSON will include details of the key and last subkey.
Windows服务列表 用于low-level discovery
返回值: JSON object
关于服务的信息。
返回值: integer - 包含 param 作为 state, startup; string - 包含 param 作为 displayname, path, user; Text - 包含 param 作为 description
特别针对 state: 0 - 运行中, 1 - 已暂停, 2 - 启动挂起, 3 - 暂停挂起, 4 - 继续挂起, 5 - 停止挂起, 6 - 已停止, 7 - 未知, 255 - 无此服务
特别针对 startup: 0 - 自动, 1 - 自动延迟, 2 - 手动, 3 - 禁用, 4 - 未知, 5 - 自动触发启动, 6 - 自动延迟触发启动, 7 - 手动触发启动
参数:
注释:
service.info[service,state] 和 service.info[service] 将返回相同的信息;param 作为 state 时,此 监控项 会为不存在的服务返回值(255).示例:
service.info[SNMPTRAP] - state of the SNMPTRAP service;
service.info[SNMP Trap] - state of the same service, but with the display name specified;
service.info[EventLog,startup] - the startup type of the EventLog service
服务列表.
返回值: 0 - 如果为空; Text - 以换行符分隔的服务列表.
参数:
示例:
services[,started] #returns the list of started services;
services[automatic, stopped] #returns the list of stopped services that should be running;
services[automatic, stopped, "service1,service2,service3"] #returns the list of stopped services that should be running, excluding services named "service1", "service2" and "service3"
虚拟memory的大小,以字节或占总量的百分比表示。
返回值:integer - 表示字节;float - 表示百分比。
参数:
注释:
虚拟memory统计的监控基于:
示例:
执行WMI query并返回第一个选中的object.
返回值: integer, float, string 或 text (取决于请求类型).
参数:
WMI queries通过WQL执行.
示例:
wmi.get[root\cimv2,select status from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%'] #returns the status of the first physical disk
执行WMI query并返回完整响应. 可用于low-level discovery.
返回值: JSON object
参数:
注释:
示例:
wmi.getall[root\cimv2,select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE%'] #returns status information of physical disks本教程提供逐步指导,用于设置Windows服务的监控。 假设Zabbix server和agent已配置并正常运行。
获取服务名称.
您可以通过get进入MMC服务管理单元并查看服务属性来获取服务名称. 在常规选项卡中,您会看到一个名为"服务名称"的字段. 该字段后面的值就是您在设置监控项进行监控时需要使用的名称. 例如,如果您想监控"workstation"服务,那么您的服务名称可能是: lanmanworkstation.
Configure an item 用于监控服务
监控项 service.info[service,<param>] 可获取特定服务的信息 根据所需信息类型 需指定param选项 该选项接受以下值: displayname, state, path, user, startup 或 description 若未指定param 则默认值为state (service.info[service])
返回值类型取决于所选的param: state和startup返回integer; displayname, path和user返回字符型string; description返回文本型
示例:
service.info[lanmanworkstation]监控项 service.info[lanmanworkstation] 将以数值形式获取服务状态信息 要在前端将数值映射为文本表示(如"0"对应"运行中" "1"对应"已暂停"等) 可在配置监控项的主机上配置配置 具体操作方式: 将关联模板中的Windows services by Zabbix agent或Windows services by Zabbix agent active关联至主机 或在主机上基于模板中配置的Windows service state值映射配置新的值映射
注意上述模板均配置了自动发现服务的发现规则 若不需要此功能 可在模板关联至主机后 在主机层级disable the discovery rule该规则
Low-level discovery 提供了一种自动create监控项的方法,可为计算机上的不同实体自动创建触发器与图形。 Zabbix能自动开始监控您机器上的Windows服务,无需知晓服务的确切名称或手动为每个服务create监控项。 通过过滤器可generate仅针对关注的服务生成真实的监控项、触发器及图形。