parent
6fb7d2883d
commit
7a2eeb7439
|
@ -3,6 +3,7 @@
|
||||||
### Features
|
### Features
|
||||||
- [#412](https://github.com/influxdb/telegraf/pull/412): Additional memcached stats. Thanks @mgresser!
|
- [#412](https://github.com/influxdb/telegraf/pull/412): Additional memcached stats. Thanks @mgresser!
|
||||||
- [#410](https://github.com/influxdb/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain!
|
- [#410](https://github.com/influxdb/telegraf/pull/410): Additional redis metrics. Thanks @vlaadbrain!
|
||||||
|
- [#414](https://github.com/influxdb/telegraf/issues/414): Jolokia plugin auth parameters
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- [#405](https://github.com/influxdb/telegraf/issues/405): Prometheus output cardinality issue
|
- [#405](https://github.com/influxdb/telegraf/issues/405): Prometheus output cardinality issue
|
||||||
|
|
|
@ -13,9 +13,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
Name string
|
Name string
|
||||||
Host string
|
Host string
|
||||||
Port string
|
Username string
|
||||||
|
Password string
|
||||||
|
Port string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Metric struct {
|
type Metric struct {
|
||||||
|
@ -59,6 +61,8 @@ func (j *Jolokia) SampleConfig() string {
|
||||||
name = "stable"
|
name = "stable"
|
||||||
host = "192.168.103.2"
|
host = "192.168.103.2"
|
||||||
port = "8180"
|
port = "8180"
|
||||||
|
# username = "myuser"
|
||||||
|
# password = "mypassword"
|
||||||
|
|
||||||
# List of metrics collected on above servers
|
# List of metrics collected on above servers
|
||||||
# Each metric consists in a name, a jmx path and either a pass or drop slice attributes
|
# Each metric consists in a name, a jmx path and either a pass or drop slice attributes
|
||||||
|
@ -193,10 +197,14 @@ func (j *Jolokia) Gather(acc plugins.Accumulator) error {
|
||||||
tags["host"] = server.Host
|
tags["host"] = server.Host
|
||||||
|
|
||||||
// Prepare URL
|
// Prepare URL
|
||||||
requestUrl, err := url.Parse("http://" + server.Host + ":" + server.Port + context + jmxPath)
|
requestUrl, err := url.Parse("http://" + server.Host + ":" +
|
||||||
|
server.Port + context + jmxPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if server.Username != "" || server.Password != "" {
|
||||||
|
requestUrl.User = url.UserPassword(server.Username, server.Password)
|
||||||
|
}
|
||||||
|
|
||||||
out, _ := j.getAttr(requestUrl)
|
out, _ := j.getAttr(requestUrl)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue