Alert:
該類與警報(bào)一起工作
alert.get: 檢索警報(bào)
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import com.zabbix4j.alert.AlertGetRequest;
import com.zabbix4j.alert.AlertGetResponse;
import cn.com.yeexun.testzabbix.zabbix4j.common.ZabbixApiTestBase;
/**
* Created by Suguru Yajima on 2014/05/21.
*/
public class AlertGetTest extends ZabbixApiTestBase {
public AlertGetTest() {
super();
}
@Test
public void testGet1() throws Exception {
AlertGetRequest request = new AlertGetRequest();
AlertGetRequest.Params params = request.getParams();
params.addHostId(10084);
AlertGetResponse response = zabbixApi.alert().get(request);
assertNotNull(response);
}
}