This commit is contained in:
@@ -15,13 +15,14 @@ type UcsmTemperaturesCollector struct {
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
type ComputeMbTempStats struct {
|
||||
XMLName xml.Name `xml:"computeMbTempStats"`
|
||||
Dn string `xml:"dn,attr,omitempty"`
|
||||
FmTempSenIo string `xml:"fmTempSenIo,attr,omitempty"`
|
||||
FmTempSenRear string `xml:"fmTempSenRear,attr,omitempty"`
|
||||
}
|
||||
|
||||
/*
|
||||
type ComputeMbTempStats struct {
|
||||
XMLName xml.Name `xml:"computeMbTempStats"`
|
||||
Dn string `xml:"dn,attr,omitempty"`
|
||||
FmTempSenIo string `xml:"fmTempSenIo,attr,omitempty"`
|
||||
FmTempSenRear string `xml:"fmTempSenRear,attr,omitempty"`
|
||||
}
|
||||
*/
|
||||
func NewUcsmTemperatureCollector(client *api.Client, ctx context.Context) *UcsmTemperaturesCollector {
|
||||
return &UcsmTemperaturesCollector{
|
||||
ucsClient: client,
|
||||
@@ -52,7 +53,7 @@ func (u *UcsmTemperaturesCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
|
||||
type temps struct {
|
||||
XMLName xml.Name
|
||||
Temperatures []ComputeMbTempStats `xml:"computeMbTempStats"`
|
||||
Temperatures []mo.ComputeMbTempStats `xml:"computeMbTempStats"`
|
||||
}
|
||||
|
||||
bladeRequest := api.ConfigResolveClassRequest{
|
||||
@@ -74,6 +75,7 @@ func (u *UcsmTemperaturesCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
log.Printf("%s:\n", blade.Dn)
|
||||
|
||||
boardDn := "^" + blade.Dn + "/board/"
|
||||
//boardDn := blade.Dn + "/board/"
|
||||
|
||||
log.Printf("%s:\n", boardDn)
|
||||
log.Printf("\tNumber of CPUs: %d\n", blade.NumOfCpus)
|
||||
@@ -100,10 +102,12 @@ func (u *UcsmTemperaturesCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
|
||||
var tempList temps
|
||||
log.Printf("Retrieving temperatures for this blade\n")
|
||||
if err := u.ucsClient.ConfigResolveClass(u.ctx, tempReq, &tempList); err != nil {
|
||||
log.Fatalf("Unable to retrieve `computeMbTempStats` managed object: %s", err)
|
||||
}
|
||||
|
||||
/*
|
||||
if err := u.ucsClient.ConfigResolveClass(u.ctx, tempReq, &tempList); err != nil {
|
||||
log.Fatalf("Unable to retrieve `computeMbTempStats` managed object: %s", err)
|
||||
}
|
||||
*/
|
||||
u.ucsClient.ConfigResolveClass(u.ctx, tempReq, &tempList)
|
||||
log.Printf("Front Temperature: %v\n", tempList)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user