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

processors.topk plugin does not work with Windows #5154

Closed
StefanSa opened this issue Dec 18, 2018 · 4 comments
Closed

processors.topk plugin does not work with Windows #5154

StefanSa opened this issue Dec 18, 2018 · 4 comments
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) discussion Topics for discussion

Comments

@StefanSa
Copy link

StefanSa commented Dec 18, 2018

Relevant telegraf.conf:

[[inputs.win_perf_counters.object]]
# Process metrics
ObjectName = "Process"
Counters = [
"% Processor Time",
"Handle Count",
"Private Bytes",
"Thread Count",
"Virtual Bytes",
"Working Set"
]
Instances = ["*"]
Measurement = "win_proc"

[[processors.topk]]
namepass = ["*win_proc*"]
k = 5
fields = [
"% Processor Time",
"Handle Count",
"Private Bytes",
"Thread Count",
"Virtual Bytes",
"Working Set"
]

System info:

Telegraf Version = 1.9
OS = Windows 2016 Server (localisation DE)

[Include Telegraf version, operating system name, and other relevant details]

Steps to reproduce:

  1. ...
  2. ...

Expected behavior:

Values from processors.topk plugin

Actual behavior:

No values are generated, however the following error message appears in the logfile of telegraf.

2018-12-18T10:48:00Z I! Loaded inputs: inputs.win_perf_counters
2018-12-18T10:48:00Z I! Loaded aggregators:
2018-12-18T10:48:00Z I! Loaded processors: topk
2018-12-18T10:48:00Z I! Loaded outputs: influxdb
2018-12-18T10:48:00Z I! Tags enabled: host=TEST hostgroup=IT role=TEST
2018-12-18T10:48:00Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"TEST", Flush Interval:10s
2018-12-18T10:48:00Z D! [agent] Connecting outputs
2018-12-18T10:48:00Z D! [agent] Attempting connection to output: influxdb
2018-12-18T10:48:00Z D! [agent] Successfully connected to output: influxdb
2018-12-18T10:48:00Z D! [agent] Starting service inputs
2018-12-18T10:51:00Z D! [outputs.influxdb] wrote batch of 17 metrics in 2.9901ms
2018-12-18T10:51:00Z D! [outputs.influxdb] buffer fullness: 0 / 1000 metrics.
2018-12-18T10:51:10Z D! [outputs.influxdb] wrote batch of 17 metrics in 2.0821ms
2018-12-18T10:51:10Z D! [outputs.influxdb] buffer fullness: 0 / 1000 metrics.
2018-12-18T10:51:20Z D! [outputs.influxdb] wrote batch of 17 metrics in 2.9955ms
2018-12-18T10:51:20Z D! [outputs.influxdb] buffer fullness: 0 / 1000 metrics.
2018-12-18T10:51:30Z D! [outputs.influxdb] wrote batch of 17 metrics in 23.0037ms
2018-12-18T10:51:30Z D! [outputs.influxdb] buffer fullness: 0 / 1000 metrics.

When i comment out the "topk" plugin, values are sent from win_proc.

@danielnelson
Copy link
Contributor

I think the field names might be wrong, can you run telegraf.exe --input-filter win_perf_counters --test and add the output?

@danielnelson danielnelson added the discussion Topics for discussion label Dec 18, 2018
@StefanSa
Copy link
Author

@danielnelson
Hi Daniel,
I did not insert all measuring here, otherwise it will be too many.

win_mem,host=SFG24,hostgroup=IT,objectname=Memory,role=Mailserver Available_Bytes=4380372992,Cache_Faults_persec=14.853553771972656,Demand_Zero_Faults_persec=176.2621612548828,Free_&_Zero_Page_List_Bytes=97824768,Modified_Page_List_Bytes=67784704,Page_Faults_persec=192.10595703125,Pages_persec=0,Pool_Nonpaged_Bytes=432881664,Pool_Paged_Bytes=364802048,Standby_Cache_Core_Bytes=0,Standby_Cache_Normal_Priority_Bytes=4263161856,Standby_Cache_Reserve_Bytes=19386368,Transition_Faults_persec=16.834026336669922 1545206881000000000
win_net,host=SFG24,hostgroup=IT,instance=isatap.{95B31B47-DBEB-47B2-9240-97CD128C9A62},objectname=Network\ Interface,role=Mailserver Bytes_Received_persec=0,Bytes_Sent_persec=0,Packets_Outbound_Discarded=0,Packets_Outbound_Errors=0,Packets_Received_Discarded=0,Packets_Received_Errors=0,Packets_Received_persec=0,Packets_Sent_persec=0 1545206881000000000
win_proc,host=SFG24,hostgroup=IT,instance=CcmExec,objectname=Process,role=Mailserver Handle_Count=1239,Percent_Processor_Time=0,Private_Bytes=154288128,Thread_Count=21,Virtual_Bytes=445509632,Working_Set=194465792 1545206881000000000
win_proc,host=SFG24,hostgroup=IT,instance=agentmonitor,objectname=Process,role=Mailserver Handle_Count=694,Percent_Processor_Time=0,Private_Bytes=1744896,Thread_Count=3,Virtual_Bytes=29663232,Working_Set=5136384 1545206881000000000
win_proc,host=SFG24,hostgroup=IT,instance=SMSvcHost,objectname=Process,role=Mailserver Handle_Count=457,Percent_Processor_Time=0,Private_Bytes=30461952,Thread_Count=5,Virtual_Bytes=590168064,Working_Set=33370112 1545206881000000000

win_proc,host=SFG24,hostgroup=IT,instance=SMSvcHost,objectname=Process,role=Mailserver
Handle_Count=457,
Percent_Processor_Time=0,
Private_Bytes=30461952,
Thread_Count=5,
Virtual_Bytes=590168064,
Working_Set=33370112
1545206881000000000

At first look, i do not see any error regarding win_proc and wrong field

@StefanSa
Copy link
Author

@danielnelson
Daniel, have found a solution. Also for UseWildcardsExpansion = true and localization problem (all metrics in native OS language).

[[inputs.win_perf_counters]]
UseWildcardsExpansion=true

[[inputs.win_perf_counters.object]]
# Process metrics
ObjectName = "Process"
Counters = [
"% Processor Time",
"Handle Count",
"Private Bytes",
"Thread Count",
"Virtual Bytes",
"Working Set"
]
Instances = ["*"]
Measurement = "win_proc"
[inputs.win_perf_counters.tagdrop]
instance = ["Idle"]

##rewrite german metrics field name to english:

[[processors.rename]]
[[processors.rename.replace]]
field = "Benutzerzeit_(Percent)"
dest = "Percent_User_Time"

[[processors.rename.replace]]
field = "DCP-Zeit_(Percent)"
dest = "Percent_DPC_Time"

[[processors.rename.replace]]
field = "Interruptzeit_(Percent)"
dest = "Percent_Interrupt_Time"

[[processors.rename.replace]]
field = "Privilegierte_Zeit_(Percent)"
dest = "Percent_Privileged_Time"

[[processors.rename.replace]]
field = "Prozessorzeit_(Percent)"
dest = "Percent_Processor_Time"

[[processors.rename.replace]]
field = "Aktuelle_Warteschlangenlänge"
dest = "Current_Disk_Queue_Length"

[[processors.rename.replace]]
field = "Bytes_gelesen/s"
dest = "Disk_Read_Bytes_persec"

[[processors.rename.replace]]
field = "Bytes_geschrieben/s"
dest = "Disk_Write_Bytes_persec"

[[processors.rename.replace]]
field = "Freier_Speicherplatz_(Percent)"
dest = "Percent_Free_Space"

[[processors.rename.replace]]
field = "Leerlaufzeit_(Percent)"
dest = "Percent_Idle_Time"

[[processors.rename.replace]]
field = "Lesezeit_(Percent)"
dest = "Percent_Disk_Read_Time"

[[processors.rename.replace]]
field = "MB_frei"
dest = "Free_Megabytes"

[[processors.rename.replace]]
field = "Schreibzeit_(Percent)"
dest = "Percent_Disk_Write_Time"

[[processors.rename.replace]]
field = "Teil-E/A/s"
dest = "Split_IO_persec"

[[processors.rename.replace]]
field = "Zeit_(Percent)"
dest = "Percent_Disk_Time"

[[processors.rename.replace]]
field = "Auslagerungsseiten_(Bytes)"
dest = "Pool_Paged_Bytes"

[[processors.rename.replace]]
field = "Cachefehler/s"
dest = "Cache_Faults_persec"

[[processors.rename.replace]]
field = "Freie_und_Nullseitenlisten_-Bytes"
dest = "Free
&_Zero_Page_List_Bytes"

[[processors.rename.replace]]
field = "Geänderte_Seitenliste_-_Bytes"
dest = "Modified_Page_List_Bytes"

[[processors.rename.replace]]
field = "Nicht-Auslagerungsseiten_(Bytes)"
dest = "Pool_Nonpaged_Bytes"

[[processors.rename.replace]]
field = "Nullforderungsfehler/s"
dest = "Demand_Zero_Faults_persec"

[[processors.rename.replace]]
field = "Seiten/s"
dest = "Pages_persec"

[[processors.rename.replace]]
field = "Seitenfehler/s"
dest = "Page_Faults_persec"

[[processors.rename.replace]]
field = "Standbycache-Kernbytes"
dest = "Standby_Cache_Core_Bytes"

[[processors.rename.replace]]
field = "Standbycache-_Bytes_mit_normaler_Priorität"
dest = "Standby_Cache_Normal_Priority_Bytes"

[[processors.rename.replace]]
field = "Standbycache-Reservebytes"
dest = "Standby_Cache_Reserve_Bytes"

[[processors.rename.replace]]
field = "Verfügbare_Bytes"
dest = "Available_Bytes"

[[processors.rename.replace]]
field = "Wechselfehler/s"
dest = "Transition_Faults_persec"

[[processors.rename.replace]]
field = "Ausgehende_Pakete,_Fehler"
dest = "Packets_Outbound_Errors"

[[processors.rename.replace]]
field = "Ausgehende_Pakete,_verworfen"
dest = "Packets_Outbound_Discarded"

[[processors.rename.replace]]
field = "Bytes_gesendet/s"
dest = "Bytes_Sent_persec"

[[processors.rename.replace]]
field = "Empfangene_Bytes/s"
dest = "Bytes_Received_persec"

[[processors.rename.replace]]
field = "Empfangene_Pakete,_Fehler"
dest = "Packets_Received_Errors"

[[processors.rename.replace]]
field = "Empfangene_Pakete,_verworfen"
dest = "Packets_Received_Discarded"

[[processors.rename.replace]]
field = "Empfangene_Pakete/s"
dest = "Packets_Received_persec"

[[processors.rename.replace]]
field = "Pakete_gesendet/s"
dest = "Packets_Sent_persec"

[[processors.rename.replace]]
field = "Belegung_(Percent)"
dest = "Percent_Usage"

[[processors.rename.replace]]
field = "Kontextwechsel/s"
dest = "Context_Switches_persec"

[[processors.rename.replace]]
field = "Prozesse"
dest = "Processes"

[[processors.rename.replace]]
field = "Prozessor-Warteschlangenlänge"
dest = "Processor_Queue_Length"

[[processors.rename.replace]]
field = "Systemaufrufe/s"
dest = "System_Calls_persec"

[[processors.rename.replace]]
field = "Systembetriebszeit"
dest = "System_Up_Time"

[[processors.rename.replace]]
field = "Arbeitsseiten"
dest = "Working_Set"

[[processors.rename.replace]]
field = "Handleanzahl"
dest = "Handle_Count"

[[processors.rename.replace]]
field = "Threadanzahl"
dest = "Thread_Count"

[[processors.rename.replace]]
field = "Virtuelle_Größe"
dest = "Virtual_Bytes"

##topk plugin
[[processors.topk]]
namepass = ["*win_proc*"]
k = 5
fields = [
"Percent_Processor_Time",
"Handle_Count",
"Private_Bytes",
"Thread_Count",
"Virtual_Bytes",
"Working_Set"
]

@danielnelson danielnelson added the area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) label Dec 19, 2018
@danielnelson
Copy link
Contributor

Glad you have it working, it would be nice if we had a less labor intense way of translating but this will have to do for now. I'm going to close this issue, you may be interested in #4906 concerning unwanted localization on this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) discussion Topics for discussion
Projects
None yet
Development

No branches or pull requests

2 participants