This commit is contained in:
koksan83 2015-10-05 08:37:28 +00:00
commit 786bb64b37
103 changed files with 251 additions and 248 deletions

View File

@ -1,93 +1,93 @@
## v0.1.7 [unreleased]
### Features
- [#38](https://github.com/influxdb/telegraf/pull/38): Kafka output producer.
- [#133](https://github.com/influxdb/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0!
- [#136](https://github.com/influxdb/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin.
- [#137](https://github.com/influxdb/telegraf/issues/137): Memcached: fix when a value contains a space
- [#138](https://github.com/influxdb/telegraf/issues/138): MySQL server address tag.
- [#142](https://github.com/influxdb/telegraf/pull/142): Add Description and SampleConfig funcs to output interface
- [#38](https://github.com/koksan83/telegraf/pull/38): Kafka output producer.
- [#133](https://github.com/koksan83/telegraf/pull/133): Add plugin.Gather error logging. Thanks @nickscript0!
- [#136](https://github.com/koksan83/telegraf/issues/136): Add a -usage flag for printing usage of a single plugin.
- [#137](https://github.com/koksan83/telegraf/issues/137): Memcached: fix when a value contains a space
- [#138](https://github.com/koksan83/telegraf/issues/138): MySQL server address tag.
- [#142](https://github.com/koksan83/telegraf/pull/142): Add Description and SampleConfig funcs to output interface
- Indent the toml config file for readability
### Bugfixes
- [#128](https://github.com/influxdb/telegraf/issues/128): system_load measurement missing.
- [#129](https://github.com/influxdb/telegraf/issues/129): Latest pkg url fix.
- [#131](https://github.com/influxdb/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra!
- [#140](https://github.com/influxdb/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc!
- [#128](https://github.com/koksan83/telegraf/issues/128): system_load measurement missing.
- [#129](https://github.com/koksan83/telegraf/issues/129): Latest pkg url fix.
- [#131](https://github.com/koksan83/telegraf/issues/131): Fix memory reporting on linux & darwin. Thanks @subhachandrachandra!
- [#140](https://github.com/koksan83/telegraf/issues/140): Memory plugin prec->perc typo fix. Thanks @brunoqc!
## v0.1.6 [2015-08-20]
### Features
- [#112](https://github.com/influxdb/telegraf/pull/112): Datadog output. Thanks @jipperinbham!
- [#116](https://github.com/influxdb/telegraf/pull/116): Use godep to vendor all dependencies
- [#120](https://github.com/influxdb/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales!
- [#112](https://github.com/koksan83/telegraf/pull/112): Datadog output. Thanks @jipperinbham!
- [#116](https://github.com/koksan83/telegraf/pull/116): Use godep to vendor all dependencies
- [#120](https://github.com/koksan83/telegraf/pull/120): Httpjson plugin. Thanks @jpalay & @alvaromorales!
### Bugfixes
- [#113](https://github.com/influxdb/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility
- [#118](https://github.com/influxdb/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser!
- [#122](https://github.com/influxdb/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser!
- [#126](https://github.com/influxdb/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error
- [#113](https://github.com/koksan83/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility
- [#118](https://github.com/koksan83/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser!
- [#122](https://github.com/koksan83/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser!
- [#126](https://github.com/koksan83/telegraf/issues/126): Nginx plugin not catching net.SplitHostPort error
## v0.1.5 [2015-08-13]
### Features
- [#54](https://github.com/influxdb/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham!
- [#55](https://github.com/influxdb/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar!
- [#71](https://github.com/influxdb/telegraf/pull/71): HAProxy plugin. Thanks @kureikain!
- [#72](https://github.com/influxdb/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk!
- [#73](https://github.com/influxdb/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh!
- [#77](https://github.com/influxdb/telegraf/issues/77): Automatically create database.
- [#79](https://github.com/influxdb/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc!
- [#86](https://github.com/influxdb/telegraf/pull/86): Lustre2 plugin. Thanks srfraser!
- [#91](https://github.com/influxdb/telegraf/pull/91): Unit testing
- [#92](https://github.com/influxdb/telegraf/pull/92): Exec plugin. Thanks @alvaromorales!
- [#98](https://github.com/influxdb/telegraf/pull/98): LeoFS plugin. Thanks @mocchira!
- [#103](https://github.com/influxdb/telegraf/pull/103): Filter by metric tags. Thanks @srfraser!
- [#106](https://github.com/influxdb/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet!
- [#107](https://github.com/influxdb/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham!
- [#108](https://github.com/influxdb/telegraf/issues/108): Support setting per-CPU and total-CPU gathering.
- [#111](https://github.com/influxdb/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay!
- [#54](https://github.com/koksan83/telegraf/pull/54): MongoDB plugin. Thanks @jipperinbham!
- [#55](https://github.com/koksan83/telegraf/pull/55): Elasticsearch plugin. Thanks @brocaar!
- [#71](https://github.com/koksan83/telegraf/pull/71): HAProxy plugin. Thanks @kureikain!
- [#72](https://github.com/koksan83/telegraf/pull/72): Adding TokuDB metrics to MySQL. Thanks vadimtk!
- [#73](https://github.com/koksan83/telegraf/pull/73): RabbitMQ plugin. Thanks @ianunruh!
- [#77](https://github.com/koksan83/telegraf/issues/77): Automatically create database.
- [#79](https://github.com/koksan83/telegraf/pull/56): Nginx plugin. Thanks @codeb2cc!
- [#86](https://github.com/koksan83/telegraf/pull/86): Lustre2 plugin. Thanks srfraser!
- [#91](https://github.com/koksan83/telegraf/pull/91): Unit testing
- [#92](https://github.com/koksan83/telegraf/pull/92): Exec plugin. Thanks @alvaromorales!
- [#98](https://github.com/koksan83/telegraf/pull/98): LeoFS plugin. Thanks @mocchira!
- [#103](https://github.com/koksan83/telegraf/pull/103): Filter by metric tags. Thanks @srfraser!
- [#106](https://github.com/koksan83/telegraf/pull/106): Options to filter plugins on startup. Thanks @zepouet!
- [#107](https://github.com/koksan83/telegraf/pull/107): Multiple outputs beyong influxdb. Thanks @jipperinbham!
- [#108](https://github.com/koksan83/telegraf/issues/108): Support setting per-CPU and total-CPU gathering.
- [#111](https://github.com/koksan83/telegraf/pull/111): Report CPU Usage in cpu plugin. Thanks @jpalay!
### Bugfixes
- [#85](https://github.com/influxdb/telegraf/pull/85): Fix GetLocalHost testutil function for mac users
- [#89](https://github.com/influxdb/telegraf/pull/89): go fmt fixes
- [#94](https://github.com/influxdb/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama
- [#101](https://github.com/influxdb/telegraf/issues/101): switch back from master branch if building locally
- [#99](https://github.com/influxdb/telegraf/issues/99): update integer output to new InfluxDB line protocol format
- [#85](https://github.com/koksan83/telegraf/pull/85): Fix GetLocalHost testutil function for mac users
- [#89](https://github.com/koksan83/telegraf/pull/89): go fmt fixes
- [#94](https://github.com/koksan83/telegraf/pull/94): Fix for issue #93, explicitly call sarama.v1 -> sarama
- [#101](https://github.com/koksan83/telegraf/issues/101): switch back from master branch if building locally
- [#99](https://github.com/koksan83/telegraf/issues/99): update integer output to new InfluxDB line protocol format
## v0.1.4 [2015-07-09]
### Features
- [#56](https://github.com/influxdb/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS!
- [#56](https://github.com/koksan83/telegraf/pull/56): Update README for Kafka plugin. Thanks @EmilS!
### Bugfixes
- [#50](https://github.com/influxdb/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff!
- [#52](https://github.com/influxdb/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb!
- [#50](https://github.com/koksan83/telegraf/pull/50): Fix init.sh script to use telegraf directory. Thanks @jseriff!
- [#52](https://github.com/koksan83/telegraf/pull/52): Update CHANGELOG to reference updated directory. Thanks @benfb!
## v0.1.3 [2015-07-05]
### Features
- [#35](https://github.com/influxdb/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS!
- [#47](https://github.com/influxdb/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham!
- [#35](https://github.com/koksan83/telegraf/pull/35): Add Kafka plugin. Thanks @EmilS!
- [#47](https://github.com/koksan83/telegraf/pull/47): Add RethinkDB plugin. Thanks @jipperinbham!
### Bugfixes
- [#45](https://github.com/influxdb/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz!
- [#43](https://github.com/influxdb/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils!
- [#45](https://github.com/koksan83/telegraf/pull/45): Skip disk tags that don't have a value. Thanks @jhofeditz!
- [#43](https://github.com/koksan83/telegraf/pull/43): Fix bug in MySQL plugin. Thanks @marcosnils!
## v0.1.2 [2015-07-01]
### Features
- [#12](https://github.com/influxdb/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit!
- [#14](https://github.com/influxdb/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to.
- [#16](https://github.com/influxdb/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham!
- [#21](https://github.com/influxdb/telegraf/pull/21): Add memcached plugin. Thanks @Yukki!
- [#12](https://github.com/koksan83/telegraf/pull/12): Add Linux/ARM to the list of built binaries. Thanks @voxxit!
- [#14](https://github.com/koksan83/telegraf/pull/14): Clarify the S3 buckets that Telegraf is pushed to.
- [#16](https://github.com/koksan83/telegraf/pull/16): Convert Redis to use URI, support Redis AUTH. Thanks @jipperinbham!
- [#21](https://github.com/koksan83/telegraf/pull/21): Add memcached plugin. Thanks @Yukki!
### Bugfixes
- [#13](https://github.com/influxdb/telegraf/pull/13): Fix the packaging script.
- [#19](https://github.com/influxdb/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain!
- [#20](https://github.com/influxdb/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros!
- [#23](https://github.com/influxdb/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer!
- [#32](https://github.com/influxdb/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff!
- [#13](https://github.com/koksan83/telegraf/pull/13): Fix the packaging script.
- [#19](https://github.com/koksan83/telegraf/pull/19): Add host name to metric tags. Thanks @sherifzain!
- [#20](https://github.com/koksan83/telegraf/pull/20): Fix race condition with accumulator mutex. Thanks @nkatsaros!
- [#23](https://github.com/koksan83/telegraf/pull/23): Change name of folder for packages. Thanks @colinrymer!
- [#32](https://github.com/koksan83/telegraf/pull/32): Fix spelling of memoory -> memory. Thanks @tylernisonoff!
## v0.1.1 [2015-06-19]

2
Godeps/Godeps.json generated
View File

@ -1,5 +1,5 @@
{
"ImportPath": "github.com/influxdb/telegraf",
"ImportPath": "github.com/koksan83/telegraf",
"GoVersion": "go1.4.2",
"Packages": [
"./..."

View File

@ -1 +0,0 @@
doesnotexist

View File

@ -2,7 +2,9 @@ UNAME := $(shell sh -c 'uname')
VERSION := $(shell sh -c 'git describe --always --tags')
build: prepare
$(GOPATH)/bin/godep go build -o telegraf -ldflags \
CGO_ENABLED=0 $(GOPATH)/bin/godep go build -a -installsuffix cgo \
-o telegraf \
-ldflags \
"-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go

View File

@ -1,4 +1,4 @@
# Telegraf - A native agent for InfluxDB [![Circle CI](https://circleci.com/gh/influxdb/telegraf.svg?style=svg)](https://circleci.com/gh/influxdb/telegraf)
# Telegraf - A native agent for InfluxDB [![Circle CI](https://circleci.com/gh/koksan83/telegraf.svg?style=svg)](https://circleci.com/gh/koksan83/telegraf)
Telegraf is an agent written in Go for collecting metrics from the system it's
running on or from other services and writing them into InfluxDB.
@ -51,8 +51,8 @@ if you don't have it already. You also must build with golang version 1.4+
1. [Install Go](https://golang.org/doc/install)
2. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH)
3. run `go get github.com/influxdb/telegraf`
4. `cd $GOPATH/src/github.com/influxdb/telegraf`
3. run `go get github.com/koksan83/telegraf`
4. `cd $GOPATH/src/github.com/koksan83/telegraf`
5. run `make`
### How to use it:
@ -186,7 +186,7 @@ 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 Telegraf itself, plugins must add themselves to the
`github.com/influxdb/telegraf/plugins/all/all.go` file.
`github.com/koksan83/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.
@ -259,7 +259,7 @@ package simple
// simple.go
import "github.com/influxdb/telegraf/plugins"
import "github.com/koksan83/telegraf/plugins"
type Simple struct {
Ok bool
@ -303,7 +303,7 @@ which would take some time to replicate.
To overcome this situation we've decided to use docker containers to provide a
fast and reproducible environment to test those services which require it.
For other situations
(i.e: https://github.com/influxdb/telegraf/blob/master/plugins/redis/redis_test.go )
(i.e: https://github.com/koksan83/telegraf/blob/master/plugins/redis/redis_test.go )
a simple mock will suffice.
To execute Telegraf tests follow these simple steps:

10
Vagrantfile vendored
View File

@ -7,10 +7,12 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/influxdb/telegraf",
config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/koksan83/telegraf",
type: "rsync",
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"],
rsync__exclude: ["./telegraf", ".vagrant/"]
rsync__args: ["--verbose"],
# rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"],
rsync__exclude: [".vagrant/"]
# rsync__exclude: ["./telegraf", ".vagrant/"]
config.vm.provision "shell", name: "sudo", inline: <<-SHELL
chown -R vagrant:vagrant /home/vagrant/go
@ -26,7 +28,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
gvm use go1.4.2 --default
echo "export PATH=$PATH:$GOPATH/bin" >> "$HOME/.bashrc"
echo 'export GOPATH=/home/vagrant/go' >> "$HOME/.bashrc"
cd "$HOME/go/src/github.com/influxdb/telegraf" &&\
cd "$HOME/go/src/github.com/koksan83/telegraf" &&\
rm -rf Godeps/_workspace/pkg &&\
GOPATH="$HOME/go" make
SHELL

View File

@ -10,8 +10,8 @@ import (
"sync"
"time"
"github.com/influxdb/telegraf/outputs"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/outputs"
"github.com/koksan83/telegraf/plugins"
)
type runningOutput struct {

View File

@ -5,7 +5,7 @@ import (
"testing"
// needing to load the plugins
_ "github.com/influxdb/telegraf/plugins/all"
_ "github.com/koksan83/telegraf/plugins/all"
)
func TestAgent_LoadPlugin(t *testing.T) {

View File

@ -51,7 +51,7 @@ echo "\$CIRCLE_BRANCH: $CIRCLE_BRANCH"
# Move the checked-out source to a better location
exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdb
exit_if_fail cd $GOPATH/src/github.com/influxdb/telegraf
exit_if_fail cd $GOPATH/src/github.com/koksan83/telegraf
# Install the code
exit_if_fail godep go build -v ./...

View File

@ -8,9 +8,9 @@ import (
"os/signal"
"strings"
"github.com/influxdb/telegraf"
_ "github.com/influxdb/telegraf/outputs/all"
_ "github.com/influxdb/telegraf/plugins/all"
"github.com/koksan83/telegraf"
_ "github.com/koksan83/telegraf/outputs/all"
_ "github.com/koksan83/telegraf/plugins/all"
)
var fDebug = flag.Bool("debug", false,

View File

@ -8,8 +8,8 @@ import (
"strings"
"time"
"github.com/influxdb/telegraf/outputs"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/outputs"
"github.com/koksan83/telegraf/plugins"
"github.com/naoina/toml"
"github.com/naoina/toml/ast"
)

View File

@ -1,7 +1,7 @@
package all
import (
_ "github.com/influxdb/telegraf/outputs/datadog"
_ "github.com/influxdb/telegraf/outputs/influxdb"
_ "github.com/influxdb/telegraf/outputs/kafka"
_ "github.com/koksan83/telegraf/outputs/datadog"
_ "github.com/koksan83/telegraf/outputs/influxdb"
_ "github.com/koksan83/telegraf/outputs/kafka"
)

View File

@ -9,8 +9,8 @@ import (
"sort"
"github.com/influxdb/influxdb/client"
t "github.com/influxdb/telegraf"
"github.com/influxdb/telegraf/outputs"
t "github.com/koksan83/telegraf"
"github.com/koksan83/telegraf/outputs"
)
type Datadog struct {

View File

@ -9,7 +9,7 @@ import (
"testing"
"time"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/influxdb/influxdb/client"
"github.com/stretchr/testify/assert"

View File

@ -7,8 +7,8 @@ import (
"strings"
"github.com/influxdb/influxdb/client"
t "github.com/influxdb/telegraf"
"github.com/influxdb/telegraf/outputs"
t "github.com/koksan83/telegraf"
"github.com/koksan83/telegraf/outputs"
)
type InfluxDB struct {

View File

@ -6,7 +6,7 @@ import (
"github.com/Shopify/sarama"
"github.com/influxdb/influxdb/client"
"github.com/influxdb/telegraf/outputs"
"github.com/koksan83/telegraf/outputs"
)
type Kafka struct {

View File

@ -3,7 +3,7 @@ package kafka
import (
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/require"
)

View File

@ -1,22 +1,22 @@
package all
import (
_ "github.com/influxdb/telegraf/plugins/disque"
_ "github.com/influxdb/telegraf/plugins/elasticsearch"
_ "github.com/influxdb/telegraf/plugins/exec"
_ "github.com/influxdb/telegraf/plugins/haproxy"
_ "github.com/influxdb/telegraf/plugins/httpjson"
_ "github.com/influxdb/telegraf/plugins/kafka_consumer"
_ "github.com/influxdb/telegraf/plugins/leofs"
_ "github.com/influxdb/telegraf/plugins/lustre2"
_ "github.com/influxdb/telegraf/plugins/memcached"
_ "github.com/influxdb/telegraf/plugins/mongodb"
_ "github.com/influxdb/telegraf/plugins/mysql"
_ "github.com/influxdb/telegraf/plugins/nginx"
_ "github.com/influxdb/telegraf/plugins/postgresql"
_ "github.com/influxdb/telegraf/plugins/prometheus"
_ "github.com/influxdb/telegraf/plugins/rabbitmq"
_ "github.com/influxdb/telegraf/plugins/redis"
_ "github.com/influxdb/telegraf/plugins/rethinkdb"
_ "github.com/influxdb/telegraf/plugins/system"
_ "github.com/koksan83/telegraf/plugins/disque"
_ "github.com/koksan83/telegraf/plugins/elasticsearch"
_ "github.com/koksan83/telegraf/plugins/exec"
_ "github.com/koksan83/telegraf/plugins/haproxy"
_ "github.com/koksan83/telegraf/plugins/httpjson"
_ "github.com/koksan83/telegraf/plugins/kafka_consumer"
_ "github.com/koksan83/telegraf/plugins/leofs"
_ "github.com/koksan83/telegraf/plugins/lustre2"
_ "github.com/koksan83/telegraf/plugins/memcached"
_ "github.com/koksan83/telegraf/plugins/mongodb"
_ "github.com/koksan83/telegraf/plugins/mysql"
_ "github.com/koksan83/telegraf/plugins/nginx"
_ "github.com/koksan83/telegraf/plugins/postgresql"
_ "github.com/koksan83/telegraf/plugins/prometheus"
_ "github.com/koksan83/telegraf/plugins/rabbitmq"
_ "github.com/koksan83/telegraf/plugins/redis"
_ "github.com/koksan83/telegraf/plugins/rethinkdb"
_ "github.com/koksan83/telegraf/plugins/system"
)

View File

@ -10,7 +10,7 @@ import (
"strings"
"sync"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type Disque struct {

View File

@ -6,7 +6,7 @@ import (
"net"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -5,7 +5,7 @@ import (
"fmt"
"net/http"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
const statsPath = "/_nodes/stats"

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
)

View File

@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
"github.com/gonuts/go-shellquote"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"os/exec"
"sync"
)

View File

@ -2,7 +2,7 @@ package exec
import (
"fmt"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"

View File

@ -3,7 +3,7 @@ package haproxy
import (
"encoding/csv"
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"io"
"net/http"
"net/url"

View File

@ -5,7 +5,7 @@ import (
"strings"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"net/http"

View File

@ -10,7 +10,7 @@ import (
"strings"
"sync"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type HttpJson struct {

View File

@ -7,7 +7,7 @@ import (
"strings"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -7,7 +7,7 @@ import (
"github.com/Shopify/sarama"
"github.com/influxdb/influxdb/tsdb"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"github.com/wvanbergen/kafka/consumergroup"
)

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/Shopify/sarama"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/Shopify/sarama"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -3,7 +3,7 @@ package leofs
import (
"bufio"
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"net/url"
"os/exec"
"strconv"

View File

@ -1,7 +1,7 @@
package leofs
import (
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io/ioutil"

View File

@ -13,8 +13,8 @@ import (
"strconv"
"strings"
"github.com/influxdb/telegraf/plugins"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
// Lustre proc files can change between versions, so we want to future-proof

View File

@ -5,7 +5,7 @@ import (
"os"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -8,7 +8,7 @@ import (
"strconv"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
// Memcached is a memcached plugin

View File

@ -3,7 +3,7 @@ package memcached
import (
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"gopkg.in/mgo.v2"
)

View File

@ -5,7 +5,7 @@ import (
"reflect"
"strconv"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type MongodbData struct {

View File

@ -4,7 +4,7 @@ import (
"testing"
"time"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -4,7 +4,7 @@ import (
"net/url"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -6,7 +6,7 @@ import (
"strings"
_ "github.com/go-sql-driver/mysql"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type Mysql struct {

View File

@ -5,7 +5,7 @@ import (
"strings"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -11,7 +11,7 @@ import (
"sync"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type Nginx struct {

View File

@ -8,7 +8,7 @@ import (
"net/url"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -3,7 +3,7 @@ package postgresql
import (
"database/sql"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
_ "github.com/lib/pq"
)

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -7,7 +7,7 @@ import (
"sync"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"github.com/prometheus/client_golang/extraction"
"github.com/prometheus/client_golang/model"
)

View File

@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -5,7 +5,7 @@ import (
"fmt"
"net/http"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
const DefaultUsername = "guest"

View File

@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -10,7 +10,7 @@ import (
"strings"
"sync"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type Redis struct {

View File

@ -6,7 +6,7 @@ import (
"net"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -5,7 +5,7 @@ import (
"net/url"
"sync"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"gopkg.in/dancannon/gorethink.v1"
)

View File

@ -4,7 +4,7 @@ import (
"reflect"
"time"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type serverStatus struct {

View File

@ -3,7 +3,7 @@ package rethinkdb
import (
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
)

View File

@ -9,7 +9,7 @@ import (
"strconv"
"strings"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
"gopkg.in/dancannon/gorethink.v1"
)

View File

@ -5,7 +5,7 @@ package rethinkdb
import (
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -3,8 +3,8 @@ package system
import (
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
"github.com/koksan83/telegraf/plugins"
"github.com/koksan83/telegraf/plugins/system/ps/cpu"
)
type CPUStats struct {

View File

@ -3,7 +3,7 @@ package system
import (
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type DiskStats struct {

View File

@ -5,7 +5,7 @@ package system
import (
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type DockerStats struct {

View File

@ -5,9 +5,9 @@ package system
import (
"testing"
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
"github.com/influxdb/telegraf/plugins/system/ps/docker"
"github.com/influxdb/telegraf/testutil"
"github.com/koksan83/telegraf/plugins/system/ps/cpu"
"github.com/koksan83/telegraf/plugins/system/ps/docker"
"github.com/koksan83/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View File

@ -3,7 +3,7 @@ package system
import (
"fmt"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type MemStats struct {

View File

@ -2,12 +2,12 @@ package system
import "github.com/stretchr/testify/mock"
import "github.com/influxdb/telegraf/plugins/system/ps/cpu"
import "github.com/influxdb/telegraf/plugins/system/ps/disk"
import "github.com/koksan83/telegraf/plugins/system/ps/cpu"
import "github.com/koksan83/telegraf/plugins/system/ps/disk"
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"
import "github.com/koksan83/telegraf/plugins/system/ps/load"
import "github.com/koksan83/telegraf/plugins/system/ps/mem"
import "github.com/koksan83/telegraf/plugins/system/ps/net"
type MockPS struct {
mock.Mock

View File

@ -4,7 +4,7 @@ import (
"fmt"
"net"
"github.com/influxdb/telegraf/plugins"
"github.com/koksan83/telegraf/plugins"
)
type NetIOStats struct {

View File

@ -5,14 +5,14 @@ import (
"strings"
dc "github.com/fsouza/go-dockerclient"
"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"
"github.com/koksan83/telegraf/plugins"
"github.com/koksan83/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/cpu"
"github.com/koksan83/telegraf/plugins/system/ps/disk"
"github.com/koksan83/telegraf/plugins/system/ps/docker"
"github.com/koksan83/telegraf/plugins/system/ps/load"
"github.com/koksan83/telegraf/plugins/system/ps/mem"
"github.com/koksan83/telegraf/plugins/system/ps/net"
)
type DockerContainerStat struct {

View File

@ -24,7 +24,7 @@ import (
"strings"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
// sys/resource.h

View File

@ -8,7 +8,7 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
// sys/resource.h

View File

@ -8,11 +8,11 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
filename := "/proc/stat"
filename := "/rootfs/proc/stat"
var lines = []string{}
if percpu {
var startIdx uint = 1
@ -43,7 +43,7 @@ func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
}
func CPUInfo() ([]CPUInfoStat, error) {
filename := "/proc/cpuinfo"
filename := "/rootfs/proc/cpuinfo"
lines, _ := common.ReadLines(filename)
var ret []CPUInfoStat

View File

@ -8,7 +8,7 @@ import (
"time"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
// TODO: Get percpu

View File

@ -6,7 +6,7 @@ import (
"syscall"
"unsafe"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/common"
)
func DiskPartitions(all bool) ([]DiskPartitionStat, error) {

View File

@ -9,7 +9,7 @@ import (
"syscall"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
const (

View File

@ -8,7 +8,7 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
const (
@ -42,7 +42,7 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
}
func DiskIOCounters() (map[string]DiskIOCountersStat, error) {
filename := "/proc/diskstats"
filename := "/rootfs/proc/diskstats"
lines, err := common.ReadLines(filename)
if err != nil {
return nil, err

View File

@ -5,7 +5,7 @@ import (
"runtime"
"testing"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/common"
)
func TestDisk_usage(t *testing.T) {

View File

@ -9,7 +9,7 @@ import (
"time"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
var (

View File

@ -9,8 +9,8 @@ import (
"strconv"
"strings"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
"github.com/koksan83/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/cpu"
)
// GetDockerIDList returnes a list of DockerID.

View File

@ -5,8 +5,8 @@ package docker
import (
"encoding/json"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
"github.com/koksan83/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/cpu"
)
// GetDockerIDList returnes a list of DockerID.

View File

@ -13,7 +13,7 @@ import (
"strings"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func HostInfo() (*HostInfoStat, error) {

View File

@ -13,7 +13,7 @@ import (
"strings"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
const (

View File

@ -14,7 +14,7 @@ import (
"syscall"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
type LSB struct {
@ -280,12 +280,12 @@ func GetVirtualization() (string, string, error) {
var system string
var role string
if common.PathExists("/proc/xen") {
if common.PathExists("/rootfs/proc/xen") {
system = "xen"
role = "guest" // assume guest
if common.PathExists("/proc/xen/capabilities") {
contents, err := common.ReadLines("/proc/xen/capabilities")
if common.PathExists("/rootfs/proc/xen/capabilities") {
contents, err := common.ReadLines("/rootfs/proc/xen/capabilities")
if err == nil {
if common.StringContains(contents, "control_d") {
role = "host"
@ -293,8 +293,8 @@ func GetVirtualization() (string, string, error) {
}
}
}
if common.PathExists("/proc/modules") {
contents, err := common.ReadLines("/proc/modules")
if common.PathExists("/rootfs/proc/modules") {
contents, err := common.ReadLines("/rootfs/proc/modules")
if err == nil {
if common.StringContains(contents, "kvm") {
system = "kvm"
@ -309,8 +309,8 @@ func GetVirtualization() (string, string, error) {
}
}
if common.PathExists("/proc/cpuinfo") {
contents, err := common.ReadLines("/proc/cpuinfo")
if common.PathExists("/rootfs/proc/cpuinfo") {
contents, err := common.ReadLines("/rootfs/proc/cpuinfo")
if err == nil {
if common.StringContains(contents, "QEMU Virtual CPU") ||
common.StringContains(contents, "Common KVM processor") ||
@ -321,18 +321,18 @@ func GetVirtualization() (string, string, error) {
}
}
if common.PathExists("/proc/bc/0") {
if common.PathExists("/rootfs/proc/bc/0") {
system = "openvz"
role = "host"
} else if common.PathExists("/proc/vz") {
} else if common.PathExists("/rootfs/proc/vz") {
system = "openvz"
role = "guest"
}
// not use dmidecode because it requires root
if common.PathExists("/proc/self/status") {
contents, err := common.ReadLines("/proc/self/status")
if common.PathExists("/rootfs/proc/self/status") {
contents, err := common.ReadLines("/rootfs/proc/self/status")
if err == nil {
if common.StringContains(contents, "s_context:") ||
@ -343,8 +343,8 @@ func GetVirtualization() (string, string, error) {
}
}
if common.PathExists("/proc/self/cgroup") {
contents, err := common.ReadLines("/proc/self/cgroup")
if common.PathExists("/rootfs/proc/self/cgroup") {
contents, err := common.ReadLines("/rootfs/proc/self/cgroup")
if err == nil {
if common.StringContains(contents, "lxc") ||

View File

@ -8,8 +8,8 @@ import (
"strings"
"time"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
process "github.com/influxdb/telegraf/plugins/system/ps/process"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
process "github.com/koksan83/telegraf/plugins/system/ps/process"
)
var (

View File

@ -5,7 +5,7 @@ package load
import (
"strconv"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func LoadAvg() (*LoadAvgStat, error) {

View File

@ -5,7 +5,7 @@ package load
import (
"strconv"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func LoadAvg() (*LoadAvgStat, error) {

View File

@ -9,7 +9,7 @@ import (
)
func LoadAvg() (*LoadAvgStat, error) {
filename := "/proc/loadavg"
filename := "/rootfs/proc/loadavg"
line, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err

View File

@ -3,7 +3,7 @@
package load
import (
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func LoadAvg() (*LoadAvgStat, error) {

View File

@ -7,7 +7,7 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func getPageSize() (uint64, error) {

View File

@ -7,7 +7,7 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func VirtualMemory() (*VirtualMemoryStat, error) {

View File

@ -7,11 +7,11 @@ import (
"strings"
"syscall"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
func VirtualMemory() (*VirtualMemoryStat, error) {
filename := "/proc/meminfo"
filename := "/rootfs/proc/meminfo"
lines, _ := common.ReadLines(filename)
ret := &VirtualMemoryStat{}
@ -67,7 +67,7 @@ func SwapMemory() (*SwapMemoryStat, error) {
} else {
ret.UsedPercent = 0
}
lines, _ := common.ReadLines("/proc/vmstat")
lines, _ := common.ReadLines("/rootfs/proc/vmstat")
for _, l := range lines {
fields := strings.Fields(l)
if len(fields) < 2 {

View File

@ -6,7 +6,7 @@ import (
"syscall"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
var (

View File

@ -7,7 +7,7 @@ import (
"strconv"
"strings"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/common"
)
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {

View File

@ -7,7 +7,7 @@ import (
"strconv"
"strings"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/common"
)
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {

View File

@ -6,7 +6,7 @@ import (
"strconv"
"strings"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
// NetIOCounters returnes network I/O statistics for every network
@ -15,7 +15,7 @@ import (
// every network interface installed on the system is returned
// separately.
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
filename := "/proc/net/dev"
filename := "/rootfs/proc/net/dev"
lines, err := common.ReadLines(filename)
if err != nil {
return nil, err

View File

@ -8,7 +8,7 @@ import (
"syscall"
"unsafe"
common "github.com/influxdb/telegraf/plugins/system/ps/common"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
)
var (

View File

@ -5,7 +5,7 @@ import (
"runtime"
"time"
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
cpu "github.com/koksan83/telegraf/plugins/system/ps/cpu"
)
type Process struct {

View File

@ -10,9 +10,9 @@ import (
"syscall"
"unsafe"
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"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
cpu "github.com/koksan83/telegraf/plugins/system/ps/cpu"
net "github.com/koksan83/telegraf/plugins/system/ps/net"
)
// copied from sys/sysctl.h

View File

@ -7,9 +7,9 @@ import (
"encoding/binary"
"unsafe"
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"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
cpu "github.com/koksan83/telegraf/plugins/system/ps/cpu"
net "github.com/koksan83/telegraf/plugins/system/ps/net"
)
// MemoryInfoExStat is different between OSes

View File

@ -11,10 +11,10 @@ import (
"strings"
"syscall"
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"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
cpu "github.com/koksan83/telegraf/plugins/system/ps/cpu"
host "github.com/koksan83/telegraf/plugins/system/ps/host"
net "github.com/koksan83/telegraf/plugins/system/ps/net"
)
const (
@ -181,7 +181,7 @@ func (p *Process) IsRunning() (bool, error) {
return true, common.NotImplementedError
}
// MemoryMaps get memory maps from /proc/(pid)/smaps
// MemoryMaps get memory maps from /rootfs/proc/(pid)/smaps
func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
pid := p.Pid
var ret []MemoryMapsStat
@ -263,7 +263,7 @@ func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
** Internal functions
**/
// Get num_fds from /proc/(pid)/fd
// Get num_fds from /rootfs/proc/(pid)/fd
func (p *Process) fillFromfd() (int32, []*OpenFilesStat, error) {
pid := p.Pid
statPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "fd")
@ -296,7 +296,7 @@ func (p *Process) fillFromfd() (int32, []*OpenFilesStat, error) {
return numFDs, openfiles, nil
}
// Get cwd from /proc/(pid)/cwd
// Get cwd from /rootfs/proc/(pid)/cwd
func (p *Process) fillFromCwd() (string, error) {
pid := p.Pid
cwdPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "cwd")
@ -307,7 +307,7 @@ func (p *Process) fillFromCwd() (string, error) {
return string(cwd), nil
}
// Get exe from /proc/(pid)/exe
// Get exe from /rootfs/proc/(pid)/exe
func (p *Process) fillFromExe() (string, error) {
pid := p.Pid
exePath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "exe")
@ -318,7 +318,7 @@ func (p *Process) fillFromExe() (string, error) {
return string(exe), nil
}
// Get cmdline from /proc/(pid)/cmdline
// Get cmdline from /rootfs/proc/(pid)/cmdline
func (p *Process) fillFromCmdline() (string, error) {
pid := p.Pid
cmdPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "cmdline")
@ -336,7 +336,7 @@ func (p *Process) fillFromCmdline() (string, error) {
return strings.Join(ret, " "), nil
}
// Get IO status from /proc/(pid)/io
// Get IO status from /rootfs/proc/(pid)/io
func (p *Process) fillFromIO() (*IOCountersStat, error) {
pid := p.Pid
ioPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "io")
@ -375,7 +375,7 @@ func (p *Process) fillFromIO() (*IOCountersStat, error) {
return ret, nil
}
// Get memory info from /proc/(pid)/statm
// Get memory info from /rootfs/proc/(pid)/statm
func (p *Process) fillFromStatm() (*MemoryInfoStat, *MemoryInfoExStat, error) {
pid := p.Pid
memPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "statm")
@ -427,7 +427,7 @@ func (p *Process) fillFromStatm() (*MemoryInfoStat, *MemoryInfoExStat, error) {
return memInfo, memInfoEx, nil
}
// Get various status from /proc/(pid)/status
// Get various status from /rootfs/proc/(pid)/status
func (p *Process) fillFromStatus() error {
pid := p.Pid
statPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "status")

View File

@ -7,7 +7,7 @@ import (
"testing"
"time"
"github.com/influxdb/telegraf/plugins/system/ps/common"
"github.com/koksan83/telegraf/plugins/system/ps/common"
)
func testGetProcess() Process {

View File

@ -11,9 +11,9 @@ import (
"github.com/shirou/w32"
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"
common "github.com/koksan83/telegraf/plugins/system/ps/common"
cpu "github.com/koksan83/telegraf/plugins/system/ps/cpu"
net "github.com/koksan83/telegraf/plugins/system/ps/net"
)
const (

Some files were not shown because too many files have changed in this diff Show More