mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
24 lines
378 B
Go
24 lines
378 B
Go
|
package monitor
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/influxdata/influxdb/monitor/diagnostics"
|
||
|
)
|
||
|
|
||
|
// network captures network diagnostics.
|
||
|
type network struct{}
|
||
|
|
||
|
func (n *network) Diagnostics() (*diagnostics.Diagnostics, error) {
|
||
|
h, err := os.Hostname()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
d := map[string]interface{}{
|
||
|
"hostname": h,
|
||
|
}
|
||
|
|
||
|
return diagnostics.RowFromMap(d), nil
|
||
|
}
|