2020-08-07 11:20:07 +00:00
|
|
|
package biz.nellemann.hmci
|
2020-08-07 06:13:48 +00:00
|
|
|
|
2020-08-07 11:20:07 +00:00
|
|
|
import groovy.util.logging.Slf4j
|
|
|
|
|
2020-08-11 14:26:16 +00:00
|
|
|
|
2020-08-07 11:20:07 +00:00
|
|
|
@Slf4j
|
2020-08-11 14:26:16 +00:00
|
|
|
class ManagedSystem extends MetaSystem {
|
2020-08-07 06:13:48 +00:00
|
|
|
|
|
|
|
public String id
|
|
|
|
public String name
|
|
|
|
public String type
|
|
|
|
public String model
|
|
|
|
public String serialNumber
|
|
|
|
|
2020-08-07 14:27:42 +00:00
|
|
|
|
2020-08-11 14:26:16 +00:00
|
|
|
ManagedSystem(String id, String name, String type, String model, String serialNumber) {
|
2020-08-07 06:13:48 +00:00
|
|
|
this.id = id
|
2020-08-11 14:26:16 +00:00
|
|
|
this.name = name
|
|
|
|
this.type = type
|
|
|
|
this.model = model
|
|
|
|
this.serialNumber = serialNumber
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
String toString() {
|
|
|
|
return "[${id}] ${name} (${type}-${model} ${serialNumber})"
|
|
|
|
}
|
|
|
|
|
2020-08-10 13:44:14 +00:00
|
|
|
|
2020-08-11 14:26:16 +00:00
|
|
|
Map<String,BigDecimal> getMemoryMetrics() {
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> map = [
|
|
|
|
totalMem: metrics.systemUtil.utilSamples.first().serverUtil.memory.totalMem.first(),
|
|
|
|
availableMem: metrics.systemUtil.utilSamples.first().serverUtil.memory.availableMem.first(),
|
|
|
|
configurableMem: metrics.systemUtil.utilSamples.first().serverUtil.memory.configurableMem.first(),
|
|
|
|
assignedMemToLpars: metrics.systemUtil.utilSamples.first().serverUtil.memory.assignedMemToLpars.first()
|
|
|
|
]
|
|
|
|
|
|
|
|
return map
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,BigDecimal> getProcessorMetrics() {
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> map = [
|
|
|
|
availableProcUnits: metrics.systemUtil.utilSamples.first().serverUtil.processor.availableProcUnits.first(),
|
|
|
|
]
|
|
|
|
|
|
|
|
return map
|
2020-08-07 11:20:07 +00:00
|
|
|
}
|
2020-08-07 14:27:42 +00:00
|
|
|
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|