use of org.commonjava.indy.metrics.zabbix.api.IndyZabbixApi in project indy by Commonjava.
the class IndyZabbixSender method zabbixApiInit.
private void zabbixApiInit() throws IndyMetricsException, IOException, IndyHttpException {
if (!bCreateNotExistZabbixApi) {
return;
}
if (this.zabbixHostUrl == null || "".equals(this.zabbixHostUrl)) {
throw new IndyMetricsException("can not find Zabbix's Host");
}
zabbixApi = new IndyZabbixApi(this.zabbixHostUrl, indyHttpProvider.createClient(new URL(zabbixHostUrl).getHost()));
zabbixApi.init();
if (this.zabbixUserName == null || "".equals(this.zabbixUserName) || this.zabbixUserPwd == null || "".equals(this.zabbixUserPwd)) {
throw new IndyMetricsException("can not find Zabbix's username or password");
}
boolean login = zabbixApi.login(this.zabbixUserName, this.zabbixUserPwd);
logger.info("User:" + this.zabbixUserName + " login is " + login);
}
Aggregations