Alert:
该类与警报一起工作
alert.get: 检索警报
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);
}
}