获取主机信息
request:
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10254",
"search": {
"key_": "sysinfo"
}
},
"auth": "54ec7f0d103f635ada0a76147d8a93a5",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"itemid": "28312",
"type": "0",
"snmp_community": "",
"snmp_oid": "",
"hostid": "10254",
"name": "System Infomation",
"key_": "sysinfo",
"delay": "1h",
"history": "1w",
"trends": "0",
"status": "0",
"value_type": "4",
"trapper_hosts": "",
"units": "",
"snmpv3_securityname": "",
"snmpv3_securitylevel": "0",
"snmpv3_authpassphrase": "",
"snmpv3_privpassphrase": "",
"formula": "",
"error": "",
"lastlogsize": "0",
"logtimefmt": "",
"templateid": "28311",
"valuemapid": "0",
"params": "",
"ipmi_sensor": "",
"authtype": "0",
"username": "",
"password": "",
"publickey": "",
"privatekey": "",
"mtime": "0",
"flags": "0",
"interfaceid": "2",
"port": "",
"description": "",
"inventory_link": "0",
"lifetime": "30d",
"snmpv3_authprotocol": "0",
"snmpv3_privprotocol": "0",
"state": "0",
"snmpv3_contextname": "",
"evaltype": "0",
"jmx_endpoint": "",
"master_itemid": "0",
"lastclock": "1525308712",
"lastns": "428676198",
"lastvalue": "{\"disk\": [{\"sda\": \"20G\"}], \"ip\": [{\"ens33\": \"192.168.1.134\"}], \"memory\": {\"size\": \"4G\"}, \"system\": {\"uname\": \"Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\", \"bit\": \"64\", \"uptime\": \"2774908.98\", \"kernel\": \"3.10.0-693.el7.x86_64\"}, \"cup\": {\"info\": \"Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz\", \"cores\": \"1\"}}",
"prevvalue": "{\"disk\": [{\"sda\": \"20G\"}], \"ip\": [{\"ens33\": \"192.168.1.134\"}], \"memory\": {\"size\": \"4G\"}, \"system\": {\"uname\": \"Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\", \"bit\": \"64\", \"uptime\": \"2771309.73\", \"kernel\": \"3.10.0-693.el7.x86_64\"}, \"cup\": {\"info\": \"Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz\", \"cores\": \"1\"}}"
}
],
"id": 1
}