Dell EMC Unity package that provides API bindings for Go.
server := "myunity.example.com"
insecure := true
username := "myuser"
password := "mypassword"
session, err := gounity.NewSession(server, insecure, username, password)
if err != nil {
log.Fatal(err)
}
err = session.GetDNSServer()
if err != nil {
log.Fatal(err)
}
// metric paths
paths := []string{
"sp.*.cpu.summary.busyTicks",
"sp.*.cpu.uptime",
"sp.*.storage.pool.*.sizeFree",
"sp.*.storage.pool.*.sizeSubscribed",
"sp.*.storage.pool.*.sizeTotal",
"sp.*.storage.pool.*.sizeUsed",
"sp.*.storage.pool.*.sizeUsedBlocks",
"sp.*.memory.summary.totalBytes",
"sp.*.memory.summary.totalUsedBytes",
}
// metric interval in second
var interval uint32
interval = 60
Metric, err := session.NewMetricRealTimeQuery(paths, interval)
if err != nil {
log.Fatal(err)
}
Erwan Quélin
Copyright 2017 Erwan Quelin and the community.
Licensed under the MIT License.