Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding tomcat plugin #3112

Merged
merged 1 commit into from
Aug 16, 2017
Merged

adding tomcat plugin #3112

merged 1 commit into from
Aug 16, 2017

Conversation

mlindes
Copy link
Contributor

@mlindes mlindes commented Aug 10, 2017

Required for all PRs:

  • [ x] Signed CLA.
  • [ x] Associated README.md updated.
  • [ x] Has appropriate unit tests.

[[inputs.tomcat]]
# A Tomcat status URI to gather stats.
# Default is "http://127.0.0.1:8080/manager/status/all?XML=true".
url = http://127.0.0.1:8080/manager/status/all?XML=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quote string

var sampleconfig = `
## A Tomcat status URI to gather stats.
## Default is "http://127.0.0.1:8080/manager/status/all?XML=true".
url = http://127.0.0.1:8080/manager/status/all?XML=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quote string

## Cedentials for status URI.
## Default is tomcat/s3cret.
username = "tomcat"
password = "s3cret"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix up this indention because it is used directly in the sample config output. You can test with either of these commands:

telegraf --usage tomcat
telegraf config

## A Tomcat status URI to gather stats.
## Default is "http://127.0.0.1:8080/manager/status/all?XML=true".
url = http://127.0.0.1:8080/manager/status/all?XML=true
## Cedentials for status URI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

# A Tomcat status URI to gather stats.
# Default is "http://127.0.0.1:8080/manager/status/all?XML=true".
url = http://127.0.0.1:8080/manager/status/all?XML=true
# Cedentials for status URI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@mlindes
Copy link
Contributor Author

mlindes commented Aug 10, 2017

updated comments / corrected typo.

Copy link
Contributor

@danielnelson danielnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed we need to check the status code, also need to add to plugins/inputs/all/all.go.

if err != nil {
return fmt.Errorf("Unable to call URL '%s': %s", s.URL, err)
}
defer resp.Body.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking for errors, we should make sure the response code was a 200 status and if not return an error.

@danielnelson danielnelson added this to the 1.4.0 milestone Aug 15, 2017
@danielnelson
Copy link
Contributor

@mlindes I'll will do the change to address my last comment tomorrow.

@danielnelson danielnelson merged commit a91457e into influxdata:master Aug 16, 2017
maxunt pushed a commit that referenced this pull request Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants