Documentation
¶
Index ¶
- func Import(c *cli.Context)
- type Content
- type Entry
- type Feed
- type HMC
- func (hmc *HMC) AddPoint(name string, metric string, values []float64)
- func (hmc *HMC) GetManagedSystems() ([]System, error)
- func (hmc *HMC) GetPCMData(link string) (PCMData, error)
- func (hmc *HMC) GetPartitionPCMLinks(link string) (PCMLinks, error)
- func (hmc *HMC) GetSystemPCMLinks(uuid string) (PCMLinks, error)
- func (hmc *HMC) WritePoints() (err error)
- type Link
- type ManagedSystem
- type PCMData
- type PCMLinks
- type Partitions
- type Point
- type Session
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Content ¶
type Content struct {
XMLName xml.Name `xml:"content"`
System []ManagedSystem `xml:"http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/ ManagedSystem"`
}
Content feed struct containing all managed systems
type Entry ¶
type Entry struct {
XMLName xml.Name `xml:"entry"`
ID string `xml:"id"`
Link struct {
Href string `xml:"href,attr"`
} `xml:"link,omitempty"`
Contents []Content `xml:"content"`
Category struct {
Term string `xml:"term,attr"`
} `xml:"category,omitempty"`
}
Entry is the atom feed section containing the links to PCM data and the Category
type HMC ¶
type HMC struct {
Session *Session
InfluxDB *influxdbclient.InfluxDB
GlobalPoint Point
FilterManagedSystem string
Debug bool
ManagedSystemOnly bool
Samples int
TagParsers nmon2influxdblib.TagParsers
}
HMC contains the base struct used by all the hmc sub command
func NewHMC ¶
NewHMC return a new HMC struct and use the command line and config file parameters to intialize it.
func (*HMC) AddPoint ¶
AddPoint add a InfluxDB point. It's using the GlobalPoint parameter to fill some fields
func (*HMC) GetManagedSystems ¶
GetManagedSystems encapsulation function
func (*HMC) GetPCMData ¶
GetPCMData encapsulation function
func (*HMC) GetPartitionPCMLinks ¶
GetPartitionPCMLinks encapsulation function
func (*HMC) GetSystemPCMLinks ¶
GetSystemPCMLinks encapsulation function
func (*HMC) WritePoints ¶
WritePoints send points to InfluxDB database and reset points count
type Link ¶
type Link struct {
Href string `xml:"href,attr"`
}
Link the link itself is stored in the attribute href
type ManagedSystem ¶
type ManagedSystem struct {
XMLName xml.Name `xml:"http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/ ManagedSystem"`
SystemName string
AssociatedLogicalPartitions Partitions `xml:"http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/ AssociatedLogicalPartitions"`
}
ManagedSystem struct contains a managed system and his associated partitions
type PCMData ¶
type PCMData struct {
SystemUtil struct {
UtilInfo struct {
Version string `json:"version"`
MetricType string `json:"metricType"`
Frequency int `json:"frequency"`
StartTimeStamp string `json:"startTimeStamp"`
EndTimeStamp string `json:"endTimeStamp"`
Mtms string `json:"mtms"`
Name string `json:"name"`
MetricArrayOrder []string `json:"metricArrayOrder"`
UUID string `json:"uuid"`
} `json:"utilInfo"`
UtilSamples []struct {
SampleType string `json:"sampleType"`
SystemFirmwareUtil struct {
UtilizedProcUnits []interface{} `json:"utilizedProcUnits"`
AssignedMem []float64 `json:"assignedMem"`
} `json:"systemFirmwareUtil"`
ServerUtil struct {
Processor struct {
TotalProcUnits []float64 `json:"totalProcUnits"`
UtilizedProcUnits []float64 `json:"utilizedProcUnits"`
AvailableProcUnits []float64 `json:"availableProcUnits"`
ConfigurableProcUnits []float64 `json:"configurableProcUnits"`
} `json:"processor"`
Memory struct {
TotalMem []float64 `json:"totalMem"`
AssignedMemToLpars []float64 `json:"assignedMemToLpars"`
AvailableMem []float64 `json:"availableMem"`
ConfigurableMem []float64 `json:"configurableMem"`
} `json:"memory"`
SharedProcessorPool []struct {
AssignedProcUnits []float64 `json:"assignedProcUnits"`
UtilizedProcUnits []float64 `json:"utilizedProcUnits"`
AvailableProcUnits []float64 `json:"availableProcUnits"`
ConfiguredProcUnits []float64 `json:"configuredProcUnits"`
BorrowedProcUnits []float64 `json:"borrowedProcUnits"`
ID int `json:"id"`
Name string `json:"name"`
} `json:"sharedProcessorPool"`
Network struct {
Headapters []struct {
DrcIndex string `json:"drcIndex"`
PhysicalPorts []struct {
TransferredBytes []float64 `json:"transferredBytes"`
ID int `json:"id"`
PhysicalLocation string `json:"physicalLocation"`
ReceivedPackets []float64 `json:"receivedPackets"`
SentPackets []float64 `json:"sentPackets"`
DroppedPackets []float64 `json:"droppedPackets"`
SentBytes []float64 `json:"sentBytes"`
ReceivedBytes []float64 `json:"receivedBytes"`
} `json:"physicalPorts"`
} `json:"headapters"`
} `json:"network"`
} `json:"serverUtil"`
ViosUtil []struct {
UUID string `json:"uuid"`
State string `json:"state"`
ID int `json:"id"`
Name string `json:"name"`
Memory struct {
AssignedMem []float64 `json:"assignedMem"`
UtilizedMem []float64 `json:"utilizedMem"`
} `json:"memory"`
Processor struct {
PoolID int `json:"poolId"`
Weight int `json:"weight"`
Mode string `json:"mode"`
MaxVirtualProcessors []float64 `json:"maxVirtualProcessors"`
MaxProcUnits []float64 `json:"maxProcUnits"`
EntitledProcUnits []float64 `json:"entitledProcUnits"`
UtilizedProcUnits []float64 `json:"utilizedProcUnits"`
UtilizedCappedProcUnits []float64 `json:"utilizedCappedProcUnits"`
UtilizedUncappedProcUnits []float64 `json:"utilizedUncappedProcUnits"`
IdleProcUnits []float64 `json:"idleProcUnits"`
DonatedProcUnits []float64 `json:"donatedProcUnits"`
} `json:"processor"`
Network struct {
GenericAdapters []struct {
TransferredBytes []float64 `json:"transferredBytes"`
Type string `json:"type"`
ID string `json:"id"`
PhysicalLocation string `json:"physicalLocation"`
ReceivedPackets []float64 `json:"receivedPackets"`
SentPackets []float64 `json:"sentPackets"`
DroppedPackets []float64 `json:"droppedPackets"`
SentBytes []float64 `json:"sentBytes"`
ReceivedBytes []float64 `json:"receivedBytes"`
} `json:"genericAdapters"`
SharedAdapters []struct {
TransferredBytes []float64 `json:"transferredBytes"`
ID string `json:"id"`
Type string `json:"type"`
PhysicalLocation string `json:"physicalLocation"`
ReceivedPackets []float64 `json:"receivedPackets"`
SentPackets []float64 `json:"sentPackets"`
DroppedPackets []float64 `json:"droppedPackets"`
SentBytes []float64 `json:"sentBytes"`
ReceivedBytes []float64 `json:"receivedBytes"`
BridgedAdapters []string `json:"bridgedAdapters"`
} `json:"sharedAdapters"`
} `json:"network"`
Storage struct {
GenericPhysicalAdapters []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
Type string `json:"type"`
ID string `json:"id"`
PhysicalLocation string `json:"physicalLocation"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"genericPhysicalAdapters"`
SharedStoragePools []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
ID string `json:"id"`
TotalSpace []float64 `json:"totalSpace"`
UsedSpace []float64 `json:"usedSpace"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"sharedStoragePools"`
FiberChannelAdapters []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
Wwpn string `json:"wwpn"`
PhysicalLocation string `json:"physicalLocation"`
NumOfPorts int `json:"numOfPorts"`
RunningSpeed []float64 `json:"runningSpeed"`
ID string `json:"id"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"fiberChannelAdapters"`
GenericVirtualAdapters []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
Type string `json:"type"`
ID string `json:"id"`
PhysicalLocation string `json:"physicalLocation"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"genericVirtualAdapters"`
} `json:"storage"`
} `json:"viosUtil"`
LparsUtil []struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Memory struct {
LogicalMem []float64 `json:"logicalMem"`
BackedPhysicalMem []float64 `json:"backedPhysicalMem"`
} `json:"memory"`
Processor struct {
PoolID int `json:"poolId"`
Weight int `json:"weight"`
Mode string `json:"mode"`
MaxVirtualProcessors []float64 `json:"maxVirtualProcessors"`
MaxProcUnits []float64 `json:"maxProcUnits"`
EntitledProcUnits []float64 `json:"entitledProcUnits"`
UtilizedProcUnits []float64 `json:"utilizedProcUnits"`
UtilizedCappedProcUnits []float64 `json:"utilizedCappedProcUnits"`
UtilizedUncappedProcUnits []float64 `json:"utilizedUncappedProcUnits"`
IdleProcUnits []float64 `json:"idleProcUnits"`
DonatedProcUnits []float64 `json:"donatedProcUnits"`
TimeSpentWaitingForDispatch []float64 `json:"timeSpentWaitingForDispatch"`
TimePerInstructionExecution []float64 `json:"timePerInstructionExecution"`
} `json:"processor"`
Storage struct {
VirtualFiberChannelAdapters []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
Wwpn string `json:"wwpn"`
Wwpn2 string `json:"wwpn2"`
ViosID int `json:"viosId"`
PhysicalLocation string `json:"physicalLocation"`
PhysicalPortWWPN string `json:"physicalPortWWPN"`
RunningSpeed []float64 `json:"runningSpeed"`
ID string `json:"id"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"virtualFiberChannelAdapters"`
GenericVirtualAdapters []struct {
TransmittedBytes []float64 `json:"transmittedBytes"`
Type string `json:"type"`
ID string `json:"id"`
ViosID int `json:"viosId"`
PhysicalLocation string `json:"physicalLocation"`
NumOfReads []float64 `json:"numOfReads"`
NumOfWrites []float64 `json:"numOfWrites"`
ReadBytes []float64 `json:"readBytes"`
WriteBytes []float64 `json:"writeBytes"`
} `json:"genericVirtualAdapters"`
} `json:"storage"`
Network struct {
VirtualEthernetAdapters []struct {
TransferredPhysicalBytes []float64 `json:"transferredPhysicalBytes"`
TransferredBytes []float64 `json:"transferredBytes"`
PhysicalLocation string `json:"physicalLocation"`
VlanID int `json:"vlanId"`
VswitchID int `json:"vswitchId"`
IsPortVlanID bool `json:"isPortVlanId"`
ReceivedPackets []float64 `json:"receivedPackets"`
SentPackets []float64 `json:"sentPackets"`
DroppedPackets []float64 `json:"droppedPackets"`
SentBytes []float64 `json:"sentBytes"`
ReceivedBytes []float64 `json:"receivedBytes"`
ReceivedPhysicalPackets []float64 `json:"receivedPhysicalPackets"`
SentPhysicalPackets []float64 `json:"sentPhysicalPackets"`
DroppedPhysicalPackets []float64 `json:"droppedPhysicalPackets"`
SentPhysicalBytes []float64 `json:"sentPhysicalBytes"`
ReceivedPhysicalBytes []float64 `json:"receivedPhysicalBytes"`
ViosID int `json:"viosId,omitempty"`
SharedEthernetAdapterID string `json:"sharedEthernetAdapterId,omitempty"`
} `json:"virtualEthernetAdapters"`
SriovLogicalPorts []struct {
DrcIndex string `json:"drcIndex"`
PhysicalLocation string `json:"physicalLocation"`
PhysicalDrcIndex string `json:"physicalDrcIndex"`
PhysicalPortID int `json:"physicalPortId"`
TransferredBytes []float64 `json:"transferredBytes"`
VlanID int `json:"vlanId"`
VswitchID int `json:"vswitchId"`
IsPortVlanID bool `json:"isPortVlanId"`
ReceivedPackets []float64 `json:"receivedPackets"`
SentPackets []float64 `json:"sentPackets"`
DroppedPackets []float64 `json:"droppedPackets"`
SentBytes []float64 `json:"sentBytes"`
ReceivedBytes []float64 `json:"receivedBytes"`
ViosID int `json:"viosId,omitempty"`
} `json:"sriovLogicalPorts"`
} `json:"network"`
State string `json:"state"`
UUID string `json:"uuid"`
} `json:"lparsUtil"`
SampleInfo struct {
TimeStamp string `json:"timeStamp"`
Status int `json:"status"`
ErrorInfo []struct {
ErrID string `json:"errId"`
ErrMsg string `json:"errMsg"`
UUID string `json:"uuid"`
ReportedBy string `json:"reportedBy"`
OccurrenceCount int `json:"occurrenceCount"`
} `json:"errorInfo"`
} `json:"sampleInfo"`
} `json:"utilSamples"`
} `json:"systemUtil"`
}
PCMData contains the json data structure
type Partitions ¶
type Partitions struct {
Links []Link `xml:"link,omitempty"`
}
Partitions contains links to the partition informations
type Point ¶
type Point struct {
Name string
System string
Metric string
Pool string
Device string
Partition string
Type string
WWPN string
PhysicalPortWWPN string
ViosID string
VlanID string
VswitchID string
DrcIndex string
PhysicalLocation string
PhysicalDrcIndex string
PhysicalPortID string
Value interface{}
Timestamp time.Time
}
Point is a struct to simplify InfluxDB point creation