diff --git a/plugins/all/all.go b/plugins/all/all.go index 8670c3d8b..a66ea7f21 100644 --- a/plugins/all/all.go +++ b/plugins/all/all.go @@ -19,4 +19,5 @@ import ( _ "github.com/influxdb/telegraf/plugins/redis" _ "github.com/influxdb/telegraf/plugins/rethinkdb" _ "github.com/influxdb/telegraf/plugins/system" + _ "github.com/influxdb/telegraf/plugins/apache" ) diff --git a/plugins/apache/apache.go b/plugins/apache/apache.go index 042b3a59d..18830e810 100644 --- a/plugins/apache/apache.go +++ b/plugins/apache/apache.go @@ -14,7 +14,7 @@ import ( "github.com/influxdb/telegraf/plugins" ) -type ApacheConf struct { +type Apache struct { Urls []string } @@ -22,15 +22,15 @@ var sampleConfig = ` # An array of Apache status URI to gather stats. urls = ["http://localhost/server-status?auto"]` -func (n *ApacheConf) SampleConfig() string { +func (n *Apache) SampleConfig() string { return sampleConfig } -func (n *ApacheConf) Description() string { +func (n *Apache) Description() string { return "Read Apache status information (mod_status)" } -func (n *ApacheConf) Gather(acc plugins.Accumulator) error { +func (n *Apache) Gather(acc plugins.Accumulator) error { var wg sync.WaitGroup var outerr error @@ -58,7 +58,7 @@ var tr = &http.Transport{ var client = &http.Client{Transport: tr} -func (n *ApacheConf) gatherUrl(addr *url.URL, acc plugins.Accumulator) error { +func (n *Apache) gatherUrl(addr *url.URL, acc plugins.Accumulator) error { resp, err := client.Get(addr.String()) if err != nil { return fmt.Errorf("error making HTTP request to %s: %s", addr.String(), err) @@ -144,6 +144,6 @@ func getTags(addr *url.URL) map[string]string { func init() { plugins.Add("apache", func() plugins.Plugin { - return &ApacheConf{} + return &Apache{} }) }