From 16533304210013d501d77150a17f168a933c975d Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Fri, 22 May 2015 16:45:14 -0700 Subject: [PATCH] Tivan is dead, long live Telegraf. Fixes #3 --- PLUGINS.md | 10 +++++----- README.md | 18 +++++++++--------- accumulator.go | 2 +- agent.go | 4 ++-- agent_test.go | 2 +- cmd/{tivan/tivan.go => telegraf/telegraf.go} | 16 ++++++++-------- config.go | 20 ++++++++++---------- plugins/all/all.go | 8 ++++---- plugins/mysql/mysql.go | 2 +- plugins/mysql/mysql_test.go | 2 +- plugins/postgresql/postgresql.go | 2 +- plugins/postgresql/postgresql_test.go | 2 +- plugins/redis/redis.go | 2 +- plugins/redis/redis_test.go | 2 +- plugins/system/cpu.go | 2 +- plugins/system/disk.go | 2 +- plugins/system/docker.go | 2 +- plugins/system/memory.go | 2 +- plugins/system/mock_PS.go | 10 +++++----- plugins/system/net.go | 4 ++-- plugins/system/ps.go | 16 ++++++++-------- plugins/system/ps/cpu/cpu_darwin.go | 2 +- plugins/system/ps/cpu/cpu_freebsd.go | 2 +- plugins/system/ps/cpu/cpu_linux.go | 2 +- plugins/system/ps/cpu/cpu_windows.go | 2 +- plugins/system/ps/disk/disk_darwin.go | 2 +- plugins/system/ps/disk/disk_freebsd.go | 2 +- plugins/system/ps/disk/disk_linux.go | 2 +- plugins/system/ps/disk/disk_test.go | 2 +- plugins/system/ps/disk/disk_windows.go | 2 +- plugins/system/ps/docker/docker_linux.go | 4 ++-- plugins/system/ps/docker/docker_notlinux.go | 4 ++-- plugins/system/ps/host/host_darwin.go | 2 +- plugins/system/ps/host/host_freebsd.go | 2 +- plugins/system/ps/host/host_linux.go | 2 +- plugins/system/ps/host/host_windows.go | 4 ++-- plugins/system/ps/load/load_darwin.go | 2 +- plugins/system/ps/load/load_freebsd.go | 2 +- plugins/system/ps/load/load_windows.go | 2 +- plugins/system/ps/mem/mem_darwin.go | 2 +- plugins/system/ps/mem/mem_freebsd.go | 2 +- plugins/system/ps/mem/mem_linux.go | 2 +- plugins/system/ps/mem/mem_windows.go | 2 +- plugins/system/ps/net/net_darwin.go | 2 +- plugins/system/ps/net/net_freebsd.go | 2 +- plugins/system/ps/net/net_linux.go | 2 +- plugins/system/ps/net/net_windows.go | 2 +- plugins/system/ps/process/process.go | 2 +- plugins/system/ps/process/process_darwin.go | 6 +++--- plugins/system/ps/process/process_freebsd.go | 6 +++--- plugins/system/ps/process/process_linux.go | 8 ++++---- plugins/system/ps/process/process_test.go | 2 +- plugins/system/ps/process/process_windows.go | 6 +++--- plugins/system/system.go | 2 +- plugins/system/system_test.go | 14 +++++++------- release.sh | 6 +++--- tivan.toml => telegraf.toml | 18 +++++++++--------- testdata/influx.toml | 2 +- 58 files changed, 130 insertions(+), 130 deletions(-) rename cmd/{tivan/tivan.go => telegraf/telegraf.go} (83%) rename tivan.toml => telegraf.toml (88%) diff --git a/PLUGINS.md b/PLUGINS.md index c4436b0c14190..b5d26ce6c2318 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -1,4 +1,4 @@ -Tivan is entirely plugin driven. This interface allows for operators to +Telegraf is entirely plugin driven. This interface allows for operators to pick and chose what is gathered as well as makes it easy for developers to create new ways of generating metrics. @@ -8,14 +8,14 @@ and submit new plugins. ## Guidelines * A plugin must conform to the `plugins.Plugin` interface. -* Tivan promises to run each plugin's Gather function serially. This means +* Telegraf promises to run each plugin's Gather function serially. This means developers don't have to worry about thread safety within these functions. * Each generated metric automatically has the name of the plugin that generated it prepended. This is to keep plugins honest. * Plugins should call `plugins.Add` in their `init` function to register themselves. See below for a quick example. -* To be available within Tivan itself, plugins must add themselves to the `github.com/influxdb/tivan/plugins/all/all.go` file. -* The `SampleConfig` function should return valid toml that describes how the plugin can be configured. This is include in `tivan -sample-config`. +* To be available within Telegraf itself, plugins must add themselves to the `github.com/influxdb/telegraf/plugins/all/all.go` file. +* The `SampleConfig` function should return valid toml that describes how the plugin can be configured. This is include in `telegraf -sample-config`. * The `Description` function should say in one line what this plugin does. ### Plugin interface @@ -75,7 +75,7 @@ func Gather(acc plugins.Accumulator) error { // simple.go -import "github.com/influxdb/tivan/plugins" +import "github.com/influxdb/telegraf/plugins" type Simple struct { Ok bool diff --git a/README.md b/README.md index f664f90166906..ab8180729ead1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# Tivan - A native agent for InfluxDB +# Telegraf - A native agent for InfluxDB ## Quickstart -* Build from source or download tivan (binaries forthcoming) -* Run `tivan -sample-config > tivan.toml` to create an initial configuration +* Build from source or download telegraf (binaries forthcoming) +* Run `telegraf -sample-config > telegraf.toml` to create an initial configuration * Edit the configuration to match your needs -* Run `tivan -config tivan.toml -test` to output one full measurement sample to STDOUT -* Run `tivan -config tivan.toml` to gather and send metrics to InfluxDB +* Run `telegraf -config telegraf.toml -test` to output one full measurement sample to STDOUT +* Run `telegraf -config telegraf.toml` to gather and send metrics to InfluxDB -## Tivan Options +## Telegraf Options -Tivan has a few options you can configure under the `agent` section of the config. If you don't see an `agent` section run `tivan -sample-config > tivan.toml` to create a valid initial configuration: +Telegraf has a few options you can configure under the `agent` section of the config. If you don't see an `agent` section run `telegraf -sample-config > telegraf.toml` to create a valid initial configuration: -* **hostname**: The hostname is passed as a tag. By default this should be set to the name of the machine running Tivan. You can override that behavior here. +* **hostname**: The hostname is passed as a tag. By default this should be set to the name of the machine running Telegraf. You can override that behavior here. * **interval**: How ofter to gather metrics. Uses a simple number + unit parser, ie "10s" for 10 seconds or "5m" for 5 minutes. -* **debug**: currently non-functional. Run `tivan -config tivan.toml -debug` to gather and send metrics to InfluxDB and to STDOUT for debugging purposes +* **debug**: currently non-functional. Run `telegraf -config telegraf.toml -debug` to gather and send metrics to InfluxDB and to STDOUT for debugging purposes ## Plugin Options diff --git a/accumulator.go b/accumulator.go index ebe227e46d4be..8893642e0878d 100644 --- a/accumulator.go +++ b/accumulator.go @@ -1,4 +1,4 @@ -package tivan +package telegraf import ( "fmt" diff --git a/agent.go b/agent.go index 3ba6b69c87f35..7ac924f632eb7 100644 --- a/agent.go +++ b/agent.go @@ -1,4 +1,4 @@ -package tivan +package telegraf import ( "fmt" @@ -10,7 +10,7 @@ import ( "time" "github.com/influxdb/influxdb/client" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type runningPlugin struct { diff --git a/agent_test.go b/agent_test.go index 6103b4eb8a470..8811fa810c5b4 100644 --- a/agent_test.go +++ b/agent_test.go @@ -1,4 +1,4 @@ -package tivan +package telegraf /* func TestAgent_DrivesMetrics(t *testing.T) { diff --git a/cmd/tivan/tivan.go b/cmd/telegraf/telegraf.go similarity index 83% rename from cmd/tivan/tivan.go rename to cmd/telegraf/telegraf.go index d77021bad0d10..aa6a951383982 100644 --- a/cmd/tivan/tivan.go +++ b/cmd/telegraf/telegraf.go @@ -8,8 +8,8 @@ import ( "os/signal" "strings" - "github.com/influxdb/tivan" - _ "github.com/influxdb/tivan/plugins/all" + "github.com/influxdb/telegraf" + _ "github.com/influxdb/telegraf/plugins/all" ) var fDebug = flag.Bool("debug", false, "show metrics as they're generated to stdout") @@ -24,30 +24,30 @@ func main() { flag.Parse() if *fVersion { - fmt.Printf("InfluxDB Tivan agent - Version %s\n", Version) + fmt.Printf("InfluxDB Telegraf agent - Version %s\n", Version) return } if *fSampleConfig { - tivan.PrintSampleConfig() + telegraf.PrintSampleConfig() return } var ( - config *tivan.Config + config *telegraf.Config err error ) if *fConfig != "" { - config, err = tivan.LoadConfig(*fConfig) + config, err = telegraf.LoadConfig(*fConfig) if err != nil { log.Fatal(err) } } else { - config = tivan.DefaultConfig() + config = telegraf.DefaultConfig() } - ag, err := tivan.NewAgent(config) + ag, err := telegraf.NewAgent(config) if err != nil { log.Fatal(err) } diff --git a/config.go b/config.go index 6deb2ee53a35a..f3c75750f049c 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package tivan +package telegraf import ( "errors" @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" "github.com/naoina/toml" "github.com/naoina/toml/ast" ) @@ -211,12 +211,12 @@ type hasDescr interface { Description() string } -var header = `# Tivan configuration +var header = `# Telegraf configuration # If this file is missing an [agent] section, you must first generate a -# valid config with 'tivan -sample-config > tivan.toml' +# valid config with 'telegraf -sample-config > telegraf.toml' -# Tivan is entirely plugin driven. All metrics are gathered from the +# Telegraf is entirely plugin driven. All metrics are gathered from the # declared plugins. # Even if a plugin has no configuration, it must be declared in here @@ -224,7 +224,7 @@ var header = `# Tivan configuration # as a section with no variables. To deactivate a plugin, comment # out the name and any variables. -# Use 'tivan -config tivan.toml -test' to see what metrics a config +# Use 'telegraf -config telegraf.toml -test' to see what metrics a config # file would generate. # One rule that plugins conform to is wherever a connection string @@ -241,13 +241,13 @@ var header = `# Tivan configuration url = "http://10.20.2.4:8086" # required. # The target database for metrics. This database must already exist -database = "tivan" # required. +database = "telegraf" # required. -# username = "tivan" +# username = "telegraf" # password = "metricsmetricsmetricsmetrics" # Set the user agent for the POSTs (can be useful for log differentiation) -# user_agent = "tivan" +# user_agent = "telegraf" # tags = { "dc": "us-east-1" } # Tags can also be specified via a normal map, but only one form at a time: @@ -255,7 +255,7 @@ database = "tivan" # required. # [influxdb.tags] # dc = "us-east-1" -# Configuration for tivan itself +# Configuration for telegraf itself # [agent] # interval = "10s" # debug = false diff --git a/plugins/all/all.go b/plugins/all/all.go index 9cf3cd191e71a..8acedb33f0ffa 100644 --- a/plugins/all/all.go +++ b/plugins/all/all.go @@ -1,8 +1,8 @@ package all import ( - _ "github.com/influxdb/tivan/plugins/mysql" - _ "github.com/influxdb/tivan/plugins/postgresql" - _ "github.com/influxdb/tivan/plugins/redis" - _ "github.com/influxdb/tivan/plugins/system" + _ "github.com/influxdb/telegraf/plugins/mysql" + _ "github.com/influxdb/telegraf/plugins/postgresql" + _ "github.com/influxdb/telegraf/plugins/redis" + _ "github.com/influxdb/telegraf/plugins/system" ) diff --git a/plugins/mysql/mysql.go b/plugins/mysql/mysql.go index 95c53909f1c28..15b1af8c93a25 100644 --- a/plugins/mysql/mysql.go +++ b/plugins/mysql/mysql.go @@ -6,7 +6,7 @@ import ( "strings" _ "github.com/go-sql-driver/mysql" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type Mysql struct { diff --git a/plugins/mysql/mysql_test.go b/plugins/mysql/mysql_test.go index cbfe733536b74..0e9e94a2315c9 100644 --- a/plugins/mysql/mysql_test.go +++ b/plugins/mysql/mysql_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/influxdb/tivan/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/postgresql/postgresql.go b/plugins/postgresql/postgresql.go index 0df8bae478758..812d397504d7b 100644 --- a/plugins/postgresql/postgresql.go +++ b/plugins/postgresql/postgresql.go @@ -3,7 +3,7 @@ package postgresql import ( "database/sql" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" _ "github.com/lib/pq" ) diff --git a/plugins/postgresql/postgresql_test.go b/plugins/postgresql/postgresql_test.go index b9afe05c9279a..b11200e9f59be 100644 --- a/plugins/postgresql/postgresql_test.go +++ b/plugins/postgresql/postgresql_test.go @@ -3,7 +3,7 @@ package postgresql import ( "testing" - "github.com/influxdb/tivan/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/redis/redis.go b/plugins/redis/redis.go index fe53c72c1fee9..2b56ac8c3e2c3 100644 --- a/plugins/redis/redis.go +++ b/plugins/redis/redis.go @@ -9,7 +9,7 @@ import ( "strings" "sync" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type Redis struct { diff --git a/plugins/redis/redis_test.go b/plugins/redis/redis_test.go index c8492d362bf98..cab691d35f932 100644 --- a/plugins/redis/redis_test.go +++ b/plugins/redis/redis_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/influxdb/tivan/testutil" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/plugins/system/cpu.go b/plugins/system/cpu.go index 41b16b53488e9..e942ccb5e1f1f 100644 --- a/plugins/system/cpu.go +++ b/plugins/system/cpu.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type CPUStats struct { diff --git a/plugins/system/disk.go b/plugins/system/disk.go index b19f226e0293a..cd547596248e8 100644 --- a/plugins/system/disk.go +++ b/plugins/system/disk.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type DiskStats struct { diff --git a/plugins/system/docker.go b/plugins/system/docker.go index c939b5f516ac2..9eab7cf5250b3 100644 --- a/plugins/system/docker.go +++ b/plugins/system/docker.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type DockerStats struct { diff --git a/plugins/system/memory.go b/plugins/system/memory.go index 890edd107348b..c835dc76d23c7 100644 --- a/plugins/system/memory.go +++ b/plugins/system/memory.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type MemStats struct { diff --git a/plugins/system/mock_PS.go b/plugins/system/mock_PS.go index 4731c6d500610..17a4fc95059ca 100644 --- a/plugins/system/mock_PS.go +++ b/plugins/system/mock_PS.go @@ -2,12 +2,12 @@ package system import "github.com/stretchr/testify/mock" -import "github.com/influxdb/tivan/plugins/system/ps/cpu" -import "github.com/influxdb/tivan/plugins/system/ps/disk" +import "github.com/influxdb/telegraf/plugins/system/ps/cpu" +import "github.com/influxdb/telegraf/plugins/system/ps/disk" -import "github.com/influxdb/tivan/plugins/system/ps/load" -import "github.com/influxdb/tivan/plugins/system/ps/mem" -import "github.com/influxdb/tivan/plugins/system/ps/net" +import "github.com/influxdb/telegraf/plugins/system/ps/load" +import "github.com/influxdb/telegraf/plugins/system/ps/mem" +import "github.com/influxdb/telegraf/plugins/system/ps/net" type MockPS struct { mock.Mock diff --git a/plugins/system/net.go b/plugins/system/net.go index b7dc3637a84e0..ec419d9ee1c31 100644 --- a/plugins/system/net.go +++ b/plugins/system/net.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/influxdb/tivan/plugins" + "github.com/influxdb/telegraf/plugins" ) type NetIOStats struct { @@ -18,7 +18,7 @@ func (_ *NetIOStats) Description() string { } var netSampleConfig = ` -# By default, tivan gathers stats from any up interface (excluding loopback) +# By default, telegraf gathers stats from any up interface (excluding loopback) # Setting interfaces will tell it to gather these explicit interfaces, # regardless of status. # diff --git a/plugins/system/ps.go b/plugins/system/ps.go index 0cbb1c9c6fe66..f4e445dd2d2c3 100644 --- a/plugins/system/ps.go +++ b/plugins/system/ps.go @@ -5,14 +5,14 @@ import ( "strings" dc "github.com/fsouza/go-dockerclient" - "github.com/influxdb/tivan/plugins" - "github.com/influxdb/tivan/plugins/system/ps/common" - "github.com/influxdb/tivan/plugins/system/ps/cpu" - "github.com/influxdb/tivan/plugins/system/ps/disk" - "github.com/influxdb/tivan/plugins/system/ps/docker" - "github.com/influxdb/tivan/plugins/system/ps/load" - "github.com/influxdb/tivan/plugins/system/ps/mem" - "github.com/influxdb/tivan/plugins/system/ps/net" + "github.com/influxdb/telegraf/plugins" + "github.com/influxdb/telegraf/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/cpu" + "github.com/influxdb/telegraf/plugins/system/ps/disk" + "github.com/influxdb/telegraf/plugins/system/ps/docker" + "github.com/influxdb/telegraf/plugins/system/ps/load" + "github.com/influxdb/telegraf/plugins/system/ps/mem" + "github.com/influxdb/telegraf/plugins/system/ps/net" ) type DockerContainerStat struct { diff --git a/plugins/system/ps/cpu/cpu_darwin.go b/plugins/system/ps/cpu/cpu_darwin.go index 01edb83f111bb..c5c0ddc02e781 100644 --- a/plugins/system/ps/cpu/cpu_darwin.go +++ b/plugins/system/ps/cpu/cpu_darwin.go @@ -24,7 +24,7 @@ import ( "strings" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) // sys/resource.h diff --git a/plugins/system/ps/cpu/cpu_freebsd.go b/plugins/system/ps/cpu/cpu_freebsd.go index 11c22a2f41f7f..a7798c556db1f 100644 --- a/plugins/system/ps/cpu/cpu_freebsd.go +++ b/plugins/system/ps/cpu/cpu_freebsd.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) // sys/resource.h diff --git a/plugins/system/ps/cpu/cpu_linux.go b/plugins/system/ps/cpu/cpu_linux.go index 2c9ff007ecf9c..c68bfd868f4db 100644 --- a/plugins/system/ps/cpu/cpu_linux.go +++ b/plugins/system/ps/cpu/cpu_linux.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func CPUTimes(percpu bool) ([]CPUTimesStat, error) { diff --git a/plugins/system/ps/cpu/cpu_windows.go b/plugins/system/ps/cpu/cpu_windows.go index f9df31e1ab8e7..071d366c9d282 100644 --- a/plugins/system/ps/cpu/cpu_windows.go +++ b/plugins/system/ps/cpu/cpu_windows.go @@ -8,7 +8,7 @@ import ( "time" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) // TODO: Get percpu diff --git a/plugins/system/ps/disk/disk_darwin.go b/plugins/system/ps/disk/disk_darwin.go index f9ebc2a27bb27..cbd94bdab0587 100644 --- a/plugins/system/ps/disk/disk_darwin.go +++ b/plugins/system/ps/disk/disk_darwin.go @@ -6,7 +6,7 @@ import ( "syscall" "unsafe" - "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func DiskPartitions(all bool) ([]DiskPartitionStat, error) { diff --git a/plugins/system/ps/disk/disk_freebsd.go b/plugins/system/ps/disk/disk_freebsd.go index 910ca7ae07593..5193f35688e07 100644 --- a/plugins/system/ps/disk/disk_freebsd.go +++ b/plugins/system/ps/disk/disk_freebsd.go @@ -9,7 +9,7 @@ import ( "syscall" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) const ( diff --git a/plugins/system/ps/disk/disk_linux.go b/plugins/system/ps/disk/disk_linux.go index 37b97fc4f70c2..d70685257d6d0 100644 --- a/plugins/system/ps/disk/disk_linux.go +++ b/plugins/system/ps/disk/disk_linux.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) const ( diff --git a/plugins/system/ps/disk/disk_test.go b/plugins/system/ps/disk/disk_test.go index 6ed9b891a4423..04776b1d86c12 100644 --- a/plugins/system/ps/disk/disk_test.go +++ b/plugins/system/ps/disk/disk_test.go @@ -5,7 +5,7 @@ import ( "runtime" "testing" - "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func TestDisk_usage(t *testing.T) { diff --git a/plugins/system/ps/disk/disk_windows.go b/plugins/system/ps/disk/disk_windows.go index 70d9839620732..34341accd0da3 100644 --- a/plugins/system/ps/disk/disk_windows.go +++ b/plugins/system/ps/disk/disk_windows.go @@ -9,7 +9,7 @@ import ( "time" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) var ( diff --git a/plugins/system/ps/docker/docker_linux.go b/plugins/system/ps/docker/docker_linux.go index 265ab8afc562d..51f3bc9ca908d 100644 --- a/plugins/system/ps/docker/docker_linux.go +++ b/plugins/system/ps/docker/docker_linux.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/influxdb/tivan/plugins/system/ps/common" - "github.com/influxdb/tivan/plugins/system/ps/cpu" + "github.com/influxdb/telegraf/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/cpu" ) // GetDockerIDList returnes a list of DockerID. diff --git a/plugins/system/ps/docker/docker_notlinux.go b/plugins/system/ps/docker/docker_notlinux.go index fa19d886f15b9..ec7fc3d8d536e 100644 --- a/plugins/system/ps/docker/docker_notlinux.go +++ b/plugins/system/ps/docker/docker_notlinux.go @@ -5,8 +5,8 @@ package docker import ( "encoding/json" - "github.com/influxdb/tivan/plugins/system/ps/common" - "github.com/influxdb/tivan/plugins/system/ps/cpu" + "github.com/influxdb/telegraf/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/cpu" ) // GetDockerIDList returnes a list of DockerID. diff --git a/plugins/system/ps/host/host_darwin.go b/plugins/system/ps/host/host_darwin.go index bcbb773c546bb..753e9af68996f 100644 --- a/plugins/system/ps/host/host_darwin.go +++ b/plugins/system/ps/host/host_darwin.go @@ -13,7 +13,7 @@ import ( "strings" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func HostInfo() (*HostInfoStat, error) { diff --git a/plugins/system/ps/host/host_freebsd.go b/plugins/system/ps/host/host_freebsd.go index e2ca7e781851f..6c06dc62237bf 100644 --- a/plugins/system/ps/host/host_freebsd.go +++ b/plugins/system/ps/host/host_freebsd.go @@ -13,7 +13,7 @@ import ( "strings" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) const ( diff --git a/plugins/system/ps/host/host_linux.go b/plugins/system/ps/host/host_linux.go index 9aab8204c1356..d3b12669e0ddf 100644 --- a/plugins/system/ps/host/host_linux.go +++ b/plugins/system/ps/host/host_linux.go @@ -14,7 +14,7 @@ import ( "syscall" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) type LSB struct { diff --git a/plugins/system/ps/host/host_windows.go b/plugins/system/ps/host/host_windows.go index 97f310c98a431..7881309104a75 100644 --- a/plugins/system/ps/host/host_windows.go +++ b/plugins/system/ps/host/host_windows.go @@ -8,8 +8,8 @@ import ( "strings" "time" - common "github.com/influxdb/tivan/plugins/system/ps/common" - process "github.com/influxdb/tivan/plugins/system/ps/process" + common "github.com/influxdb/telegraf/plugins/system/ps/common" + process "github.com/influxdb/telegraf/plugins/system/ps/process" ) var ( diff --git a/plugins/system/ps/load/load_darwin.go b/plugins/system/ps/load/load_darwin.go index 2de2df367f9c1..4e6931cd1eb9f 100644 --- a/plugins/system/ps/load/load_darwin.go +++ b/plugins/system/ps/load/load_darwin.go @@ -5,7 +5,7 @@ package load import ( "strconv" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func LoadAvg() (*LoadAvgStat, error) { diff --git a/plugins/system/ps/load/load_freebsd.go b/plugins/system/ps/load/load_freebsd.go index 770adca51eda2..8b1191d770e57 100644 --- a/plugins/system/ps/load/load_freebsd.go +++ b/plugins/system/ps/load/load_freebsd.go @@ -5,7 +5,7 @@ package load import ( "strconv" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func LoadAvg() (*LoadAvgStat, error) { diff --git a/plugins/system/ps/load/load_windows.go b/plugins/system/ps/load/load_windows.go index 232fbcf10201f..4406741483e73 100644 --- a/plugins/system/ps/load/load_windows.go +++ b/plugins/system/ps/load/load_windows.go @@ -3,7 +3,7 @@ package load import ( - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func LoadAvg() (*LoadAvgStat, error) { diff --git a/plugins/system/ps/mem/mem_darwin.go b/plugins/system/ps/mem/mem_darwin.go index 37160bc5a8c04..5d2ff7e3e4a85 100644 --- a/plugins/system/ps/mem/mem_darwin.go +++ b/plugins/system/ps/mem/mem_darwin.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func getPageSize() (uint64, error) { diff --git a/plugins/system/ps/mem/mem_freebsd.go b/plugins/system/ps/mem/mem_freebsd.go index 68bdb7b00eb32..aa83a246d5f43 100644 --- a/plugins/system/ps/mem/mem_freebsd.go +++ b/plugins/system/ps/mem/mem_freebsd.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func VirtualMemory() (*VirtualMemoryStat, error) { diff --git a/plugins/system/ps/mem/mem_linux.go b/plugins/system/ps/mem/mem_linux.go index ab98b8651df68..a0505b5f50cbb 100644 --- a/plugins/system/ps/mem/mem_linux.go +++ b/plugins/system/ps/mem/mem_linux.go @@ -7,7 +7,7 @@ import ( "strings" "syscall" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) func VirtualMemory() (*VirtualMemoryStat, error) { diff --git a/plugins/system/ps/mem/mem_windows.go b/plugins/system/ps/mem/mem_windows.go index d40bfd845fe47..b43c85c161077 100644 --- a/plugins/system/ps/mem/mem_windows.go +++ b/plugins/system/ps/mem/mem_windows.go @@ -6,7 +6,7 @@ import ( "syscall" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) var ( diff --git a/plugins/system/ps/net/net_darwin.go b/plugins/system/ps/net/net_darwin.go index c6a392df023bc..a9843fea3c7df 100644 --- a/plugins/system/ps/net/net_darwin.go +++ b/plugins/system/ps/net/net_darwin.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { diff --git a/plugins/system/ps/net/net_freebsd.go b/plugins/system/ps/net/net_freebsd.go index 15cc77daae024..7dbc1053d580c 100644 --- a/plugins/system/ps/net/net_freebsd.go +++ b/plugins/system/ps/net/net_freebsd.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { diff --git a/plugins/system/ps/net/net_linux.go b/plugins/system/ps/net/net_linux.go index 7535495e5d270..15a4d26de7489 100644 --- a/plugins/system/ps/net/net_linux.go +++ b/plugins/system/ps/net/net_linux.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) // NetIOCounters returnes network I/O statistics for every network diff --git a/plugins/system/ps/net/net_windows.go b/plugins/system/ps/net/net_windows.go index 57188f7e235de..3ca8421c6047b 100644 --- a/plugins/system/ps/net/net_windows.go +++ b/plugins/system/ps/net/net_windows.go @@ -8,7 +8,7 @@ import ( "syscall" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" + common "github.com/influxdb/telegraf/plugins/system/ps/common" ) var ( diff --git a/plugins/system/ps/process/process.go b/plugins/system/ps/process/process.go index 555bef7b867c6..e2374aa750f4f 100644 --- a/plugins/system/ps/process/process.go +++ b/plugins/system/ps/process/process.go @@ -5,7 +5,7 @@ import ( "runtime" "time" - cpu "github.com/influxdb/tivan/plugins/system/ps/cpu" + cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu" ) type Process struct { diff --git a/plugins/system/ps/process/process_darwin.go b/plugins/system/ps/process/process_darwin.go index 5e118c62c712c..dc98b03ac1486 100644 --- a/plugins/system/ps/process/process_darwin.go +++ b/plugins/system/ps/process/process_darwin.go @@ -10,9 +10,9 @@ import ( "syscall" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" - cpu "github.com/influxdb/tivan/plugins/system/ps/cpu" - net "github.com/influxdb/tivan/plugins/system/ps/net" + common "github.com/influxdb/telegraf/plugins/system/ps/common" + cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu" + net "github.com/influxdb/telegraf/plugins/system/ps/net" ) // copied from sys/sysctl.h diff --git a/plugins/system/ps/process/process_freebsd.go b/plugins/system/ps/process/process_freebsd.go index 8c1a1ec64b5fc..80cf16128f546 100644 --- a/plugins/system/ps/process/process_freebsd.go +++ b/plugins/system/ps/process/process_freebsd.go @@ -7,9 +7,9 @@ import ( "encoding/binary" "unsafe" - common "github.com/influxdb/tivan/plugins/system/ps/common" - cpu "github.com/influxdb/tivan/plugins/system/ps/cpu" - net "github.com/influxdb/tivan/plugins/system/ps/net" + common "github.com/influxdb/telegraf/plugins/system/ps/common" + cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu" + net "github.com/influxdb/telegraf/plugins/system/ps/net" ) // MemoryInfoExStat is different between OSes diff --git a/plugins/system/ps/process/process_linux.go b/plugins/system/ps/process/process_linux.go index 41f3f10b6e54d..558de41bb15d1 100644 --- a/plugins/system/ps/process/process_linux.go +++ b/plugins/system/ps/process/process_linux.go @@ -11,10 +11,10 @@ import ( "strings" "syscall" - common "github.com/influxdb/tivan/plugins/system/ps/common" - cpu "github.com/influxdb/tivan/plugins/system/ps/cpu" - host "github.com/influxdb/tivan/plugins/system/ps/host" - net "github.com/influxdb/tivan/plugins/system/ps/net" + common "github.com/influxdb/telegraf/plugins/system/ps/common" + cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu" + host "github.com/influxdb/telegraf/plugins/system/ps/host" + net "github.com/influxdb/telegraf/plugins/system/ps/net" ) const ( diff --git a/plugins/system/ps/process/process_test.go b/plugins/system/ps/process/process_test.go index 30bb3c8403dec..4999b6ef7e916 100644 --- a/plugins/system/ps/process/process_test.go +++ b/plugins/system/ps/process/process_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func testGetProcess() Process { diff --git a/plugins/system/ps/process/process_windows.go b/plugins/system/ps/process/process_windows.go index 831195640007a..1c6b5d74bae56 100644 --- a/plugins/system/ps/process/process_windows.go +++ b/plugins/system/ps/process/process_windows.go @@ -11,9 +11,9 @@ import ( "github.com/shirou/w32" - common "github.com/influxdb/tivan/plugins/system/ps/common" - cpu "github.com/influxdb/tivan/plugins/system/ps/cpu" - net "github.com/influxdb/tivan/plugins/system/ps/net" + common "github.com/influxdb/telegraf/plugins/system/ps/common" + cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu" + net "github.com/influxdb/telegraf/plugins/system/ps/net" ) const ( diff --git a/plugins/system/system.go b/plugins/system/system.go index 281b6dac2150f..f3c3bc7e83dda 100644 --- a/plugins/system/system.go +++ b/plugins/system/system.go @@ -1,6 +1,6 @@ package system -import "github.com/influxdb/tivan/plugins" +import "github.com/influxdb/telegraf/plugins" type SystemStats struct { ps PS diff --git a/plugins/system/system_test.go b/plugins/system/system_test.go index 7f6b605d5946f..83242020a2594 100644 --- a/plugins/system/system_test.go +++ b/plugins/system/system_test.go @@ -3,13 +3,13 @@ package system import ( "testing" - "github.com/influxdb/tivan/plugins/system/ps/cpu" - "github.com/influxdb/tivan/plugins/system/ps/disk" - "github.com/influxdb/tivan/plugins/system/ps/docker" - "github.com/influxdb/tivan/plugins/system/ps/load" - "github.com/influxdb/tivan/plugins/system/ps/mem" - "github.com/influxdb/tivan/plugins/system/ps/net" - "github.com/influxdb/tivan/testutil" + "github.com/influxdb/telegraf/plugins/system/ps/cpu" + "github.com/influxdb/telegraf/plugins/system/ps/disk" + "github.com/influxdb/telegraf/plugins/system/ps/docker" + "github.com/influxdb/telegraf/plugins/system/ps/load" + "github.com/influxdb/telegraf/plugins/system/ps/mem" + "github.com/influxdb/telegraf/plugins/system/ps/net" + "github.com/influxdb/telegraf/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/release.sh b/release.sh index c6a0474c9c6e7..6e9b4bf96a4ac 100755 --- a/release.sh +++ b/release.sh @@ -2,14 +2,14 @@ VERSION="0.9.b1" -echo "Building Tivan version $VERSION" +echo "Building Telegraf version $VERSION" mkdir -p pkg build() { echo -n "=> $1-$2: " - GOOS=$1 GOARCH=$2 go build -o pkg/tivan-$1-$2 -ldflags "-X main.Version $VERSION" ./cmd/tivan/tivan.go - du -h pkg/tivan-$1-$2 + GOOS=$1 GOARCH=$2 go build -o pkg/telegraf-$1-$2 -ldflags "-X main.Version $VERSION" ./cmd/telegraf/telegraf.go + du -h pkg/telegraf-$1-$2 } build "darwin" "amd64" diff --git a/tivan.toml b/telegraf.toml similarity index 88% rename from tivan.toml rename to telegraf.toml index a5ee89f6cddc0..c43e575b39a92 100644 --- a/tivan.toml +++ b/telegraf.toml @@ -1,9 +1,9 @@ -# Tivan configuration +# Telegraf configuration # If this file is missing an [agent] section, you must first generate a -# valid config with 'tivan -sample-config > tivan.toml' +# valid config with 'telegraf -sample-config > telegraf.toml' -# Tivan is entirely plugin driven. All metrics are gathered from the +# Telegraf is entirely plugin driven. All metrics are gathered from the # declared plugins. # Even if a plugin has no configuration, it must be declared in here @@ -11,7 +11,7 @@ # as a section with no variables. To deactivate a plugin, comment # out the name and any variables. -# Use 'tivan -config tivan.toml -test' to see what metrics a config +# Use 'telegraf -config telegraf.toml -test' to see what metrics a config # file would generate. # One rule that plugins conform to is wherever a connection string @@ -28,13 +28,13 @@ url = "http://10.20.2.4:8086" # required. # The target database for metrics. This database must already exist -database = "tivan" # required. +database = "telegraf" # required. -# username = "tivan" +# username = "telegraf" # password = "metricsmetricsmetricsmetrics" # Set the user agent for the POSTs (can be useful for log differentiation) -# user_agent = "tivan" +# user_agent = "telegraf" # tags = { "dc": "us-east-1" } # Tags can also be specified via a normal map, but only one form at a time: @@ -42,7 +42,7 @@ database = "tivan" # required. # [influxdb.tags] # dc = "us-east-1" -# Configuration for tivan itself +# Configuration for telegraf itself # [agent] # interval = "10s" # debug = false @@ -83,7 +83,7 @@ servers = ["localhost"] # Read metrics about network interface usage [net] -# By default, tivan gathers stats from any up interface (excluding loopback) +# By default, telegraf gathers stats from any up interface (excluding loopback) # Setting interfaces will tell it to gather these explicit interfaces, # regardless of status. # diff --git a/testdata/influx.toml b/testdata/influx.toml index f29c48c80518a..fc5d3c493051b 100644 --- a/testdata/influx.toml +++ b/testdata/influx.toml @@ -7,7 +7,7 @@ debug = true url = "http://localhost:8086" username = "root" password = "root" -database = "tivan" +database = "telegraf" tags = { dc = "us-phx-1" } [redis]