Fix phpfpm fcgi client panic when URL doesnt exist

closes #1886
This commit is contained in:
Cameron Sparr 2016-10-12 11:58:38 +01:00
parent bccef2856d
commit 974221f0cf
2 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,7 @@ continue sending logs to /var/log/telegraf/telegraf.log.
- [#1731](https://github.com/influxdata/telegraf/issues/1731): Fix Graphite template ordering, use most specific. - [#1731](https://github.com/influxdata/telegraf/issues/1731): Fix Graphite template ordering, use most specific.
- [#1836](https://github.com/influxdata/telegraf/pull/1836): Fix snmp table field initialization for non-automatic table. - [#1836](https://github.com/influxdata/telegraf/pull/1836): Fix snmp table field initialization for non-automatic table.
- [#1724](https://github.com/influxdata/telegraf/issues/1724): cgroups path being parsed as metric. - [#1724](https://github.com/influxdata/telegraf/issues/1724): cgroups path being parsed as metric.
- [#1886](https://github.com/influxdata/telegraf/issues/1886): Fix phpfpm fcgi client panic when URL does not exist.
## v1.0.1 [2016-09-26] ## v1.0.1 [2016-09-26]

View File

@ -122,6 +122,9 @@ func (g *phpfpm) gatherServer(addr string, acc telegraf.Accumulator) error {
fcgiIp := socketAddr[0] fcgiIp := socketAddr[0]
fcgiPort, _ := strconv.Atoi(socketAddr[1]) fcgiPort, _ := strconv.Atoi(socketAddr[1])
fcgi, err = newFcgiClient(fcgiIp, fcgiPort) fcgi, err = newFcgiClient(fcgiIp, fcgiPort)
if err != nil {
return err
}
if len(u.Path) > 1 { if len(u.Path) > 1 {
statusPath = strings.Trim(u.Path, "/") statusPath = strings.Trim(u.Path, "/")
} else { } else {