I Need some assistance with parsing plink output. We have put together a script that polls our hosts for different things using plink being executed from powershell. We export that data for different uses. There is a ton of data in /usr/lib/vmware/vm-support/bin/swfw.sh that we want to leverage from a configuration management perspective that we have a hard time getting from the API.
Currently when we capture the output from plink in a powershell variable, it comes in as an array of strings where each line is addressable individually. What I am hoping to do is to split up that output in chunks so we can regex against it. I want to create a custom object with property names representing the keys below, and the values of those properties being the values.
The end goal is to send these structured objects over to a database or Splunk our Splunk server to keep a running config status for our hosts. Its too bad Vmware doesn't expose firmware versions in a more efficient manor
For instance, here is a portion of the output from swfw.sh that i need to parse:
SMX_SADiskDriveFirmware.InstanceID="HPQ:SMX_SADiskDriveFirmware-6XP3GZ2V0000M248W671"
InstanceID = HPQ:SMX_SADiskDriveFirmware-6XP3GZ2V0000M248W671
IsEntity = true
IdentityInfoType = { CIM:SoftwareFamily, HPQ:SoftwareCategory, }
IdentityInfoValue = { HPQ:EG0300FBLSE, Storage Device, }
TargetTypes = { EG0300FBLSE, }
ClassificationDescriptions = { Disk Drive Firmware, }
Classifications = { 10, }
Manufacturer = HP
VersionString = HPD5
IsLargeBuildNumber = false
HealthState = 5
StatusDescriptions = { Disk Drive Firmware Status: OK, }
OperationalStatus = { 2, }
Name = Disk Drive Firmware
Caption = Disk Drive Firmware
Description = Disk Drive Firmware
ElementName = Disk Drive Firmware
SMX_SADiskDriveFirmware.InstanceID="HPQ:SMX_SADiskDriveFirmware-6XP3HTH50000M2491305"
InstanceID = HPQ:SMX_SADiskDriveFirmware-6XP3HTH50000M2491305
IsEntity = true
IdentityInfoType = { CIM:SoftwareFamily, HPQ:SoftwareCategory, }
IdentityInfoValue = { HPQ:EG0300FBLSE, Storage Device, }
TargetTypes = { EG0300FBLSE, }
ClassificationDescriptions = { Disk Drive Firmware, }
Classifications = { 10, }
Manufacturer = HP
VersionString = HPD5
IsLargeBuildNumber = false
HealthState = 5
StatusDescriptions = { Disk Drive Firmware Status: OK, }
OperationalStatus = { 2, }
Name = Disk Drive Firmware
Caption = Disk Drive Firmware
Description = Disk Drive Firmware
ElementName = Disk Drive Firmware
SMX_MPFirmware.InstanceID="HPQ:SMX_MPFirmware:1"
InstanceID = HPQ:SMX_MPFirmware:1
IsEntity = false
ReleaseDate = 20120717000000.000000+000
IdentityInfoType = { CIM:SoftwareFamily, }
IdentityInfoValue = { HPQ:RI10, }
ClassificationDescriptions = { HP Management Processor Firmware, }
Classifications = { 10, }
Manufacturer = Hewlett-Packard
VersionString = 1.10
IsLargeBuildNumber = false
MinorVersion = 10
MajorVersion = 1
HealthState = 5
StatusDescriptions = { Management Processor Firmware Status: OK, }
OperationalStatus = { 2, }
Name = Integrated Lights Out 4 (iLO4)
Caption = Management Processor Firmware
Description = HP Management Processor Firmware
ElementName = RI10
VMware_HypervisorSoftwareIdentity.InstanceID="Alt Boot Bank: VMware ESXi 5.0.0 build-821926"
InstanceID = Alt Boot Bank: VMware ESXi 5.0.0 build-821926
VersionString = 5.0.0 build-821926
RevisionNumber = 0
Name = VMware ESXi Alternate Boot Bank
MinorVersion = 0
Manufacturer = VMware, Inc.
MajorVersion = 5
LargeBuildNumber = 821926
IsEntity = true
ElementName = Alt Boot Bank: VMware ESXi 5.0.0 build-821926
Description = VMware ESXi Alternate Boot Bank
Caption = VMware ESXi Alternate Boot Bank
IsLargeBuildNumber = true