- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService
类的一些代码示例,展示了ZabbixHistoryService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZabbixHistoryService
类的具体详情如下:
包路径:com.sdg.cmdb.service.ZabbixHistoryService
类名称:ZabbixHistoryService
[英]Created by liangjian on 2017/2/15.
[中]梁健于2017年2月15日创作。
代码示例来源:origin: ixrjog/opsCloud
private float acqDiskSysRate(ServerDO serverDO) {
// diskRate
try {
String freeDiskOnSys = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnSys(serverDO, 1));
float usedDiskOnSys = -1;
if (freeDiskOnSys != null) {
usedDiskOnSys = 100 - Float.parseFloat(freeDiskOnSys);
BigDecimal b = new BigDecimal(usedDiskOnSys);
usedDiskOnSys = b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
}
return usedDiskOnSys;
} catch (Exception e) {
logger.error("计算磁盘使用率错误", e);
return -1;
}
}
代码示例来源:origin: ixrjog/opsCloud
private float acqDiskDataRate(ServerDO serverDO) {
// diskRate
try {
String freeDiskOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnData(serverDO, 1));
float usedDiskOnData = -1;
if (freeDiskOnData != null) {
usedDiskOnData = 100 - Float.parseFloat(freeDiskOnData);
BigDecimal b2 = new BigDecimal(usedDiskOnData);
usedDiskOnData = b2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
}
return usedDiskOnData;
} catch (Exception e) {
logger.error("计算磁盘使用率错误", e);
return -1;
}
}
代码示例来源:origin: ixrjog/opsCloud
List<ZabbixResult> results = zabbixHistoryService.acqResults(zabbixHistoryService.queryCpuUser(serverDO, ZABBIX_HISTORY_LIMIT));
String cpuUserMax = calMaxValueByFloat(results);
List<ZabbixResult> results = zabbixHistoryService.acqResults(zabbixHistoryService.queryCpuIowait(serverDO, ZABBIX_HISTORY_LIMIT));
String cpuIowaitMax = calMaxValueByFloat(results);
List<ZabbixResult> results1 = zabbixHistoryService.acqResults(zabbixHistoryService.queryPerCpuAvg1(serverDO, ZABBIX_HISTORY_LIMIT));
String load1Max = calMaxValueByFloat(results1);
if (StringUtils.isEmpty(load1Max)) {
List<ZabbixResult> results5 = zabbixHistoryService.acqResults(zabbixHistoryService.queryPerCpuAvg5(serverDO, ZABBIX_HISTORY_LIMIT));
String load5Max = calMaxValueByFloat(results5);
if (StringUtils.isEmpty(load5Max)) {
List<ZabbixResult> results15 = zabbixHistoryService.acqResults(zabbixHistoryService.queryPerCpuAvg15(serverDO, ZABBIX_HISTORY_LIMIT));
String load15Max = calMaxValueByFloat(results15);
List<ZabbixResult> results = zabbixHistoryService.acqResults(zabbixHistoryService.queryMemoryAvailable(serverDO, ZABBIX_HISTORY_LIMIT));
String memoryAvailableMin = calMinValueByLong(results);
String memoryTotal = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryMemoryTotal(serverDO, 1));
long memoryRate = 100 - Long.parseLong(memoryAvailableMin) * 100 / Long.parseLong(memoryTotal);
serverPerfVO.setMemoryRate(String.valueOf(memoryRate));
if (diskSysVolume != null) {
try {
long vaReadBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskReadBps(serverDO, diskSysVolume, 1)));
long vaWriteBps = Long.valueOf(zabbixHistoryService.acqResultValue(zabbixHistoryService.queryDiskWriteBps(serverDO, diskSysVolume, 1)));
serverPerfVO.setDiskSysBps(String.valueOf(vaReadBps + vaWriteBps));
代码示例来源:origin: ixrjog/opsCloud
@Test
public void test() {
ServerDO s1 = serverDao.getServerInfoById(752);
ServerDO outway2 = serverDao.getServerInfoById(108);
ServerDO serverDO = s1;
System.err.println(s1);
long sysDiskRate = 0;
String freeDiskOnSys = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnSys(serverDO, 1));
System.err.println("freeDiskOnSys:" + freeDiskOnSys);
String freeDiskOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryFreeDiskSpaceOnData(serverDO, 1));
System.err.println("freeDiskOnData:" + freeDiskOnData);
//sysDiskRate = Long.parseLong(usedDiskSpaceOnSys) * 100 / Long.parseLong(totalDiskSpaceOnSys);
//String usedDiskSpaceOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryUsedDiskSpaceOnData(serverDO, 1));
//String totalDiskSpaceOnData = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryTotalDiskSpaceOnData(serverDO, 1));
//long dataDiskRate = Long.parseLong(usedDiskSpaceOnData) * 100 / Long.parseLong(totalDiskSpaceOnData);
//System.err.println("sysDiskRate:" + sysDiskRate);
//System.err.println("dataDiskRate:" + dataDiskRate);
}
代码示例来源:origin: ixrjog/opsCloud
private void updateTomcatVersionByServer(ServerDO serverDO) {
ServerGroupDO serverGroupDO = serverGroupDao.queryServerGroupById(serverDO.getServerGroupId());
if (configServerGroupService.isTomcatServer(serverGroupDO)) {
String version = zabbixHistoryService.acqResultValue(zabbixHistoryService.queryTomcatVersion(serverDO, 1));
if (StringUtils.isEmpty(serverDO.getExtTomcatVersion()) || !serverDO.getExtTomcatVersion().equals(version)) {
serverDO.setExtTomcatVersion(version);
serverDao.updateServerTomcatVersion(serverDO);
}
}
}
代码示例来源:origin: ixrjog/opsCloud
/**
* 获取数据盘vol
*
* @param serverDO
* @return
*/
private String getDiskDataVolume(ServerDO serverDO) {
ConfigPropertyDO confPropertyDO = configDao.getConfigPropertyByName(zabbix_disk_data_volume);
ServerGroupPropertiesDO serverGroupPropertiesDO = configDao.getServerPropertyData(serverDO.getId(), confPropertyDO.getId());
if (serverGroupPropertiesDO != null && !serverGroupPropertiesDO.getPropertyValue().isEmpty()) {
return serverGroupPropertiesDO.getPropertyValue();
}
for (String vol : diskDataVolume) {
try {
JSONObject response = zabbixHistoryService.queryDiskReadBps(serverDO, vol, 1);
JSONArray result = response.getJSONArray("result");
if (result == null) return null;
result.getJSONObject(0).getString("value");
addServerGroupProperties(serverDO, confPropertyDO, vol);
return vol;
} catch (Exception e) {
continue;
}
}
return null;
}
代码示例来源:origin: ixrjog/opsCloud
/**
* 获取系统盘vol
*
* @param serverDO
* @return
*/
private String getDiskSysVolume(ServerDO serverDO) {
ConfigPropertyDO confPropertyDo = configDao.getConfigPropertyByName(zabbix_disk_sys_volume);
ServerGroupPropertiesDO serverGroupPropertiesDO = configDao.getServerPropertyData(serverDO.getId(), confPropertyDo.getId());
if (serverGroupPropertiesDO != null && !serverGroupPropertiesDO.getPropertyValue().isEmpty()) {
return serverGroupPropertiesDO.getPropertyValue();
}
for (String vol : diskSysVolume) {
try {
JSONObject response = zabbixHistoryService.queryDiskReadBps(serverDO, vol, 1);
JSONArray result = response.getJSONArray("result");
if (result == null) return null;
result.getJSONObject(0).getString("value");
addServerGroupProperties(serverDO, confPropertyDo, vol);
return vol;
} catch (Exception e) {
continue;
}
}
return null;
}
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 11年前关闭。 Improve this qu
本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService类的一些代码示例,展示了ZabbixHistoryService类的具体用法。这些代码示例主要来源
本文整理了Java中com.sdg.cmdb.service.impl.ZabbixServiceImpl类的一些代码示例,展示了ZabbixServiceImpl类的具体用法。这些代码示例主要来源于
我有最新版本的 OTRS(5.0.14),其中包含以下软件包: DynamicFieldITSMConfigItem 常规目录 ITSM-CIAttributeCollection ITSM 配置管理
本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService.queryFreeDiskSpaceOnData()方法的一些代码示例,展示了ZabbixHis
本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService.acqResultValue()方法的一些代码示例,展示了ZabbixHistoryServic
本文整理了Java中com.sdg.cmdb.service.ZabbixHistoryService.queryFreeDiskSpaceOnSys()方法的一些代码示例,展示了ZabbixHist
本文整理了Java中com.sdg.cmdb.domain.configCenter.itemEnum.ZabbixItemEnum类的一些代码示例,展示了ZabbixItemEnum类的具体用法。这
本文整理了Java中com.sdg.cmdb.domain.configCenter.itemEnum.ZabbixItemEnum.getItemKey()方法的一些代码示例,展示了ZabbixIt
我是一名优秀的程序员,十分优秀!