diff --git a/src/main/groovy/biz/nellemann/hmci/Hmc.groovy b/src/main/groovy/biz/nellemann/hmci/Hmc.groovy index 76bf5fa..907ee57 100644 --- a/src/main/groovy/biz/nellemann/hmci/Hmc.groovy +++ b/src/main/groovy/biz/nellemann/hmci/Hmc.groovy @@ -228,12 +228,11 @@ class Hmc { void processPcmJsonForManagedSystem(String json) { log.debug("processPcmJsonForManagedSystem()") def jsonObject = new JsonSlurper().parseText(json) - String systemUuid = (String)jsonObject?.systemUtil?.utilInfo?.uuid + String systemUuid = jsonObject?.systemUtil?.utilInfo?.uuid as String if(systemUuid && managedSystems.containsKey(systemUuid)) { log.debug("processPcmJsonForManagedSystem() - Found UUID for ManagedSystem: " + systemUuid) ManagedSystem system = managedSystems.get(systemUuid) - // TODO: Store metrics - system.processMetrics() + system.processMetrics(json) } } @@ -241,21 +240,19 @@ class Hmc { log.debug("processPcmJsonForLogicalPartition()") def jsonObject = new JsonSlurper().parseText(json) - String systemUuid = (String)jsonObject?.utilInfo?.uuid + String systemUuid = jsonObject?.utilInfo?.uuid as String if(systemUuid && managedSystems.containsKey(systemUuid)) { log.debug("processPcmJsonForLogicalPartition() - Found UUID for ManagedSystem: " + systemUuid) ManagedSystem system = managedSystems.get(systemUuid) - String lparUuid = (String)jsonObject?.utilSamples?.lparsUtil[0][0]?.uuid + String lparUuid = jsonObject?.utilSamples?.lparsUtil?.first()?.first()?.uuid as String if(lparUuid && system.partitions.containsKey(lparUuid)) { log.debug("processPcmJsonForLogicalPartition() - Found UUID for LogicalPartition: " + lparUuid) LogicalPartition lpar = system.partitions.get(lparUuid) - // TODO: Store metrics - lpar.processMetrics() - + lpar.processMetrics(json) } } diff --git a/src/main/groovy/biz/nellemann/hmci/LogicalPartition.groovy b/src/main/groovy/biz/nellemann/hmci/LogicalPartition.groovy index 15522d4..09761bc 100644 --- a/src/main/groovy/biz/nellemann/hmci/LogicalPartition.groovy +++ b/src/main/groovy/biz/nellemann/hmci/LogicalPartition.groovy @@ -1,5 +1,8 @@ package biz.nellemann.hmci + +import biz.nellemann.hmci.pojo.SystemUtil +import groovy.json.JsonSlurper import groovy.util.logging.Slf4j @Slf4j @@ -9,7 +12,7 @@ class LogicalPartition { public String name public String type - protected List pcmLinks + protected SystemUtil metrics LogicalPartition(String id) { this.id = id @@ -19,7 +22,9 @@ class LogicalPartition { return "[${id}] ${name} (${type})" } - void processMetrics() { - log.info("processMetrics() - TODO: Store metrics here.") + void processMetrics(String json) { + def pcmMap = new JsonSlurper().parseText(json) + metrics = new SystemUtil(pcmMap as Map) } + } diff --git a/src/main/groovy/biz/nellemann/hmci/ManagedSystem.groovy b/src/main/groovy/biz/nellemann/hmci/ManagedSystem.groovy index 8c8a81b..c0b3536 100644 --- a/src/main/groovy/biz/nellemann/hmci/ManagedSystem.groovy +++ b/src/main/groovy/biz/nellemann/hmci/ManagedSystem.groovy @@ -1,5 +1,8 @@ package biz.nellemann.hmci + +import biz.nellemann.hmci.pojo.PcmData +import groovy.json.JsonSlurper import groovy.util.logging.Slf4j @Slf4j @@ -10,10 +13,11 @@ class ManagedSystem { public String type public String model public String serialNumber - - protected List pcmLinks = new ArrayList<>() public Map partitions = new HashMap() + protected PcmData metrics + + ManagedSystem(String id) { this.id = id } @@ -22,7 +26,9 @@ class ManagedSystem { return "[${id}] ${name} (${type}-${model} ${serialNumber})" } - void processMetrics() { - log.info("processMetrics() - TODO: Store metrics here.") + void processMetrics(String json) { + def pcmMap = new JsonSlurper().parseText(json) + metrics = new PcmData(pcmMap as Map) } + } diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/FiberChannelAdapter.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/FiberChannelAdapter.groovy new file mode 100644 index 0000000..bafe7e7 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/FiberChannelAdapter.groovy @@ -0,0 +1,19 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class FiberChannelAdapter { + + String id + String wwpn + String physicalLocation + Integer numOfPorts + List numOfReads + List numOfWrites + List readBytes + List writeBytes + List runningSpeed + List transmittedBytes + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/GenericPhysicalAdapters.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/GenericPhysicalAdapters.groovy new file mode 100644 index 0000000..dd0dd92 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/GenericPhysicalAdapters.groovy @@ -0,0 +1,17 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class GenericPhysicalAdapters { + + String id + String type + String physicalLocation + List numOfReads + List numOfWrites + List readBytes + List writeBytes + List transmittedBytes + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/GenericVirtualAdapter.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/GenericVirtualAdapter.groovy new file mode 100644 index 0000000..c53d6a4 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/GenericVirtualAdapter.groovy @@ -0,0 +1,18 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class GenericVirtualAdapter { + + String id + String type + Integer viosId + String physicalLocation + BigDecimal numOfReads + BigDecimal numOfWrites + BigDecimal readBytes + BigDecimal writeBytes + BigDecimal transmittedBytes + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/LparMemory.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/LparMemory.groovy new file mode 100644 index 0000000..a1ca150 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/LparMemory.groovy @@ -0,0 +1,11 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class LparMemory { + + List logicalMem + List backedPhysicalMem + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/LparProcessor.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/LparProcessor.groovy new file mode 100644 index 0000000..0eaecc9 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/LparProcessor.groovy @@ -0,0 +1,20 @@ +package biz.nellemann.hmci.pojo + +class LparProcessor { + + Integer poolId + Integer weight + String mode + List maxVirtualProcessors + List currentVirtualProcessors + List maxProcUnits + List entitledProcUnits + List utilizedProcUnits + List utilizedCappedProcUnits + List utilizedUncappedProcUnits + List idleProcUnits + List donatedProcUnits + List timeSpentWaitingForDispatch + List timePerInstructionExecution + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/LparUtil.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/LparUtil.groovy new file mode 100644 index 0000000..b4b0a41 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/LparUtil.groovy @@ -0,0 +1,21 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class LparUtil { + + Integer id + String uuid + String name + String state + String type + String osType + Integer affinityScore + + LparMemory memory + LparProcessor processor + Network network + Storage storage + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/Network.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/Network.groovy new file mode 100644 index 0000000..9f4ff60 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/Network.groovy @@ -0,0 +1,8 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class Network { + List virtualEthernetAdapters +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/PcmData.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/PcmData.groovy new file mode 100644 index 0000000..ec90ccc --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/PcmData.groovy @@ -0,0 +1,8 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class PcmData { + SystemUtil systemUtil +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/ServerMemory.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/ServerMemory.groovy new file mode 100644 index 0000000..87a17cb --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/ServerMemory.groovy @@ -0,0 +1,11 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class ServerMemory { + List totalMem + List availableMem + List configurableMem + List assignedMemToLpars +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/ServerProcessor.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/ServerProcessor.groovy new file mode 100644 index 0000000..a3e4cdb --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/ServerProcessor.groovy @@ -0,0 +1,12 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class ServerProcessor { + List totalProcUnits + List utilizedProcUnits + List availableProcUnits + List configurableProcUnits + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/ServerUtil.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/ServerUtil.groovy new file mode 100644 index 0000000..637672d --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/ServerUtil.groovy @@ -0,0 +1,49 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class ServerUtil { + ServerProcessor processor + ServerMemory memory + + /* + "physicalProcessorPool": { + "assignedProcUnits": [ + 23.879 + ], + "utilizedProcUnits": [ + 0.007 + ], + "availableProcUnits": [ + 23.872 + ], + "configuredProcUnits": [ + 0.000 + ], + "borrowedProcUnits": [ + 16.000 + ] + }, + "sharedProcessorPool": [ + { + "id": 0, + "name": "DefaultPool", + "assignedProcUnits": [ + 23.879 + ], + "utilizedProcUnits": [ + 0.005 + ], + "availableProcUnits": [ + 23.874 + ], + "configuredProcUnits": [ + 6.000 + ], + "borrowedProcUnits": [ + 16.000 + ] + } + ]*/ +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/Storage.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/Storage.groovy new file mode 100644 index 0000000..a9788da --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/Storage.groovy @@ -0,0 +1,8 @@ +package biz.nellemann.hmci.pojo + +class Storage { + List genericPhysicalAdapters + List genericVirtualAdapters + List virtualFiberChannelAdapters + List fiberChannelAdapters +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/SystemUtil.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/SystemUtil.groovy new file mode 100644 index 0000000..27a9c2e --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/SystemUtil.groovy @@ -0,0 +1,25 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class SystemUtil { + + UtilInfo utilInfo + List utilSamples + + /* + Integer id + String uuid + String name + String state + String type + String osType + Integer integeraffinityScore + + Memory memory + Processor processor + Network network + Storage storage*/ + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/UtilInfo.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/UtilInfo.groovy new file mode 100644 index 0000000..e95539d --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/UtilInfo.groovy @@ -0,0 +1,21 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +import java.time.Instant + +@ToString +class UtilInfo { + + String version + String metricType + Integer frequency + String startTimeStamp + String endTimeStamp + String mtms + String name + String uuid + + List metricArrayOrder + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/UtilSample.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/UtilSample.groovy new file mode 100644 index 0000000..a746fb9 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/UtilSample.groovy @@ -0,0 +1,10 @@ +package biz.nellemann.hmci.pojo + +class UtilSample { + + String sampleType + ServerUtil serverUtil + List viosUtil + List lparsUtil + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/ViosUtil.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/ViosUtil.groovy new file mode 100644 index 0000000..c1af3d6 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/ViosUtil.groovy @@ -0,0 +1,729 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class ViosUtil { + + String id + String uuid + String name + String state + Integer affinityScore + + Memory memory + LparProcessor processor + Network network + Storage storage + + class Memory { + List assignedMem + List utilizedMem + } + + /* + "viosUtil": [ + { + "id": 1, + "uuid": "2F30379A-860B-4661-A24E-CD8E449C81AC", + "name": "VIOS1", + "state": "Running", + "affinityScore": 100, + "memory": { + "assignedMem": [ + 8192.000 + ], + "utilizedMem": [ + 2061.000 + ] + }, + "processor": { + "weight": 0, + "mode": "share_idle_procs_active", + "maxVirtualProcessors": [ + 2.000 + ], + "currentVirtualProcessors": [ + 0.000 + ], + "maxProcUnits": [ + 2.000 + ], + "entitledProcUnits": [ + 1.000 + ], + "utilizedProcUnits": [ + 0.006 + ], + "utilizedCappedProcUnits": [ + 0.079 + ], + "utilizedUncappedProcUnits": [ + 0.000 + ], + "idleProcUnits": [ + 0.073 + ], + "donatedProcUnits": [ + 0.921 + ], + "timeSpentWaitingForDispatch": [ + 0.000 + ], + "timePerInstructionExecution": [ + 51.000 + ] + }, + "network": { + "clientLpars": [ + "62F4D488-C838-41E2-B83B-E68E004E3B63" + ], + "genericAdapters": [ + { + "id": "ent2", + "type": "physical", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C10-T3", + "receivedPackets": [ + 29.733 + ], + "sentPackets": [ + 25.900 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 7508.933 + ], + "receivedBytes": [ + 5676.000 + ], + "transferredBytes": [ + 13184.933 + ] + }, + { + "id": "ent6", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V1-C3-T1", + "receivedPackets": [ + 12.967 + ], + "sentPackets": [ + 9.700 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 3348.667 + ], + "receivedBytes": [ + 2401.733 + ], + "transferredBytes": [ + 5750.400 + ] + }, + { + "id": "ent4", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V1-C2-T1", + "receivedPackets": [ + 26.900 + ], + "sentPackets": [ + 33.800 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 8853.333 + ], + "receivedBytes": [ + 8214.933 + ], + "transferredBytes": [ + 17068.266 + ] + } + ], + "sharedAdapters": [ + { + "id": "ent5", + "type": "sea", + "physicalLocation": "U8247.22L.213C1BA-V1-C2-T1", + "receivedPackets": [ + 56.633 + ], + "sentPackets": [ + 59.700 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 16362.267 + ], + "receivedBytes": [ + 13890.933 + ], + "transferredBytes": [ + 30253.200 + ], + "bridgedAdapters": [ + "ent2", + "ent4", + "ent4" + ] + } + ], + "virtualEthernetAdapters": [ + { + "physicalLocation": "U8247.22L.213C1BA-V1-C2", + "vlanId": 1, + "vswitchId": 0, + "isPortVlanId": true, + "receivedPackets": [ + 10.467 + ], + "sentPackets": [ + 14.667 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 1931.333 + ], + "receivedBytes": [ + 3875.433 + ], + "receivedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalPackets": [ + 0.000 + ], + "droppedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalBytes": [ + 0.000 + ], + "receivedPhysicalBytes": [ + 0.000 + ], + "transferredBytes": [ + 5806.766 + ], + "transferredPhysicalBytes": [ + 0.000 + ] + }, + { + "physicalLocation": "U8247.22L.213C1BA-V1-C3", + "vlanId": 1, + "vswitchId": 0, + "isPortVlanId": true, + "receivedPackets": [ + 6.100 + ], + "sentPackets": [ + 1.700 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 1420.533 + ], + "receivedBytes": [ + 575.100 + ], + "receivedPhysicalPackets": [ + 6.100 + ], + "sentPhysicalPackets": [ + 1.700 + ], + "droppedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalBytes": [ + 1420.533 + ], + "receivedPhysicalBytes": [ + 575.100 + ], + "transferredBytes": [ + 1995.633 + ], + "transferredPhysicalBytes": [ + 1995.633 + ] + } + ] + }, + "storage": { + "clientLpars": [ + "62F4D488-C838-41E2-B83B-E68E004E3B63" + ], + "genericPhysicalAdapters": [ + { + "id": "sissas0", + "type": "sas", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C14-T1", + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 4.533 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 2321.067 + ], + "transmittedBytes": [ + 2321.067 + ] + } + ], + "genericVirtualAdapters": [ + { + "id": "vhost1", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V1-C6", + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.000 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 0.000 + ], + "transmittedBytes": [ + 0.000 + ] + }, + { + "id": "vhost0", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V1-C5", + "numOfReads": [ + 0.500 + ], + "numOfWrites": [ + 0.500 + ], + "readBytes": [ + 256.000 + ], + "writeBytes": [ + 256.000 + ], + "transmittedBytes": [ + 512.000 + ] + }, + { + "id": "vhost2", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V1-C7", + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.000 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 0.000 + ], + "transmittedBytes": [ + 0.000 + ] + } + ], + "fiberChannelAdapters": [ + { + "id": "fcs0", + "wwpn": "10000090faba5108", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C12-T1", + "numOfPorts": 3, + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.467 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 30583.467 + ], + "runningSpeed": [ + 8.000 + ], + "transmittedBytes": [ + 30583.467 + ] + }, + { + "id": "fcs1", + "wwpn": "10000090faba5109", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C12-T2", + "numOfPorts": 0, + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.000 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 0.000 + ], + "runningSpeed": [ + 0.000 + ], + "transmittedBytes": [ + 0.000 + ] + } + ] + } + }, + { + "id": 2, + "uuid": "2BA128CE-38E4-4522-B823-7471633C2717", + "name": "VIOS2", + "state": "Running", + "affinityScore": 100, + "memory": { + "assignedMem": [ + 8192.000 + ], + "utilizedMem": [ + 2090.000 + ] + }, + "processor": { + "weight": 0, + "mode": "share_idle_procs_active", + "maxVirtualProcessors": [ + 2.000 + ], + "currentVirtualProcessors": [ + 0.000 + ], + "maxProcUnits": [ + 2.000 + ], + "entitledProcUnits": [ + 1.000 + ], + "utilizedProcUnits": [ + 0.005 + ], + "utilizedCappedProcUnits": [ + 0.042 + ], + "utilizedUncappedProcUnits": [ + 0.000 + ], + "idleProcUnits": [ + 0.037 + ], + "donatedProcUnits": [ + 0.958 + ], + "timeSpentWaitingForDispatch": [ + 0.000 + ], + "timePerInstructionExecution": [ + 52.000 + ] + }, + "network": { + "genericAdapters": [ + { + "id": "ent6", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V2-C3-T1", + "receivedPackets": [ + 12.233 + ], + "sentPackets": [ + 9.000 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 3011.200 + ], + "receivedBytes": [ + 2265.067 + ], + "transferredBytes": [ + 5276.267 + ] + }, + { + "id": "ent4", + "type": "virtual", + "physicalLocation": "U8247.22L.213C1BA-V2-C2-T1", + "receivedPackets": [ + 4.600 + ], + "sentPackets": [ + 1.000 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 706.000 + ], + "receivedBytes": [ + 3247.600 + ], + "transferredBytes": [ + 3953.600 + ] + }, + { + "id": "ent2", + "type": "physical", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C6-T3", + "receivedPackets": [ + 5.167 + ], + "sentPackets": [ + 0.000 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 0.000 + ], + "receivedBytes": [ + 380.333 + ], + "transferredBytes": [ + 380.333 + ] + } + ], + "sharedAdapters": [ + { + "id": "ent5", + "type": "sea", + "physicalLocation": "U8247.22L.213C1BA-V2-C2-T1", + "receivedPackets": [ + 9.767 + ], + "sentPackets": [ + 1.000 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 706.000 + ], + "receivedBytes": [ + 3627.933 + ], + "transferredBytes": [ + 4333.933 + ], + "bridgedAdapters": [ + "ent2", + "ent4", + "ent4" + ] + } + ], + "virtualEthernetAdapters": [ + { + "physicalLocation": "U8247.22L.213C1BA-V2-C2", + "vlanId": 1, + "vswitchId": 0, + "isPortVlanId": true, + "receivedPackets": [ + 0.000 + ], + "sentPackets": [ + 0.000 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 0.000 + ], + "receivedBytes": [ + 0.000 + ], + "receivedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalPackets": [ + 0.000 + ], + "droppedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalBytes": [ + 0.000 + ], + "receivedPhysicalBytes": [ + 0.000 + ], + "transferredBytes": [ + 0.000 + ], + "transferredPhysicalBytes": [ + 0.000 + ] + }, + { + "physicalLocation": "U8247.22L.213C1BA-V2-C3", + "vlanId": 1, + "vswitchId": 0, + "isPortVlanId": true, + "receivedPackets": [ + 5.867 + ], + "sentPackets": [ + 1.567 + ], + "droppedPackets": [ + 0.000 + ], + "sentBytes": [ + 1306.633 + ], + "receivedBytes": [ + 517.900 + ], + "receivedPhysicalPackets": [ + 5.867 + ], + "sentPhysicalPackets": [ + 1.567 + ], + "droppedPhysicalPackets": [ + 0.000 + ], + "sentPhysicalBytes": [ + 1306.633 + ], + "receivedPhysicalBytes": [ + 517.900 + ], + "transferredBytes": [ + 1824.533 + ], + "transferredPhysicalBytes": [ + 1824.533 + ] + } + ] + }, + "storage": { + "clientLpars": [ + "62F4D488-C838-41E2-B83B-E68E004E3B63" + ], + "genericPhysicalAdapters": [ + { + "id": "sissas1", + "type": "sas", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C15-T1", + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 6.400 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 3276.800 + ], + "transmittedBytes": [ + 3276.800 + ] + } + ], + "fiberChannelAdapters": [ + { + "id": "fcs1", + "wwpn": "10000090fab674d7", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C2-T2", + "numOfPorts": 0, + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.000 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 0.000 + ], + "runningSpeed": [ + 0.000 + ], + "transmittedBytes": [ + 0.000 + ] + }, + { + "id": "fcs0", + "wwpn": "10000090fab674d6", + "physicalLocation": "U78CB.001.WZS0BYF-P1-C2-T1", + "numOfPorts": 3, + "numOfReads": [ + 0.000 + ], + "numOfWrites": [ + 0.400 + ], + "readBytes": [ + 0.000 + ], + "writeBytes": [ + 26214.400 + ], + "runningSpeed": [ + 8.000 + ], + "transmittedBytes": [ + 26214.400 + ] + } + ] + } + } + ] + */ +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/VirtualEthernetAdapter.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/VirtualEthernetAdapter.groovy new file mode 100644 index 0000000..6c88e35 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/VirtualEthernetAdapter.groovy @@ -0,0 +1,27 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class VirtualEthernetAdapter { + + String physicalLocation + Integer vlanId + Integer vswitchId + Boolean isPortVlanId + Integer viosId + String sharedEthernetAdapterId + List receivedPackets + List sentPackets + List droppedPackets + List sentBytes + List receivedBytes + List receivedPhysicalPackets + List sentPhysicalPackets + List droppedPhysicalPackets + List sentPhysicalBytes + List receivedPhysicalBytes + List transferredBytes + List transferredPhysicalBytes + +} diff --git a/src/main/groovy/biz/nellemann/hmci/pojo/VirtualFiberChannelAdapter.groovy b/src/main/groovy/biz/nellemann/hmci/pojo/VirtualFiberChannelAdapter.groovy new file mode 100644 index 0000000..bc41dd0 --- /dev/null +++ b/src/main/groovy/biz/nellemann/hmci/pojo/VirtualFiberChannelAdapter.groovy @@ -0,0 +1,20 @@ +package biz.nellemann.hmci.pojo + +import groovy.transform.ToString + +@ToString +class VirtualFiberChannelAdapter { + + String wwpn + String wwpn2 + String physicalLocation + String physicalPortWWPN + Integer viosId + BigDecimal numOfReads + BigDecimal numOfWrites + BigDecimal readBytes + BigDecimal writeBytes + BigDecimal runningSpeed + BigDecimal transmittedBytes + +} diff --git a/src/test/groovy/biz/nellemann/hmci/HmcTest.groovy b/src/test/groovy/biz/nellemann/hmci/HmcTest.groovy index dee836f..f03e20f 100644 --- a/src/test/groovy/biz/nellemann/hmci/HmcTest.groovy +++ b/src/test/groovy/biz/nellemann/hmci/HmcTest.groovy @@ -96,7 +96,13 @@ class HmcTest extends Specification { hmc.processPcmJsonForManagedSystem(testJson) then: - true == true + system.metrics.systemUtil.utilSamples.first().serverUtil.memory.assignedMemToLpars.first() == 40960.000 + system.metrics.systemUtil.utilSamples.first().serverUtil.processor.totalProcUnits.first() == 24.000 + system.metrics.systemUtil.utilSamples.first().viosUtil.first().name == "VIOS1" + system.metrics.systemUtil.utilSamples.first().viosUtil.first().memory.assignedMem.first() == 8192.000 + system.metrics.systemUtil.utilSamples.first().viosUtil.first().storage.genericPhysicalAdapters.first().transmittedBytes.first() == 2321.067 + system.metrics.systemUtil.utilSamples.first().viosUtil.first().storage.fiberChannelAdapters.first().numOfPorts == 3 + } void "test processPcmJsonForLogicalPartition"() { @@ -113,7 +119,9 @@ class HmcTest extends Specification { hmc.processPcmJsonForLogicalPartition(testJson) then: - true == true + lpar.metrics.utilSamples.first().lparsUtil.first().memory.logicalMem.first() == 112640.000 + lpar.metrics.utilSamples.first().lparsUtil.first().processor.utilizedProcUnits.first() == 0.574 + lpar.metrics.utilSamples.first().lparsUtil.first().network.virtualEthernetAdapters.first().receivedPackets.first() == 11.933 }