chore: Unify sample configs across OSes (#12789)

This commit is contained in:
Joshua Powers 2023-03-07 01:38:05 -07:00 committed by GitHub
parent ee682539e7
commit 4747e7ba10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 583 additions and 8 deletions

View File

@ -1,3 +1,30 @@
//go:build !linux
package bcache
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Bcache struct {
Log telegraf.Logger `toml:"-"`
}
func (b *Bcache) Init() error {
b.Log.Warn("current platform is not supported")
return nil
}
func (*Bcache) SampleConfig() string { return sampleConfig }
func (*Bcache) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("bcache", func() telegraf.Input {
return &Bcache{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package conntrack
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Conntrack struct {
Log telegraf.Logger `toml:"-"`
}
func (c *Conntrack) Init() error {
c.Log.Warn("current platform is not supported")
return nil
}
func (*Conntrack) SampleConfig() string { return sampleConfig }
func (*Conntrack) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("conntrack", func() telegraf.Input {
return &Conntrack{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package dpdk
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Dpdk struct {
Log telegraf.Logger `toml:"-"`
}
func (d *Dpdk) Init() error {
d.Log.Warn("current platform is not supported")
return nil
}
func (*Dpdk) SampleConfig() string { return sampleConfig }
func (*Dpdk) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("dpdk", func() telegraf.Input {
return &Dpdk{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package hugepages
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Hugepages struct {
Log telegraf.Logger `toml:"-"`
}
func (h *Hugepages) Init() error {
h.Log.Warn("current platform is not supported")
return nil
}
func (*Hugepages) SampleConfig() string { return sampleConfig }
func (*Hugepages) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("hugepages", func() telegraf.Input {
return &Hugepages{}
})
}

View File

@ -1,4 +1,30 @@
//go:build !linux
// +build !linux
package intel_dlb
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type IntelDLB struct {
Log telegraf.Logger `toml:"-"`
}
func (i *IntelDLB) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*IntelDLB) SampleConfig() string { return sampleConfig }
func (*IntelDLB) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("intel_dlb", func() telegraf.Input {
return &IntelDLB{}
})
}

View File

@ -1,3 +1,32 @@
//go:build !linux || !amd64
package intel_pmu
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type IntelPMU struct {
Log telegraf.Logger `toml:"-"`
}
func (i *IntelPMU) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*IntelPMU) SampleConfig() string { return sampleConfig }
func (*IntelPMU) Gather(_ telegraf.Accumulator) error { return nil }
func (*IntelPMU) Start(_ telegraf.Accumulator) error { return nil }
func (*IntelPMU) Stop() {}
func init() {
inputs.Add("intel_pmu", func() telegraf.Input {
return &IntelPMU{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package intel_powerstat
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type IntelPowerstat struct {
Log telegraf.Logger `toml:"-"`
}
func (i *IntelPowerstat) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*IntelPowerstat) SampleConfig() string { return sampleConfig }
func (*IntelPowerstat) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("intel_powerstat", func() telegraf.Input {
return &IntelPowerstat{}
})
}

View File

@ -1,3 +1,32 @@
//go:build windows
package intel_rdt
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type IntelRDT struct {
Log telegraf.Logger `toml:"-"`
}
func (i *IntelRDT) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*IntelRDT) SampleConfig() string { return sampleConfig }
func (*IntelRDT) Gather(_ telegraf.Accumulator) error { return nil }
func (*IntelRDT) Start(_ telegraf.Accumulator) error { return nil }
func (*IntelRDT) Stop() {}
func init() {
inputs.Add("intel_rdt", func() telegraf.Input {
return &IntelRDT{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package iptables
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Iptables struct {
Log telegraf.Logger `toml:"-"`
}
func (i *Iptables) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*Iptables) SampleConfig() string { return sampleConfig }
func (*Iptables) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("iptables", func() telegraf.Input {
return &Iptables{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package ipvs
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Ipvs struct {
Log telegraf.Logger `toml:"-"`
}
func (i *Ipvs) Init() error {
i.Log.Warn("current platform is not supported")
return nil
}
func (*Ipvs) SampleConfig() string { return sampleConfig }
func (*Ipvs) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("ipvs", func() telegraf.Input {
return &Ipvs{}
})
}

View File

@ -3,22 +3,25 @@
package kernel
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Kernel struct {
Log telegraf.Logger `toml:"-"`
}
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 {
func (k *Kernel) Init() error {
k.Log.Warn("current platform is not supported")
return nil
}
func (*Kernel) SampleConfig() string { return sampleConfig }
func (*Kernel) Gather(acc telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("kernel", func() telegraf.Input {

View File

@ -1,3 +1,30 @@
//go:build !linux
package kernel_vmstat
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type KernelVmstat struct {
Log telegraf.Logger `toml:"-"`
}
func (k *KernelVmstat) Init() error {
k.Log.Warn("current platform is not supported")
return nil
}
func (*KernelVmstat) SampleConfig() string { return sampleConfig }
func (*KernelVmstat) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("kernel_vmstat", func() telegraf.Input {
return &KernelVmstat{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package linux_cpu
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type LinuxCPU struct {
Log telegraf.Logger `toml:"-"`
}
func (l *LinuxCPU) Init() error {
l.Log.Warn("current platform is not supported")
return nil
}
func (*LinuxCPU) SampleConfig() string { return sampleConfig }
func (*LinuxCPU) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("linux_cpu", func() telegraf.Input {
return &LinuxCPU{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package lustre2
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Lustre2 struct {
Log telegraf.Logger `toml:"-"`
}
func (l *Lustre2) Init() error {
l.Log.Warn("current platform is not supported")
return nil
}
func (*Lustre2) SampleConfig() string { return sampleConfig }
func (*Lustre2) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("lustre2", func() telegraf.Input {
return &Lustre2{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package mdstat
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Mdstat struct {
Log telegraf.Logger `toml:"-"`
}
func (m *Mdstat) Init() error {
m.Log.Warn("current platform is not supported")
return nil
}
func (*Mdstat) SampleConfig() string { return sampleConfig }
func (*Mdstat) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("mdstat", func() telegraf.Input {
return &Mdstat{}
})
}

View File

@ -1,3 +1,30 @@
//go:build windows
package postfix
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Postfix struct {
Log telegraf.Logger `toml:"-"`
}
func (p *Postfix) Init() error {
p.Log.Warn("current platform is not supported")
return nil
}
func (*Postfix) SampleConfig() string { return sampleConfig }
func (*Postfix) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("postfix", func() telegraf.Input {
return &Postfix{}
})
}

View File

@ -1,3 +1,32 @@
//go:build !linux || (linux && !386 && !amd64 && !arm && !arm64)
package ras
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Ras struct {
Log telegraf.Logger `toml:"-"`
}
func (r *Ras) Init() error {
r.Log.Warn("current platform is not supported")
return nil
}
func (*Ras) SampleConfig() string { return sampleConfig }
func (*Ras) Gather(_ telegraf.Accumulator) error { return nil }
func (*Ras) Start(_ telegraf.Accumulator) error { return nil }
func (*Ras) Stop() {}
func init() {
inputs.Add("ras", func() telegraf.Input {
return &Ras{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package sensors
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Sensors struct {
Log telegraf.Logger `toml:"-"`
}
func (s *Sensors) Init() error {
s.Log.Warn("current platform is not supported")
return nil
}
func (*Sensors) SampleConfig() string { return sampleConfig }
func (*Sensors) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("sensors", func() telegraf.Input {
return &Sensors{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package slab
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Slab struct {
Log telegraf.Logger `toml:"-"`
}
func (s *Slab) Init() error {
s.Log.Warn("current platform is not supported")
return nil
}
func (*Slab) SampleConfig() string { return sampleConfig }
func (*Slab) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("slab", func() telegraf.Input {
return &Slab{}
})
}

View File

@ -1,3 +1,30 @@
//go:build windows
package socketstat
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Socketstat struct {
Log telegraf.Logger `toml:"-"`
}
func (s *Socketstat) Init() error {
s.Log.Warn("current platform is not supported")
return nil
}
func (*Socketstat) SampleConfig() string { return sampleConfig }
func (*Socketstat) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("socketstat", func() telegraf.Input {
return &Socketstat{}
})
}

View File

@ -1,3 +1,30 @@
//go:build !linux
package sysstat
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Sysstat struct {
Log telegraf.Logger `toml:"-"`
}
func (s *Sysstat) Init() error {
s.Log.Warn("current platform is not supported")
return nil
}
func (*Sysstat) SampleConfig() string { return sampleConfig }
func (*Sysstat) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("sysstat", func() telegraf.Input {
return &Sysstat{}
})
}

View File

@ -1,3 +1,30 @@
//go:build windows
package varnish
import (
_ "embed"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
//go:embed sample.conf
var sampleConfig string
type Varnish struct {
Log telegraf.Logger `toml:"-"`
}
func (v *Varnish) Init() error {
v.Log.Warn("current platform is not supported")
return nil
}
func (*Varnish) SampleConfig() string { return sampleConfig }
func (*Varnish) Gather(_ telegraf.Accumulator) error { return nil }
func init() {
inputs.Add("varnish", func() telegraf.Input {
return &Varnish{}
})
}