From 9fe52a095a00020db0919f2f52db6c21d262a8d9 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Mon, 4 Apr 2016 17:43:53 -0600 Subject: [PATCH] Dummy kernel plugin added for consistent config generation --- etc/telegraf.conf | 5 +++++ plugins/inputs/system/kernel_notlinux.go | 27 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 plugins/inputs/system/kernel_notlinux.go diff --git a/etc/telegraf.conf b/etc/telegraf.conf index 694bd6564..3d65aaf62 100644 --- a/etc/telegraf.conf +++ b/etc/telegraf.conf @@ -378,6 +378,11 @@ # skip_serial_number = true +# Get kernel statistics from /proc/stat +[[inputs.kernel]] + # no configuration + + # Read metrics about memory usage [[inputs.mem]] # no configuration diff --git a/plugins/inputs/system/kernel_notlinux.go b/plugins/inputs/system/kernel_notlinux.go new file mode 100644 index 000000000..9053b5c04 --- /dev/null +++ b/plugins/inputs/system/kernel_notlinux.go @@ -0,0 +1,27 @@ +// +build !linux + +package system + +import ( + "github.com/influxdata/telegraf" + "github.com/influxdata/telegraf/plugins/inputs" +) + +type Kernel struct { +} + +func (k *Kernel) Description() string { + return "Get kernel statistics from /proc/stat" +} + +func (k *Kernel) SampleConfig() string { return "" } + +func (k *Kernel) Gather(acc telegraf.Accumulator) error { + return nil +} + +func init() { + inputs.Add("kernel", func() telegraf.Input { + return &Kernel{} + }) +}