Compare commits
4 Commits
cam-extern
...
telegraf-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4e48f9909 | ||
|
|
2eee1b84fb | ||
|
|
9726ecfec3 | ||
|
|
c8cc01ba6a |
@@ -27,8 +27,15 @@ The previous riemann output will still be available using
|
|||||||
`outputs.riemann_legacy` if needed, but that will eventually be deprecated.
|
`outputs.riemann_legacy` if needed, but that will eventually be deprecated.
|
||||||
It is highly recommended that all users migrate to the new riemann output plugin.
|
It is highly recommended that all users migrate to the new riemann output plugin.
|
||||||
|
|
||||||
|
- Generic [socket_listener](./plugins/inputs/socket_listener) and
|
||||||
|
[socket_writer](./plugins/outputs/socket_writer) plugins have been implemented
|
||||||
|
for receiving and sending UDP, TCP, unix, & unix-datagram data. These plugins
|
||||||
|
will replace udp_listener and tcp_listener, which are still available but will
|
||||||
|
be deprecated eventually.
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
- [#2094](https://github.com/influxdata/telegraf/pull/2094): Add generic socket listener & writer.
|
||||||
- [#2204](https://github.com/influxdata/telegraf/pull/2204): Extend http_response to support searching for a substring in response. Return 1 if found, else 0.
|
- [#2204](https://github.com/influxdata/telegraf/pull/2204): Extend http_response to support searching for a substring in response. Return 1 if found, else 0.
|
||||||
- [#2137](https://github.com/influxdata/telegraf/pull/2137): Added userstats to mysql input plugin.
|
- [#2137](https://github.com/influxdata/telegraf/pull/2137): Added userstats to mysql input plugin.
|
||||||
- [#2179](https://github.com/influxdata/telegraf/pull/2179): Added more InnoDB metric to MySQL plugin.
|
- [#2179](https://github.com/influxdata/telegraf/pull/2179): Added more InnoDB metric to MySQL plugin.
|
||||||
@@ -112,7 +119,6 @@ plugins, not just statsd.
|
|||||||
- [#1980](https://github.com/influxdata/telegraf/issues/1980): Hide username/password from elasticsearch error log messages.
|
- [#1980](https://github.com/influxdata/telegraf/issues/1980): Hide username/password from elasticsearch error log messages.
|
||||||
- [#2097](https://github.com/influxdata/telegraf/issues/2097): Configurable HTTP timeouts in Jolokia plugin
|
- [#2097](https://github.com/influxdata/telegraf/issues/2097): Configurable HTTP timeouts in Jolokia plugin
|
||||||
- [#2255](https://github.com/influxdata/telegraf/pull/2255): Allow changing jolokia attribute delimiter
|
- [#2255](https://github.com/influxdata/telegraf/pull/2255): Allow changing jolokia attribute delimiter
|
||||||
- [#2094](https://github.com/influxdata/telegraf/pull/2094): Add generic socket listener & writer.
|
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
|||||||
@@ -184,8 +184,8 @@ Telegraf can also collect metrics via the following service plugins:
|
|||||||
* [statsd](./plugins/inputs/statsd)
|
* [statsd](./plugins/inputs/statsd)
|
||||||
* [socket_listener](./plugins/inputs/socket_listener)
|
* [socket_listener](./plugins/inputs/socket_listener)
|
||||||
* [tail](./plugins/inputs/tail)
|
* [tail](./plugins/inputs/tail)
|
||||||
* [tcp_listener](./plugins/inputs/tcp_listener)
|
* [tcp_listener](./plugins/inputs/socket_listener)
|
||||||
* [udp_listener](./plugins/inputs/udp_listener)
|
* [udp_listener](./plugins/inputs/socket_listener)
|
||||||
* [webhooks](./plugins/inputs/webhooks)
|
* [webhooks](./plugins/inputs/webhooks)
|
||||||
* [filestack](./plugins/inputs/webhooks/filestack)
|
* [filestack](./plugins/inputs/webhooks/filestack)
|
||||||
* [github](./plugins/inputs/webhooks/github)
|
* [github](./plugins/inputs/webhooks/github)
|
||||||
@@ -220,9 +220,11 @@ Telegraf can also collect metrics via the following service plugins:
|
|||||||
* [nsq](./plugins/outputs/nsq)
|
* [nsq](./plugins/outputs/nsq)
|
||||||
* [opentsdb](./plugins/outputs/opentsdb)
|
* [opentsdb](./plugins/outputs/opentsdb)
|
||||||
* [prometheus](./plugins/outputs/prometheus_client)
|
* [prometheus](./plugins/outputs/prometheus_client)
|
||||||
* [socket_writer](./plugins/outputs/socket_writer)
|
|
||||||
* [riemann](./plugins/outputs/riemann)
|
* [riemann](./plugins/outputs/riemann)
|
||||||
* [riemann_legacy](./plugins/outputs/riemann_legacy)
|
* [riemann_legacy](./plugins/outputs/riemann_legacy)
|
||||||
|
* [socket_writer](./plugins/outputs/socket_writer)
|
||||||
|
* [tcp](./plugins/outputs/socket_writer)
|
||||||
|
* [udp](./plugins/outputs/socket_writer)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ machine:
|
|||||||
post:
|
post:
|
||||||
- sudo service zookeeper stop
|
- sudo service zookeeper stop
|
||||||
- go version
|
- go version
|
||||||
- go version | grep 1.7.5 || sudo rm -rf /usr/local/go
|
- sudo rm -rf /usr/local/go
|
||||||
- wget https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz
|
- wget https://storage.googleapis.com/golang/go1.8rc3.linux-amd64.tar.gz
|
||||||
- sudo tar -C /usr/local -xzf go1.7.5.linux-amd64.tar.gz
|
- sudo tar -C /usr/local -xzf go1.8rc3.linux-amd64.tar.gz
|
||||||
- go version
|
- go version
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"path"
|
||||||
|
"path/filepath"
|
||||||
|
"plugin"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
@@ -13,12 +16,15 @@ import (
|
|||||||
"github.com/influxdata/telegraf/agent"
|
"github.com/influxdata/telegraf/agent"
|
||||||
"github.com/influxdata/telegraf/internal/config"
|
"github.com/influxdata/telegraf/internal/config"
|
||||||
"github.com/influxdata/telegraf/logger"
|
"github.com/influxdata/telegraf/logger"
|
||||||
|
"github.com/influxdata/telegraf/registry"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
"github.com/influxdata/telegraf/registry/outputs"
|
||||||
|
|
||||||
_ "github.com/influxdata/telegraf/plugins/aggregators/all"
|
_ "github.com/influxdata/telegraf/plugins/aggregators/all"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
_ "github.com/influxdata/telegraf/plugins/inputs/all"
|
_ "github.com/influxdata/telegraf/plugins/inputs/all"
|
||||||
"github.com/influxdata/telegraf/plugins/outputs"
|
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/all"
|
_ "github.com/influxdata/telegraf/plugins/outputs/all"
|
||||||
_ "github.com/influxdata/telegraf/plugins/processors/all"
|
_ "github.com/influxdata/telegraf/plugins/processors/all"
|
||||||
|
|
||||||
"github.com/kardianos/service"
|
"github.com/kardianos/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,6 +56,8 @@ var fUsage = flag.String("usage", "",
|
|||||||
"print usage for a plugin, ie, 'telegraf -usage mysql'")
|
"print usage for a plugin, ie, 'telegraf -usage mysql'")
|
||||||
var fService = flag.String("service", "",
|
var fService = flag.String("service", "",
|
||||||
"operate on the service")
|
"operate on the service")
|
||||||
|
var fPlugins = flag.String("plugins", "",
|
||||||
|
"path to directory containing external plugins")
|
||||||
|
|
||||||
// Telegraf version, populated linker.
|
// Telegraf version, populated linker.
|
||||||
// ie, -ldflags "-X main.version=`git describe --always --tags`"
|
// ie, -ldflags "-X main.version=`git describe --always --tags`"
|
||||||
@@ -246,11 +254,62 @@ func (p *program) Stop(s service.Service) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// loadExternalPlugins loads external plugins from shared libraries (.so, .dll, etc.)
|
||||||
|
// in the specified directory.
|
||||||
|
func loadExternalPlugins(rootDir string) error {
|
||||||
|
return filepath.Walk(rootDir, func(pth string, info os.FileInfo, err error) error {
|
||||||
|
// Stop if there was an error.
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore directories.
|
||||||
|
if info.IsDir() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore files that aren't shared libraries.
|
||||||
|
ext := strings.ToLower(path.Ext(pth))
|
||||||
|
if ext != ".so" && ext != ".dll" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// name will be the path to the plugin file beginning at the root
|
||||||
|
// directory, minus the extension.
|
||||||
|
// ie, if the plugin file is /opt/telegraf-plugins/group1/foo.so, name
|
||||||
|
// will be "group1/foo"
|
||||||
|
name := strings.TrimPrefix(strings.TrimPrefix(pth, rootDir), string(os.PathSeparator))
|
||||||
|
name = strings.TrimSuffix(name, filepath.Ext(pth))
|
||||||
|
registry.SetName("external" + string(os.PathSeparator) + name)
|
||||||
|
defer registry.SetName("")
|
||||||
|
|
||||||
|
// Load plugin.
|
||||||
|
_, err = plugin.Open(pth)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error loading [%s]: %s", pth, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { usageExit(0) }
|
flag.Usage = func() { usageExit(0) }
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
|
||||||
|
// Load external plugins, if requested.
|
||||||
|
if *fPlugins != "" {
|
||||||
|
pluginsDir, err := filepath.Abs(*fPlugins)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("E! " + err.Error())
|
||||||
|
}
|
||||||
|
log.Printf("I! Loading external plugins from: %s\n", pluginsDir)
|
||||||
|
if err := loadExternalPlugins(*fPlugins); err != nil {
|
||||||
|
log.Fatal("E! " + err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inputFilters, outputFilters := []string{}, []string{}
|
inputFilters, outputFilters := []string{}, []string{}
|
||||||
if *fInputFilters != "" {
|
if *fInputFilters != "" {
|
||||||
inputFilters = strings.Split(":"+strings.TrimSpace(*fInputFilters)+":", ":")
|
inputFilters = strings.Split(":"+strings.TrimSpace(*fInputFilters)+":", ":")
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/internal/models"
|
"github.com/influxdata/telegraf/internal/models"
|
||||||
"github.com/influxdata/telegraf/plugins/aggregators"
|
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/outputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
"github.com/influxdata/telegraf/plugins/processors"
|
|
||||||
"github.com/influxdata/telegraf/plugins/serializers"
|
"github.com/influxdata/telegraf/plugins/serializers"
|
||||||
|
"github.com/influxdata/telegraf/registry/aggregators"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
"github.com/influxdata/telegraf/registry/outputs"
|
||||||
|
"github.com/influxdata/telegraf/registry/processors"
|
||||||
|
|
||||||
"github.com/influxdata/config"
|
"github.com/influxdata/config"
|
||||||
"github.com/influxdata/toml"
|
"github.com/influxdata/toml"
|
||||||
@@ -40,6 +40,14 @@ var (
|
|||||||
|
|
||||||
// envVarRe is a regex to find environment variables in the config file
|
// envVarRe is a regex to find environment variables in the config file
|
||||||
envVarRe = regexp.MustCompile(`\$\w+`)
|
envVarRe = regexp.MustCompile(`\$\w+`)
|
||||||
|
|
||||||
|
// addQuoteRe is a regex for finding and adding quotes around / characters
|
||||||
|
// when they are used for distinguishing external plugins.
|
||||||
|
// ie, a ReplaceAll() with this pattern will be used to turn this:
|
||||||
|
// [[inputs.external/test/example]]
|
||||||
|
// to
|
||||||
|
// [[inputs."external/test/example"]]
|
||||||
|
addQuoteRe = regexp.MustCompile(`(\[?\[?inputs|outputs|processors|aggregators)\.(external\/[^.\]]+)`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config specifies the URL/user/password for the database that telegraf
|
// Config specifies the URL/user/password for the database that telegraf
|
||||||
@@ -701,6 +709,9 @@ func parseFile(fpath string) (*ast.Table, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add quotes around external plugin paths.
|
||||||
|
contents = addQuoteRe.ReplaceAll(contents, []byte(`$1."$2"`))
|
||||||
|
|
||||||
return toml.Parse(contents)
|
return toml.Parse(contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf/internal/models"
|
"github.com/influxdata/telegraf/internal/models"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/exec"
|
"github.com/influxdata/telegraf/plugins/inputs/exec"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/memcached"
|
"github.com/influxdata/telegraf/plugins/inputs/memcached"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/procstat"
|
"github.com/influxdata/telegraf/plugins/inputs/procstat"
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package minmax
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/aggregators"
|
"github.com/influxdata/telegraf/registry/aggregators"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MinMax struct {
|
type MinMax struct {
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package aggregators
|
|
||||||
|
|
||||||
import "github.com/influxdata/telegraf"
|
|
||||||
|
|
||||||
type Creator func() telegraf.Aggregator
|
|
||||||
|
|
||||||
var Aggregators = map[string]Creator{}
|
|
||||||
|
|
||||||
func Add(name string, creator Creator) {
|
|
||||||
Aggregators[name] = creator
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
as "github.com/aerospike/aerospike-client-go"
|
as "github.com/aerospike/aerospike-client-go"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Apache struct {
|
type Apache struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Bcache struct {
|
type Bcache struct {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package cgroup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CGroup struct {
|
type CGroup struct {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
internalaws "github.com/influxdata/telegraf/internal/config/aws"
|
internalaws "github.com/influxdata/telegraf/internal/config/aws"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/internal/limiter"
|
"github.com/influxdata/telegraf/internal/limiter"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/hashicorp/consul/api"
|
"github.com/hashicorp/consul/api"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Consul struct {
|
type Consul struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package couchbase
|
|||||||
import (
|
import (
|
||||||
couchbase "github.com/couchbase/go-couchbase"
|
couchbase "github.com/couchbase/go-couchbase"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Disque struct {
|
type Disque struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DnsQuery struct {
|
type DnsQuery struct {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/engine-api/types"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Docker object
|
// Docker object
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Dovecot struct {
|
type Dovecot struct {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
jsonparser "github.com/influxdata/telegraf/plugins/parsers/json"
|
jsonparser "github.com/influxdata/telegraf/plugins/parsers/json"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
"github.com/influxdata/telegraf/plugins/parsers/nagios"
|
"github.com/influxdata/telegraf/plugins/parsers/nagios"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/globpath"
|
"github.com/influxdata/telegraf/internal/globpath"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ResponseMetrics struct {
|
type ResponseMetrics struct {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
//CSV format: https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#9.1
|
//CSV format: https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#9.1
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ package hddtemp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
gohddtemp "github.com/influxdata/telegraf/plugins/inputs/hddtemp/go-hddtemp"
|
gohddtemp "github.com/influxdata/telegraf/plugins/inputs/hddtemp/go-hddtemp"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultAddress = "127.0.0.1:7634"
|
const defaultAddress = "127.0.0.1:7634"
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers/influx"
|
"github.com/influxdata/telegraf/plugins/parsers/influx"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/influxdata/telegraf/selfstat"
|
"github.com/influxdata/telegraf/selfstat"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTTPResponse struct
|
// HTTPResponse struct
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HttpJson struct
|
// HttpJson struct
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InfluxDB struct {
|
type InfluxDB struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/influxdata/telegraf/selfstat"
|
"github.com/influxdata/telegraf/selfstat"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Iptables is a telegraf plugin to gather packets and bytes throughput from Linux's iptables packet filter.
|
// Iptables is a telegraf plugin to gather packets and bytes throughput from Linux's iptables packet filter.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default http timeouts
|
// Default http timeouts
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"github.com/wvanbergen/kafka/consumergroup"
|
"github.com/wvanbergen/kafka/consumergroup"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Kubernetes represents the config object for the plugin
|
// Kubernetes represents the config object for the plugin
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const oid = ".1.3.6.1.4.1.35450"
|
const oid = ".1.3.6.1.4.1.35450"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/internal/globpath"
|
"github.com/influxdata/telegraf/internal/globpath"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
// Parsers
|
// Parsers
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/logparser/grok"
|
"github.com/influxdata/telegraf/plugins/inputs/logparser/grok"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lustre proc files can change between versions, so we want to future-proof
|
// Lustre proc files can change between versions, so we want to future-proof
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MailChimp struct {
|
type MailChimp struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Memcached is a memcached plugin
|
// Memcached is a memcached plugin
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
jsonparser "github.com/influxdata/telegraf/plugins/parsers/json"
|
jsonparser "github.com/influxdata/telegraf/plugins/parsers/json"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Role string
|
type Role string
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"gopkg.in/mgo.v2"
|
"gopkg.in/mgo.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/eclipse/paho.mqtt.golang"
|
"github.com/eclipse/paho.mqtt.golang"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/go-sql-driver/mysql"
|
"github.com/go-sql-driver/mysql"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/nats-io/nats"
|
"github.com/nats-io/nats"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NetResponses struct
|
// NetResponses struct
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Nginx struct {
|
type Nginx struct {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Might add Lookupd endpoints for cluster discovery
|
// Might add Lookupd endpoints for cluster discovery
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/nsqio/go-nsq"
|
"github.com/nsqio/go-nsq"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mapping of ntpq header names to tag keys
|
// Mapping of ntpq header names to tag keys
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"golang.org/x/net/html/charset"
|
"golang.org/x/net/html/charset"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HostPinger is a function that runs the "ping" function using a list of
|
// HostPinger is a function that runs the "ping" function using a list of
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Postgresql struct {
|
type Postgresql struct {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/postgresql"
|
"github.com/influxdata/telegraf/plugins/inputs/postgresql"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Postgresql struct {
|
type Postgresql struct {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Powerdns struct {
|
type Powerdns struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Procstat struct {
|
type Procstat struct {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PuppetAgent is a PuppetAgent plugin
|
// PuppetAgent is a PuppetAgent plugin
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultUsername will set a default value that corrasponds to the default
|
// DefaultUsername will set a default value that corrasponds to the default
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Raindrops struct {
|
type Raindrops struct {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/errchan"
|
"github.com/influxdata/telegraf/internal/errchan"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Redis struct {
|
type Redis struct {
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package inputs
|
|
||||||
|
|
||||||
import "github.com/influxdata/telegraf"
|
|
||||||
|
|
||||||
type Creator func() telegraf.Input
|
|
||||||
|
|
||||||
var Inputs = map[string]Creator{}
|
|
||||||
|
|
||||||
func Add(name string, creator Creator) {
|
|
||||||
Inputs[name] = creator
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"gopkg.in/dancannon/gorethink.v1"
|
"gopkg.in/dancannon/gorethink.v1"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Type Riak gathers statistics from one or more Riak instances
|
// Type Riak gathers statistics from one or more Riak instances
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/soniah/gosnmp"
|
"github.com/soniah/gosnmp"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/soniah/gosnmp"
|
"github.com/soniah/gosnmp"
|
||||||
)
|
)
|
||||||
|
|||||||
112
plugins/inputs/socket_listener/README.md
Normal file
112
plugins/inputs/socket_listener/README.md
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
# socket listener service input plugin
|
||||||
|
|
||||||
|
The Socket Listener is a service input plugin that listens for messages from
|
||||||
|
streaming (tcp, unix) or datagram (udp, unixgram) protocols.
|
||||||
|
|
||||||
|
The plugin expects messages in the
|
||||||
|
[Telegraf Input Data Formats](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md).
|
||||||
|
|
||||||
|
### Configuration:
|
||||||
|
|
||||||
|
This is a sample configuration for the plugin.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# Generic socket listener capable of handling multiple socket types.
|
||||||
|
[[inputs.socket_listener]]
|
||||||
|
## URL to listen on
|
||||||
|
# service_address = "tcp://:8094"
|
||||||
|
# service_address = "tcp://127.0.0.1:http"
|
||||||
|
# service_address = "tcp4://:8094"
|
||||||
|
# service_address = "tcp6://:8094"
|
||||||
|
# service_address = "tcp6://[2001:db8::1]:8094"
|
||||||
|
# service_address = "udp://:8094"
|
||||||
|
# service_address = "udp4://:8094"
|
||||||
|
# service_address = "udp6://:8094"
|
||||||
|
# service_address = "unix:///tmp/telegraf.sock"
|
||||||
|
# service_address = "unixgram:///tmp/telegraf.sock"
|
||||||
|
|
||||||
|
## Maximum number of concurrent connections.
|
||||||
|
## Only applies to stream sockets (e.g. TCP).
|
||||||
|
## 0 (default) is unlimited.
|
||||||
|
# max_connections = 1024
|
||||||
|
|
||||||
|
## Maximum socket buffer size in bytes.
|
||||||
|
## For stream sockets, once the buffer fills up, the sender will start backing up.
|
||||||
|
## For datagram sockets, once the buffer fills up, metrics will start dropping.
|
||||||
|
## Defaults to the OS default.
|
||||||
|
# read_buffer_size = 65535
|
||||||
|
|
||||||
|
## Data format to consume.
|
||||||
|
## Each data format has it's own unique set of configuration options, read
|
||||||
|
## more about them here:
|
||||||
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
||||||
|
# data_format = "influx"
|
||||||
|
```
|
||||||
|
|
||||||
|
## A Note on UDP OS Buffer Sizes
|
||||||
|
|
||||||
|
The `read_buffer_size` config option can be used to adjust the size of the socket
|
||||||
|
buffer, but this number is limited by OS settings. On Linux, `read_buffer_size`
|
||||||
|
will default to `rmem_default` and will be capped by `rmem_max`. On BSD systems,
|
||||||
|
`read_buffer_size` is capped by `maxsockbuf`, and there is no OS default
|
||||||
|
setting.
|
||||||
|
|
||||||
|
Instructions on how to adjust these OS settings are available below.
|
||||||
|
|
||||||
|
Some OSes (most notably, Linux) place very restricive limits on the performance
|
||||||
|
of UDP protocols. It is _highly_ recommended that you increase these OS limits to
|
||||||
|
at least 8MB before trying to run large amounts of UDP traffic to your instance.
|
||||||
|
8MB is just a recommendation, and can be adjusted higher.
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
Check the current UDP/IP receive buffer limit & default by typing the following
|
||||||
|
commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
sysctl net.core.rmem_max
|
||||||
|
sysctl net.core.rmem_default
|
||||||
|
```
|
||||||
|
|
||||||
|
If the values are less than 8388608 bytes you should add the following lines to
|
||||||
|
the /etc/sysctl.conf file:
|
||||||
|
|
||||||
|
```
|
||||||
|
net.core.rmem_max=8388608
|
||||||
|
net.core.rmem_default=8388608
|
||||||
|
```
|
||||||
|
|
||||||
|
Changes to /etc/sysctl.conf do not take effect until reboot.
|
||||||
|
To update the values immediately, type the following commands as root:
|
||||||
|
|
||||||
|
```
|
||||||
|
sysctl -w net.core.rmem_max=8388608
|
||||||
|
sysctl -w net.core.rmem_default=8388608
|
||||||
|
```
|
||||||
|
|
||||||
|
### BSD/Darwin
|
||||||
|
|
||||||
|
On BSD/Darwin systems you need to add about a 15% padding to the kernel limit
|
||||||
|
socket buffer. Meaning if you want an 8MB buffer (8388608 bytes) you need to set
|
||||||
|
the kernel limit to `8388608*1.15 = 9646900`. This is not documented anywhere but
|
||||||
|
happens
|
||||||
|
[in the kernel here.](https://github.com/freebsd/freebsd/blob/master/sys/kern/uipc_sockbuf.c#L63-L64)
|
||||||
|
|
||||||
|
Check the current UDP/IP buffer limit by typing the following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
sysctl kern.ipc.maxsockbuf
|
||||||
|
```
|
||||||
|
|
||||||
|
If the value is less than 9646900 bytes you should add the following lines
|
||||||
|
to the /etc/sysctl.conf file (create it if necessary):
|
||||||
|
|
||||||
|
```
|
||||||
|
kern.ipc.maxsockbuf=9646900
|
||||||
|
```
|
||||||
|
|
||||||
|
Changes to /etc/sysctl.conf do not take effect until reboot.
|
||||||
|
To update the values immediately, type the following command as root:
|
||||||
|
|
||||||
|
```
|
||||||
|
sysctl -w kern.ipc.maxsockbuf=9646900
|
||||||
|
```
|
||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setReadBufferer interface {
|
type setReadBufferer interface {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package sqlserver
|
|||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/influxdata/telegraf/plugins/parsers/graphite"
|
"github.com/influxdata/telegraf/plugins/parsers/graphite"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/shirou/gopsutil/cpu"
|
"github.com/shirou/gopsutil/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiskStats struct {
|
type DiskStats struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// /proc/stat file line prefixes to gather stats on:
|
// /proc/stat file line prefixes to gather stats on:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package system
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Kernel struct {
|
type Kernel struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type KernelVmstat struct {
|
type KernelVmstat struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MemStats struct {
|
type MemStats struct {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetIOStats struct {
|
type NetIOStats struct {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetStats struct {
|
type NetStats struct {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Processes struct {
|
type Processes struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/shirou/gopsutil/load"
|
"github.com/shirou/gopsutil/load"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SystemStats struct{}
|
type SystemStats struct{}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal/globpath"
|
"github.com/influxdata/telegraf/internal/globpath"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tail struct {
|
type Tail struct {
|
||||||
|
|||||||
@@ -1,30 +1,4 @@
|
|||||||
# TCP listener service input plugin
|
# TCP listener service input plugin
|
||||||
|
|
||||||
The TCP listener is a service input plugin that listens for messages on a TCP
|
> DEPRECATED: As of version 1.3 the TCP listener plugin has been deprecated in favor of the
|
||||||
socket and adds those messages to InfluxDB.
|
> [socket_listener plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener)
|
||||||
The plugin expects messages in the
|
|
||||||
[Telegraf Input Data Formats](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md).
|
|
||||||
|
|
||||||
### Configuration:
|
|
||||||
|
|
||||||
This is a sample configuration for the plugin.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# Generic TCP listener
|
|
||||||
[[inputs.tcp_listener]]
|
|
||||||
## Address and port to host TCP listener on
|
|
||||||
service_address = ":8094"
|
|
||||||
|
|
||||||
## Number of TCP messages allowed to queue up. Once filled, the
|
|
||||||
## TCP listener will start dropping packets.
|
|
||||||
allowed_pending_messages = 10000
|
|
||||||
|
|
||||||
## Maximum number of concurrent TCP connections to allow
|
|
||||||
max_tcp_connections = 250
|
|
||||||
|
|
||||||
## Data format to consume.
|
|
||||||
## Each data format has it's own unique set of configuration options, read
|
|
||||||
## more about them here:
|
|
||||||
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
||||||
data_format = "influx"
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/influxdata/telegraf/selfstat"
|
"github.com/influxdata/telegraf/selfstat"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -58,21 +58,9 @@ var malformedwarn = "E! tcp_listener has received %d malformed packets" +
|
|||||||
" thus far."
|
" thus far."
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
## Address and port to host TCP listener on
|
# DEPRECATED: the TCP listener plugin has been deprecated in favor of the
|
||||||
# service_address = ":8094"
|
# socket_listener plugin
|
||||||
|
# see https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener
|
||||||
## Number of TCP messages allowed to queue up. Once filled, the
|
|
||||||
## TCP listener will start dropping packets.
|
|
||||||
# allowed_pending_messages = 10000
|
|
||||||
|
|
||||||
## Maximum number of concurrent TCP connections to allow
|
|
||||||
# max_tcp_connections = 250
|
|
||||||
|
|
||||||
## Data format to consume.
|
|
||||||
## Each data format has it's own unique set of configuration options, read
|
|
||||||
## more about them here:
|
|
||||||
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
||||||
data_format = "influx"
|
|
||||||
`
|
`
|
||||||
|
|
||||||
func (t *TcpListener) SampleConfig() string {
|
func (t *TcpListener) SampleConfig() string {
|
||||||
@@ -98,6 +86,10 @@ func (t *TcpListener) Start(acc telegraf.Accumulator) error {
|
|||||||
t.Lock()
|
t.Lock()
|
||||||
defer t.Unlock()
|
defer t.Unlock()
|
||||||
|
|
||||||
|
log.Println("W! DEPRECATED: the TCP listener plugin has been deprecated " +
|
||||||
|
"in favor of the socket_listener plugin " +
|
||||||
|
"(https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener)")
|
||||||
|
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"address": t.ServiceAddress,
|
"address": t.ServiceAddress,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Trig struct {
|
type Trig struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Twemproxy struct {
|
type Twemproxy struct {
|
||||||
|
|||||||
@@ -1,86 +1,4 @@
|
|||||||
# UDP listener service input plugin
|
# UDP listener service input plugin
|
||||||
|
|
||||||
The UDP listener is a service input plugin that listens for messages on a UDP
|
> DEPRECATED: As of version 1.3 the UDP listener plugin has been deprecated in favor of the
|
||||||
socket and adds those messages to InfluxDB.
|
> [socket_listener plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener)
|
||||||
The plugin expects messages in the
|
|
||||||
[Telegraf Input Data Formats](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md).
|
|
||||||
|
|
||||||
### Configuration:
|
|
||||||
|
|
||||||
This is a sample configuration for the plugin.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[[inputs.udp_listener]]
|
|
||||||
## Address and port to host UDP listener on
|
|
||||||
service_address = ":8092"
|
|
||||||
|
|
||||||
## Number of UDP messages allowed to queue up. Once filled, the
|
|
||||||
## UDP listener will start dropping packets.
|
|
||||||
allowed_pending_messages = 10000
|
|
||||||
|
|
||||||
## Data format to consume.
|
|
||||||
## Each data format has it's own unique set of configuration options, read
|
|
||||||
## more about them here:
|
|
||||||
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
||||||
data_format = "influx"
|
|
||||||
```
|
|
||||||
|
|
||||||
## A Note on UDP OS Buffer Sizes
|
|
||||||
|
|
||||||
Some OSes (most notably, Linux) place very restricive limits on the performance
|
|
||||||
of UDP protocols. It is _highly_ recommended that you increase these OS limits to
|
|
||||||
at least 8MB before trying to run large amounts of UDP traffic to your instance.
|
|
||||||
8MB is just a recommendation, and can be adjusted higher.
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
Check the current UDP/IP receive buffer limit & default by typing the following
|
|
||||||
commands:
|
|
||||||
|
|
||||||
```
|
|
||||||
sysctl net.core.rmem_max
|
|
||||||
sysctl net.core.rmem_default
|
|
||||||
```
|
|
||||||
|
|
||||||
If the values are less than 8388608 bytes you should add the following lines to
|
|
||||||
the /etc/sysctl.conf file:
|
|
||||||
|
|
||||||
```
|
|
||||||
net.core.rmem_max=8388608
|
|
||||||
net.core.rmem_default=8388608
|
|
||||||
```
|
|
||||||
|
|
||||||
Changes to /etc/sysctl.conf do not take effect until reboot.
|
|
||||||
To update the values immediately, type the following commands as root:
|
|
||||||
|
|
||||||
```
|
|
||||||
sysctl -w net.core.rmem_max=8388608
|
|
||||||
sysctl -w net.core.rmem_default=8388608
|
|
||||||
```
|
|
||||||
|
|
||||||
### BSD/Darwin
|
|
||||||
|
|
||||||
On BSD/Darwin systems you need to add about a 15% padding to the kernel limit
|
|
||||||
socket buffer. Meaning if you want an 8MB buffer (8388608 bytes) you need to set
|
|
||||||
the kernel limit to `8388608*1.15 = 9646900`. This is not documented anywhere but
|
|
||||||
happens
|
|
||||||
[in the kernel here.](https://github.com/freebsd/freebsd/blob/master/sys/kern/uipc_sockbuf.c#L63-L64)
|
|
||||||
|
|
||||||
Check the current UDP/IP buffer limit by typing the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
sysctl kern.ipc.maxsockbuf
|
|
||||||
```
|
|
||||||
|
|
||||||
If the value is less than 9646900 bytes you should add the following lines
|
|
||||||
to the /etc/sysctl.conf file (create it if necessary):
|
|
||||||
|
|
||||||
```
|
|
||||||
kern.ipc.maxsockbuf=9646900
|
|
||||||
```
|
|
||||||
|
|
||||||
Changes to /etc/sysctl.conf do not take effect until reboot.
|
|
||||||
To update the values immediately, type the following commands as root:
|
|
||||||
|
|
||||||
```
|
|
||||||
sysctl -w kern.ipc.maxsockbuf=9646900
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
|
||||||
"github.com/influxdata/telegraf/plugins/parsers"
|
"github.com/influxdata/telegraf/plugins/parsers"
|
||||||
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
"github.com/influxdata/telegraf/selfstat"
|
"github.com/influxdata/telegraf/selfstat"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -66,22 +66,9 @@ var malformedwarn = "E! udp_listener has received %d malformed packets" +
|
|||||||
" thus far."
|
" thus far."
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
## Address and port to host UDP listener on
|
# DEPRECATED: the TCP listener plugin has been deprecated in favor of the
|
||||||
# service_address = ":8092"
|
# socket_listener plugin
|
||||||
|
# see https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener
|
||||||
## Number of UDP messages allowed to queue up. Once filled, the
|
|
||||||
## UDP listener will start dropping packets.
|
|
||||||
# allowed_pending_messages = 10000
|
|
||||||
|
|
||||||
## Set the buffer size of the UDP connection outside of OS default (in bytes)
|
|
||||||
## If set to 0, take OS default
|
|
||||||
udp_buffer_size = 16777216
|
|
||||||
|
|
||||||
## Data format to consume.
|
|
||||||
## Each data format has it's own unique set of configuration options, read
|
|
||||||
## more about them here:
|
|
||||||
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
||||||
data_format = "influx"
|
|
||||||
`
|
`
|
||||||
|
|
||||||
func (u *UdpListener) SampleConfig() string {
|
func (u *UdpListener) SampleConfig() string {
|
||||||
@@ -106,6 +93,10 @@ func (u *UdpListener) Start(acc telegraf.Accumulator) error {
|
|||||||
u.Lock()
|
u.Lock()
|
||||||
defer u.Unlock()
|
defer u.Unlock()
|
||||||
|
|
||||||
|
log.Println("W! DEPRECATED: the UDP listener plugin has been deprecated " +
|
||||||
|
"in favor of the socket_listener plugin " +
|
||||||
|
"(https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener)")
|
||||||
|
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"address": u.ServiceAddress,
|
"address": u.ServiceAddress,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/filter"
|
"github.com/influxdata/telegraf/filter"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type runner func(cmdName string) (*bytes.Buffer, error)
|
type runner func(cmdName string) (*bytes.Buffer, error)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/webhooks/filestack"
|
"github.com/influxdata/telegraf/plugins/inputs/webhooks/filestack"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/webhooks/github"
|
"github.com/influxdata/telegraf/plugins/inputs/webhooks/github"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/registry/inputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sampleConfig string = `
|
var sampleConfig string = `
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user