| 
   Key  
 
 
 
 
vfs.file.cksum[file]  
 
示例: 
 ⇒ vfs.file.cksum[/etc/passwd] 
  
 返回值示例: 
 1938292000 
  
 旧命名: cksum  
 
 
vfs.file.contents[file,<encoding>]  
 
file -  文件完整路径 encoding - 编码 返回一个空字符串,如果该文件为空或只包含LF/CR字符  
 示例: 
 ⇒ vfs.file.contents[/etc/passwd] 
  
 文件大小不能超过64 Kbytes.
  
 
 
vfs.file.exists[file]  
 
0 - 不存在 
  
 1 - 存在一般文件或链接(软链接或硬链接)至一般文件 示例: 
 ⇒  vfs.file.exists[/tmp/application.pid] 
  
 返回值取决于S_ISREG POSIX宏返回的内容  
 
 
vfs.file.md5sum[file]  
 
示例: 
 ⇒  vfs.file.md5sum[/usr/local/etc/zabbix_agentd.conf] 
  
 返回值示例: 
 b5052decb577e0fffd622d6ddc017e82  
 
 
vfs.file.regexp[file,regexp,<encoding>,<start  line>,<end line>,<output>]  
 
file -  文件完整路径 
 regexp - 正则表达式 
 encoding - 编码 
 start line -搜索起始行号 (默认为首行). 
 end line - 搜索结束行号 (默认最后一行). 
 output - 可选的输出格式模板.  \0 被转义输出为匹配的文本而 \N (其中 N=1…9)被转义输出为第N个匹配组 (当N超过匹配到的数量时为空字符串). 只返回第一个匹配到的行. 
 如果未匹配到则返回空字符串. 
  
 在agent上使用输出参数提取正文. 
  
 start line, end line 和 output 参数在zabbix 2.2被支持. 
  
 示例: 
 ⇒ vfs.file.regexp[/etc/passwd,zabbix] 
 ⇒  vfs.file.regexp[/path/to/some/file,"([0-9]+)$",,3,5,\1] 
 ⇒  vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1] → getting the ID of  user zabbix  
 
 
vfs.file.regmatch[file,regexp,<encoding>,<start  line>,<end line>]  
 
file -  文件完整路径 
 regexp - 正则表达式 
 encoding - 编码 
 start line -搜索起始行号 (默认为首行). 
 end line - 搜索结束行号 (默认最后一行). start line, end line 和 output 参数在zabbix 2.2被支持. 
  
 示例: 
 ⇒  vfs.file.regmatch[/var/log/app.log,error]  
 
 
vfs.file.size[file]  
 
zabbix用户对该文件需有可读权限 
  
 示例: 
 ⇒ vfs.file.size[/var/log/syslog]  
 
 
vfs.file.time[file,<mode>]  
 
file -  文件完整路径 
 mode - 可用值: 
 modify (默认) - 内容变动时间, access -访问时间, change -  修改时间 示例: 
 ⇒ vfs.file.time[/etc/passwd,modify]  
 
 
vfs.fs.discovery  
 
 
 
 
vfs.fs.inode[fs,<mode>]  
 
fs -  文件系统 
 mode - 可用值:  
 total (默认), free, used, pfree (可用百分比), pused (使用百分比) 示例: 
 ⇒ vfs.fs.inode[/,pfree]  
  
 旧命名:  vfs.fs.inode.free, vfs.fs.inode.pfree, vfs.fs.inode.total  
 
 
vfs.fs.size[fs,<mode>]  
 
fs -  文件系统 
 mode - 可用值:  
 total (默认), free, used, pfree (可用百分比), pused (使用百分比) 在已挂载卷的情况下,返回本地文件系统的磁盘空间  
 示例: 
 ⇒ vfs.fs.size[/tmp,free] 
  
 使用free模式时不考虑一个文件系统的预留空间. 
  
 旧命名:
  vfs.fs.free, vfs.fs.total, vfs.fs.used, vfs.fs.pfree, vfs.fs.pused  
 
 
vm.memory.size[<mode>]  
 
mode -  可用值:  
 total (默认), active, anon, buffers, cached, exec, file, free, inactive, pinned,shared, wired, used, pused (使用百分比), available, pavailable (可用百分比) 接受三个类别的参数: 
  
 1) total - 内存总量; 
 2) 平台特定的内存类型:  active, anon, buffers, cached, exec, file, free, inactive, pinned,shared, wired; 
 3) 用户级别衡量的使用量和可用量:  used, pused, available,pavailable. 
  
 旧命名:  vm.memory.buffers, vm.memory.cached, vm.memory.free, vm.memory.shared,vm.memory.total  
 
 
web.page.get[host,<path>,<port>]  
 
host -  主机名/域名 
 path - 存放路径(默认为”/”) 
 port - 端口号 (默认为80) 返回空字符串表示失败.  
 
 示例: 
 ⇒  web.page.get[  ,index.php,80]  
 
 
web.page.perf[host,<path>,<port>]  
 
host -  主机名/域名 
 path - 存放路径(默认为”/”) 
 port - 端口号 (默认为80) 返回0表示失败.  
 
 示例: 
 ⇒  web.page.perf[  ,index.php,80]  
 
 
web.page.regexp[host,<path>,<port>,<regexp>,<length>,<output>]  
 
host -  主机名/域名 
 path - 存放路径(默认为”/”) 
 port - 端口号 (默认为80) regexp - 正则表达式 
 length - 返回最大字符串长度 
 output - 可选的输出格式模板.  \0 被转义输出为匹配的文本而 \N (其中 N=1…9)被转义输出为第N个匹配组 (当N超过匹配到的数量时为空字符串). 返回空字符串表示未匹配到内容. 
 
 在agent上使用输出参数提取正文.
  
 示例: 
 ⇒  web.page.regexp[  ,index.php,80,OK,2]  原创:开源联盟  
 |