Skip to content

Commit

Permalink
Teamspeak input plugin query clients (#8950)
Browse files Browse the repository at this point in the history
* Add query_clients_online to the teamspeak input plugin

* Update readme for teamspeak input plugin following introduction of new query_clients_online field
  • Loading branch information
JoshKeegan authored Mar 16, 2021
1 parent 808b7c1 commit c4a1260
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/inputs/teamspeak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ the [Teamspeak 3 ServerQuery Manual](http://media.teamspeak.com/ts3_literature/T
- packets_received_total
- bytes_sent_total
- bytes_received_total
- query_clients_online

### Tags:

Expand All @@ -41,5 +42,5 @@ the [Teamspeak 3 ServerQuery Manual](http://media.teamspeak.com/ts3_literature/T
### Example output:

```
teamspeak,virtual_server=1,name=LeopoldsServer,host=vm01 bytes_received_total=29638202639i,uptime=13567846i,total_ping=26.89,total_packet_loss=0,packets_sent_total=415821252i,packets_received_total=237069900i,bytes_sent_total=55309568252i,clients_online=11i 1507406561000000000
teamspeak,virtual_server=1,name=LeopoldsServer,host=vm01 bytes_received_total=29638202639i,uptime=13567846i,total_ping=26.89,total_packet_loss=0,packets_sent_total=415821252i,packets_received_total=237069900i,bytes_sent_total=55309568252i,clients_online=11i,query_clients_online=1i 1507406561000000000
```
1 change: 1 addition & 0 deletions plugins/inputs/teamspeak/teamspeak.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (ts *Teamspeak) Gather(acc telegraf.Accumulator) error {
"packets_received_total": sc.PacketsReceivedTotal,
"bytes_sent_total": sc.BytesSentTotal,
"bytes_received_total": sc.BytesReceivedTotal,
"query_clients_online": sm.QueryClientsOnline,
}

acc.AddFields("teamspeak", fields, tags)
Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/teamspeak/teamspeak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestGather(t *testing.T) {
"packets_received_total": uint64(370),
"bytes_sent_total": uint64(28058),
"bytes_received_total": uint64(17468),
"query_clients_online": int(1),
}

acc.AssertContainsFields(t, "teamspeak", fields)
Expand Down

0 comments on commit c4a1260

Please sign in to comment.