Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
J
jfzabbix
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • jfmonitor
  • jfzabbix
  • Wiki
  • 获取网络流入流量

获取网络流入流量

Last edited by zhengtianbao Apr 12, 2018
Page history

网络流入流量

与网络流出流量同理, search key 值改为 "net.if.in"

Payload:

{
    "jsonrpc": "2.0",
    "method": "item.get",
    "params": {
        "output": ["itemid","hostid","key_","value_type","status","units"],
        "hostids": "10254",
        "search": {
            "key_": "net.if.out"
        },
        "sortfield": "name"
    },
    "auth": "54ec7f0d103f635ada0a76147d8a93a5",
    "id": 1
}

Response:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "itemid": "28291",
      "hostid": "10254",
      "key_": "net.if.in[br-035628d874f9]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    },
    {
      "itemid": "28292",
      "hostid": "10254",
      "key_": "net.if.in[veth399f0a6]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    },
    {
      "itemid": "28293",
      "hostid": "10254",
      "key_": "net.if.in[vethc9dcaea]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    },
    {
      "itemid": "28294",
      "hostid": "10254",
      "key_": "net.if.in[vetha85b25b]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    },
    {
      "itemid": "28295",
      "hostid": "10254",
      "key_": "net.if.in[ens33]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    },
    {
      "itemid": "28296",
      "hostid": "10254",
      "key_": "net.if.in[docker0]",
      "value_type": "3",
      "status": "0",
      "units": "bps"
    }
  ],
  "id": 1
}

获取网卡ens33的入口流量, 通过其itemid 28295

Payload:

{
    "jsonrpc": "2.0",
    "method": "history.get",
    "params": { 
        "output": "extend",
        "history": 3,
        "itemids": "28295",
        "sortfield": "clock",
        "sortorder": "DESC",
        "limit": 10
    },
    "auth": "54ec7f0d103f635ada0a76147d8a93a5",
    "id": 1 
}   

Response:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "itemid": "28295",
      "clock": "1523522555",
      "value": "2552",
      "ns": "524145941"
    },
    {
      "itemid": "28295",
      "clock": "1523522495",
      "value": "4600",
      "ns": "261415122"
    },
    {
      "itemid": "28295",
      "clock": "1523522435",
      "value": "5064",
      "ns": "88853085"
    },
    ...
    ...
    {
      "itemid": "28295",
      "clock": "1523522135",
      "value": "2728",
      "ns": "964510570"
    },
    {
      "itemid": "28295",
      "clock": "1523522075",
      "value": "2600",
      "ns": "708474610"
    },
    {
      "itemid": "28295",
      "clock": "1523522015",
      "value": "2224",
      "ns": "445421818"
    }
  ],
  "id": 1
}

注意: 可以通过itemids列表中加入多个itemid 批量获取数据

Clone repository
  • Home
  • Zabbix api ref
  • Zabbix_agent安装配置
  • Zabbix_server安装配置
  • 产品原型图
  • 创建报警规则
  • 创建用户组, 用户
  • 删除报警规则
  • 删除用户, 用户组
  • 测试脚本
  • 登入登出
  • 获取cpu使用率
  • 获取主机信息
  • 获取内存使用率
  • 获取报警信息
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.