Zabbix Json Api获取主机或主机组的运行状况

Zabbix Json Api获取主机或主机组的运行状况,json,api,zabbix,Json,Api,Zabbix,我目前正在试用Zabbix 2.4 json api,可以连接获取警报和触发器,但我很难找到一种方法来检查给定的主机组是否没有打开的错误,因此是否健康。一个简单的检查方法似乎不存在?我搜索了stackoverflow、google和Zabbix文档。关于解决这个问题有什么线索吗?下面的reuqest给出了错误,但无法判断错误是否仍然存在 { "jsonrpc": "2.0", "method": "alert.get", "params": { "output": "extend", "grou

我目前正在试用Zabbix 2.4 json api,可以连接获取警报和触发器,但我很难找到一种方法来检查给定的主机组是否没有打开的错误,因此是否健康。一个简单的检查方法似乎不存在?我搜索了stackoverflow、google和Zabbix文档。关于解决这个问题有什么线索吗?下面的reuqest给出了错误,但无法判断错误是否仍然存在

{
"jsonrpc": "2.0",
"method": "alert.get",
"params": {
"output": "extend",
"groupids": "83",
"time_from": "1441065600"
},
"auth": "ZZZZZZZZZZZZZZZZZZZZZZZZZ",
"id": 1
}
更新:(已解决)

$resource=”http://zabbix/api_jsonrpc.php"
$body=
{
“jsonrpc”:“2.0”,
“方法”:“trigger.get”,
“参数”:{
“主动”:1,
“仅适用于”:“1”,
“监视器”:1,
“选择组”:1,
“输出”:“扩展”,
“expandDescription”:“1”,
“选择组”:“1”,

“GroupID”:83,使用主机/组的活动触发器。我使用的一些代码:

zapi.trigger.get(only_true=1,
        skipDependent=1,
        monitored=1,
        active=1,
        output='extend',
        expandDescription=1,
        selectGroups=1,
        expandData='host',
        hostids=<host_id>,
        sortfield='priority',
        sortorder='DESC',
        filter={"value": 1, "priority": ['4','5']}
    )
zapi.trigger.get(仅_true=1,
skipDependent=1,
监控=1,
活动=1,
输出='extend',
expandDescription=1,
selectGroups=1,
expandData='host',
hostids=,
sortfield='priority',
sortorder='DESC',
筛选器={“值”:1,“优先级”:['4','5']}
)

使用主机/组的活动触发器。我使用的一些代码:

zapi.trigger.get(only_true=1,
        skipDependent=1,
        monitored=1,
        active=1,
        output='extend',
        expandDescription=1,
        selectGroups=1,
        expandData='host',
        hostids=<host_id>,
        sortfield='priority',
        sortorder='DESC',
        filter={"value": 1, "priority": ['4','5']}
    )
zapi.trigger.get(仅_true=1,
skipDependent=1,
监控=1,
活动=1,
输出='extend',
expandDescription=1,
selectGroups=1,
expandData='host',
hostids=,
sortfield='priority',
sortorder='DESC',
筛选器={“值”:1,“优先级”:['4','5']}
)

谢谢,我已成功地将您的示例转换为powershell启动的json请求,我已更新了我的工作示例谢谢,我已成功地将您的示例转换为powershell启动的json请求,我已更新了我的工作示例