Browse Source

docs

master
squeaky otter 5 years ago
parent
commit
08190a86e0
Signed by: dashie GPG Key ID: C2D57B325840B755
  1. 3
      battery_linux/battery_linux.go
  2. 2
      nvidia_smi/nvidia_smi.go
  3. 2
      wireless/wireless.go

3
battery_linux/battery_linux.go

@ -35,7 +35,10 @@ func batteryThings(battery string) (map[string]string, bool) {
func printBattery(things map[string]string) {
idx := strings.Replace(things["BAT_NAME"], "BAT", "", 1)
// tags
fmt.Printf("battery_linux,battery=%s,idx=%s ", things["BAT_NAME"], idx)
// values
fmt.Printf("present=%s,", things["POWER_SUPPLY_PRESENT"])
fmt.Printf("cycle_count=%s,", things["POWER_SUPPLY_CYCLE_COUNT"])
fmt.Printf("voltage_min_design=%s,", things["POWER_SUPPLY_VOLTAGE_MIN_DESIGN"])

2
nvidia_smi/nvidia_smi.go

@ -46,8 +46,10 @@ func main() {
splitResults := strings.Split(results, ",")
// tags
fmt.Printf("nvidiasmi,uuid=%s ", strings.TrimSpace(splitResults[7])) // it should be available ... if no, you have some problems
// values
fmt.Printf("gpu_name=\"%s\",", strings.TrimSpace(splitResults[6]))
fmt.Printf("gpu_compute_mode=\"%s\",", strings.TrimSpace(splitResults[8]))

2
wireless/wireless.go

@ -37,8 +37,10 @@ func main() {
return
}
// tags
fmt.Printf("pnwireless,interface=%s ", iface)
// values
fmt.Printf("status=%s,", infos[0])
fmt.Printf("qual_link=%s,", strings.Trim(infos[1], "."))

Loading…
Cancel
Save