-
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
Minecraft Input Plugin using RCON #2960
Conversation
Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Update Formatting Change main package to minecraft Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Add error handling to ParseUsername for minecraft plugin Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Telegraf plugin is now in a working state Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
…ctly Add client interface and mock client struct for testing purposes, update usages of rcon client to use said interface Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
Signed-off-by: Adam Perlin <adamperlin@seattleacademy.org>
Signed-off-by: Ayrdrie Palmer <ayrdriepalmer@gmail.com>
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 think it will not reconnect in the case of temporary network failure, so we need to check into that.
@@ -0,0 +1,52 @@ | |||
# Minecraft Plugin |
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.
Try to stick closer to the format style in https://github.com/influxdata/telegraf/blob/master/plugins/inputs/EXAMPLE_README.md and make sure you have all the sections.
plugins/inputs/minecraft/README.md
Outdated
``` | ||
enable-rcon=true | ||
rcon.password=<your password> | ||
rcon.port=<1-65535> |
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.
No indent
plugins/inputs/minecraft/README.md
Outdated
This plugin uses the RCON protocol to collect [statistics](http://minecraft.gamepedia.com/Statistics) from a [scoreboard](http://minecraft.gamepedia.com/Scoreboard) on a | ||
Minecraft server. | ||
|
||
To enable [RCON](http://wiki.vg/RCON) on the minecraft server, add this to your server configuration: |
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.
Mention that this is the servers server.properties
file.
plugins/inputs/minecraft/README.md
Outdated
To create a new scoreboard objective called `jump` on a minecraft server tracking the `jump` stat, run this command | ||
in the Minecraft console: | ||
|
||
`/scoreboard objectives add jump stat.jump` |
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.
Remove leading /
plugins/inputs/minecraft/README.md
Outdated
rcon.port=<1-65535> | ||
``` | ||
|
||
To create a new scoreboard objective called `jump` on a minecraft server tracking the `jump` stat, run this command |
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.
tracking the stat.jump
criteria
} | ||
|
||
func init() { | ||
inputs.Add("minecraft", func() telegraf.Input { return &Minecraft{} }) |
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.
Probably want to set config file defaults here.
return err | ||
} | ||
tags := map[string]string{ | ||
"playerName": playerName, |
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.
Change tag to player_name
|
||
- The `minecraft` measurement: | ||
- `server`: the Minecraft RCON server | ||
- `player`: the Minecraft player |
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.
Make sure the name of this tag is correct.
} | ||
tags := map[string]string{ | ||
"playerName": playerName, | ||
"server": s.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.
Probably should include the port s.Server + ":" + s.Port
// maybe become necessary if regex is modified to match more types of | ||
//numbers | ||
if err != nil { | ||
return nil, fmt.Errorf("Failed to parse statistic") |
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.
Use consistent terminology: "failed to parse score", also fix up the spacing on comment above :)
…E specification Fix usage of server commmands with README Update Formatting
…'s RCON go package
All review changes have been addressed! |
@@ -0,0 +1,144 @@ | |||
package minecraft | |||
|
|||
// minecraft.go |
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.
We should remove this comment
## port for RCON | ||
port = "25575" | ||
## password RCON for mincraft server | ||
password = "replace_me" |
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.
This bit does need two space indents so that it looks right in telegraf config
plugins/inputs/minecraft/README.md
Outdated
> minecraft,host=InfluxDatas-MacBook-Air.local,player=notch,server=127.0.0.1:25575 jumps=178i 1498254216000000000 | ||
> minecraft,player=dinnerbone,server=127.0.0.1:25575,host=InfluxDatas-MacBook-Air.local jumps=1821i,cow_kills=1i,😂=7i,lvl=7i,deaths=1i,iron_pickaxe=3260i,total_kills=40i,dalevel=7i 1498254216000000000 | ||
> minecraft,player=jeb,server=127.0.0.1:25575,host=InfluxDatas-MacBook-Air.local total_kills=29i,dalevel=33i,lvl=33i,jumps=263i,😂=33i 1498254216000000000 | ||
``` |
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.
We should use a more realistic set of criteria instead of the current corner case data. Also we can remove the host tag since it is added by the default config file.
Final Comments are now addressed! |
Required for all PRs: