-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Input plugin for Teamspeak 3 servers #3315
Conversation
|
||
func (ts *Teamspeak) Gather(acc telegraf.Accumulator) error { | ||
var err error | ||
client, err := ts3.NewClient(ts.Server) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make the client once and also possibly login once? This might be a good or bad idea depending on how the teamspeak client handles disconnects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I think thats a good idea. It also reduces logging very strongly on the server side. I changed it with my latest commit.
plugins/inputs/teamspeak/README.md
Outdated
## Password for ServerQuery | ||
password = "secret" | ||
## Array of virtual servers | ||
vservers = [1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find anywhere in the Teamspeak docs where virtual servers were referred to as vservers. What do you think about renaming this virtual_servers as well as the related tag?
plugins/inputs/teamspeak/README.md
Outdated
This plugin uses the Teamspeak 3 ServerQuery interface of the Teamspeak server to collect statistics of one or more | ||
virtual servers. If you are querying an external Teamspeak server, make sure to add the host which is running Telegraf | ||
to query_ip_whitelist.txt in the Teamspeak Server directory. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find a good link with more info, but the best I could find is this pdf linked from go-ts3, do you know of any better reference material (preferably html)? If not maybe we can link to the pdf, this will help if someone has additional questions about the meaning of the fields.
http://media.teamspeak.com/ts3_literature/TeamSpeak%203%20Server%20Query%20Manual.pdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugins/inputs/teamspeak/README.md
Outdated
|
||
``` | ||
[[inputs.teamspeak]] | ||
## Server address for Teamspeak 3 ServerQuery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix up the indention on the comments, make sure it matches the SampleConfig, more info about that further down.
Godeps
Outdated
@@ -40,6 +40,7 @@ github.com/kballard/go-shellquote d8ec1a69a250a17bb0e419c386eac1f3711dc142 | |||
github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c | |||
github.com/Microsoft/go-winio ce2922f643c8fd76b46cadc7f404a06282678b34 | |||
github.com/miekg/dns 99f84ae56e75126dd77e5de4fae2ea034a468ca1 | |||
github.com/multiplay/go-ts3 07477f49b8dfa3ada231afc7b7b17617d42afe8e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add to docs/LICENSE_OF_DEPENDENCIES.md
?
plugins/inputs/teamspeak/README.md
Outdated
username = "serverqueryuser" | ||
## Password for ServerQuery | ||
password = "secret" | ||
## Array of virtual servers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify that this is an array of virtual server IDs.
## Password for ServerQuery | ||
# password = "secret" | ||
## Array of virtual servers | ||
# vservers = [1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any values that are required to be changed should be uncommented. If there are reasonable default leave them commented out but then make sure the default is set.
For example, I would leave the default server and vservers commented. I usually set the default values in the init func. Here is an example in the docker input.
For username/password, probably have them uncommented. You can see how this will look with telegraf --usage teamspeak
(also handy for copying into the README).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also run go fmt ./...
, I think this is all we still need.
inputs.Add("teamspeak", func() telegraf.Input { | ||
return &Teamspeak{ | ||
Server: "127.0.0.1:10011", | ||
Virtual_servers: []int{1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this variable to Go style: VirtualServers
?
Looks like we also need to add |
Required for all PRs: