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-12 15:00:31 +00:00
|
|
|
// From PCM Data
|
|
|
|
|
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-13 09:48:00 +00:00
|
|
|
List<Map> getMemoryMetrics() {
|
|
|
|
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
|
|
system: name,
|
|
|
|
]
|
|
|
|
map.put("tags", tagsMap)
|
|
|
|
log.debug(tagsMap.toString())
|
2020-08-11 14:26:16 +00:00
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
2020-08-12 15:00:31 +00:00
|
|
|
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(),
|
2020-08-11 14:26:16 +00:00
|
|
|
]
|
2020-08-13 09:48:00 +00:00
|
|
|
map.put("fields", fieldsMap)
|
|
|
|
log.debug(fieldsMap.toString())
|
2020-08-11 14:26:16 +00:00
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
list.add(map)
|
|
|
|
return list
|
2020-08-11 14:26:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
List<Map> getProcessorMetrics() {
|
2020-08-11 14:26:16 +00:00
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
List<Map> list = new ArrayList<>()
|
|
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
|
|
system: name,
|
|
|
|
]
|
|
|
|
map.put("tags", tagsMap)
|
|
|
|
log.debug(tagsMap.toString())
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
2020-08-12 15:00:31 +00:00
|
|
|
availableProcUnits: metrics.systemUtil.utilSamples.first().serverUtil.processor.totalProcUnits.first(),
|
|
|
|
utilizedProcUnits: metrics.systemUtil.utilSamples.first().serverUtil.processor.utilizedProcUnits.first(),
|
|
|
|
availableProcUnits: metrics.systemUtil.utilSamples.first().serverUtil.processor.availableProcUnits.first(),
|
|
|
|
configurableProcUnits: metrics.systemUtil.utilSamples.first().serverUtil.processor.configurableProcUnits.first(),
|
|
|
|
]
|
2020-08-13 09:48:00 +00:00
|
|
|
map.put("fields", fieldsMap)
|
|
|
|
log.debug(fieldsMap.toString())
|
2020-08-12 15:00:31 +00:00
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
list.add(map)
|
|
|
|
return list
|
2020-08-12 15:00:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
List<Map> getSharedProcessorPools() {
|
2020-08-12 15:00:31 +00:00
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
List<Map> list = new ArrayList<>()
|
2020-08-12 15:00:31 +00:00
|
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
metrics.systemUtil.utilSamples.first().serverUtil.sharedProcessorPool.each {
|
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
HashMap<String, String> tagsMap = [
|
|
|
|
system: name,
|
|
|
|
pool: it.name,
|
|
|
|
]
|
|
|
|
map.put("tags", tagsMap)
|
|
|
|
log.debug(tagsMap.toString())
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
2020-08-12 15:00:31 +00:00
|
|
|
assignedProcUnits: it.assignedProcUnits.first(),
|
|
|
|
availableProcUnits: it.availableProcUnits.first(),
|
|
|
|
]
|
2020-08-13 09:48:00 +00:00
|
|
|
map.put("fields", fieldsMap)
|
|
|
|
log.debug(fieldsMap.toString())
|
|
|
|
|
|
|
|
list.add(map)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return list
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Map> getSystemSharedAdapters() {
|
|
|
|
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
metrics.systemUtil.utilSamples.first().viosUtil.each {vios ->
|
|
|
|
|
|
|
|
vios.network.sharedAdapters.each {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
|
|
system: name,
|
|
|
|
type: it.type,
|
|
|
|
vios: vios.name,
|
|
|
|
]
|
|
|
|
map.put("tags", tagsMap)
|
|
|
|
log.debug(tagsMap.toString())
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
|
|
sentBytes: it.sentBytes.first(),
|
|
|
|
transferredBytes: it.transferredBytes.first(),
|
|
|
|
]
|
|
|
|
map.put("fields", fieldsMap)
|
|
|
|
log.debug(fieldsMap.toString())
|
|
|
|
|
|
|
|
list.add(map)
|
|
|
|
}
|
|
|
|
|
2020-08-12 15:00:31 +00:00
|
|
|
}
|
2020-08-13 09:48:00 +00:00
|
|
|
|
|
|
|
return list
|
2020-08-12 15:00:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-13 09:48:00 +00:00
|
|
|
List<Map> getSystemFiberChannelAdapters() {
|
|
|
|
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
metrics.systemUtil.utilSamples.first().viosUtil.each { vios ->
|
|
|
|
vios.storage.fiberChannelAdapters.each {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
|
|
system: name,
|
|
|
|
wwpn: it.wwpn,
|
|
|
|
vios: vios.name,
|
|
|
|
]
|
|
|
|
map.put("tags", tagsMap)
|
|
|
|
log.debug(tagsMap.toString())
|
|
|
|
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
|
|
writeBytes: it.writeBytes.first(),
|
|
|
|
readBytes: it.readBytes.first(),
|
|
|
|
]
|
|
|
|
map.put("fields", fieldsMap)
|
|
|
|
log.debug(fieldsMap.toString())
|
|
|
|
|
|
|
|
list.add(map)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return list
|
|
|
|
|
|
|
|
}
|
2020-08-07 14:27:42 +00:00
|
|
|
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|