This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log warning when wireless plugin is used on unsupported platform (inf…
- Loading branch information
1 parent
46b340c
commit 140387d
Showing
4 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
// +build !linux | ||
|
||
package wireless | ||
|
||
import ( | ||
"github.com/influxdata/telegraf" | ||
"github.com/influxdata/telegraf/plugins/inputs" | ||
) | ||
|
||
// Wireless is used to store configuration values. | ||
type Wireless struct { | ||
HostProc string `toml:"host_proc"` | ||
} | ||
|
||
var sampleConfig = ` | ||
## Sets 'proc' directory path | ||
## If not specified, then default is /proc | ||
# host_proc = "/proc" | ||
` | ||
|
||
// Description returns information about the plugin. | ||
func (w *Wireless) Description() string { | ||
return "Monitor wifi signal strength and quality" | ||
} | ||
|
||
// SampleConfig displays configuration instructions. | ||
func (w *Wireless) SampleConfig() string { | ||
return sampleConfig | ||
} | ||
|
||
func init() { | ||
inputs.Add("wireless", func() telegraf.Input { | ||
return &Wireless{} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// +build !linux | ||
|
||
package wireless | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/influxdata/telegraf" | ||
"github.com/influxdata/telegraf/plugins/inputs" | ||
) | ||
|
||
func (w *Wireless) Gather(acc telegraf.Accumulator) error { | ||
return nil | ||
} | ||
|
||
func init() { | ||
inputs.Add("wireless", func() telegraf.Input { | ||
log.Print("W! [inputs.wireless] Current platform is not supported") | ||
return &Wireless{} | ||
}) | ||
} |