2015-09-03 02:38:31 +00:00
|
|
|
package monitor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2016-02-13 22:56:15 +00:00
|
|
|
|
|
|
|
"github.com/influxdata/influxdb/monitor/diagnostics"
|
2015-09-03 02:38:31 +00:00
|
|
|
)
|
|
|
|
|
2016-12-30 20:34:53 +00:00
|
|
|
// network captures network diagnostics.
|
2015-09-03 02:38:31 +00:00
|
|
|
type network struct{}
|
|
|
|
|
2016-02-13 22:56:15 +00:00
|
|
|
func (n *network) Diagnostics() (*diagnostics.Diagnostics, error) {
|
2015-09-03 02:38:31 +00:00
|
|
|
h, err := os.Hostname()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2017-01-17 22:50:35 +00:00
|
|
|
d := map[string]interface{}{
|
2015-09-03 02:38:31 +00:00
|
|
|
"hostname": h,
|
|
|
|
}
|
|
|
|
|
2017-01-17 22:50:35 +00:00
|
|
|
return diagnostics.RowFromMap(d), nil
|
2015-09-03 02:38:31 +00:00
|
|
|
}
|