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

win32 telegraf does not work on #2538

Closed
vicochan opened this issue Mar 16, 2017 · 3 comments
Closed

win32 telegraf does not work on #2538

vicochan opened this issue Mar 16, 2017 · 3 comments
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution platform/windows

Comments

@vicochan
Copy link

vicochan commented Mar 16, 2017

Directions

I download the Telegraf source code and recompile the Telegraf for window32 version. When I use the test command(telegraf -config d:\telegraf\telegraf.conf -test ) to run the program, Telegraf throws error:

Bug report

Relevant telegraf.conf:

[global_tags]
[agent]
  interval = "10s"
  round_interval = true
  metric_buffer_limit = 1000
  flush_buffer_when_full = true
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  debug = false
  quiet = false
  logfile = "/Program Files/Telegraf/telegraf.log"
  hostname = ""
[[outputs.influxdb]]
  urls = ["http://192.168.0.1:8086"] # required
  database = "telegraf" # required
  precision = "s"
  timeout = "5s"
  username = "admin"
  password = "admin"

[[inputs.win_perf_counters]]
  [[inputs.win_perf_counters.object]]
    ObjectName = "Processor"
    Instances = ["*"]
    Counters = [
      "% Idle Time",
      "% Interrupt Time",
      "% Privileged Time",
      "% User Time",
      "% Processor Time",
    ]
    Measurement = "chen_cpu"
  [[inputs.win_perf_counters.object]]
    ObjectName = "LogicalDisk"
    Instances = ["*"]
    Counters = [
      "% Idle Time",
      "% Disk Time","% Disk Read Time",
      "% Disk Write Time",
      "% User Time",
      "Current Disk Queue Length",
    ]
    Measurement = "chen_disk"
  [[inputs.win_perf_counters.object]]
    ObjectName = "System"
    Counters = [
      "Context Switches/sec",
      "System Calls/sec",
      "Processor Queue Length",
    ]
    Instances = ["------"]
    Measurement = "win_system"
  [[inputs.win_perf_counters.object]]
    ObjectName = "Memory"
    Counters = [
      "Available Bytes",
      "Cache Faults/sec",
      "Demand Zero Faults/sec",
      "Page Faults/sec",
      "Pages/sec",
      "Transition Faults/sec",
      "Pool Nonpaged Bytes",
      "Pool Paged Bytes",
    ]
   
    Measurement = "win_mem"

System info:

Telegraf vdev-85-g7a5d8578 (git: master 7a5d857
Operating system version : windows2003 sp2 i386

Steps to reproduce:

  1. Download the source code
  2. d:\go\src\github.com\influxdata\telegraf\cmd\telegraf>go build telegraf.go
  3. D:\telegraf>telegraf -config d:\telegraf\telegraf.conf -test

Additional info:

Plugin: inputs.win_perf_counters, Collection 1
> host_cpu,instance=0,objectname=Processor,host=TEST-APP-01 Percent_Privilege
d_Time=0 1489652704000000000

> host_cpu,objectname=Processor,host=TEST-APP-01 Percent_Privileged_Time=0 14
89652704000000000

unexpected fault address 0xc0000bba
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xc0000bba pc=0x467fc9]

goroutine 4 [running]:
runtime.throw(0xe7d828, 0x5)
        C:/Go/src/runtime/panic.go:596 +0x7c fp=0x124c5bb0 sp=0x124c5ba4
runtime.sigpanic()
        C:/Go/src/runtime/signal_windows.go:164 +0xe2 fp=0x124c5bc4 sp=0x124c5bb
0
syscall.UTF16ToString(0xc0000bba, 0x20000000, 0x20000000, 0x13f03c0, 0x126cfdb0)

        C:/Go/src/syscall/syscall_windows.go:49 +0x29 fp=0x124c5be0 sp=0x124c5bc
4
github.com/influxdata/telegraf/plugins/inputs/win_perf_counters.UTF16PtrToString
(0xc0000bba, 0x127e36c0, 0xb)
        d:/go/src/github.com/influxdata/telegraf/plugins/inputs/win_perf_counter
s/pdh.go:418 +0x35 fp=0x124c5bf8 sp=0x124c5be0
github.com/influxdata/telegraf/plugins/inputs/win_perf_counters.(*Win_PerfCounte
rs).Gather(0x1271dcc0, 0x13ebf40, 0x127e40e0, 0x1, 0x1)
        d:/go/src/github.com/influxdata/telegraf/plugins/inputs/win_perf_counter
s/win_perf_counters.go:277 +0x292 fp=0x124c5ca8 sp=0x124c5bf8
github.com/influxdata/telegraf/agent.(*Agent).Test(0x124d3a08, 0x0, 0x0)
        d:/go/src/github.com/influxdata/telegraf/agent/agent.go:205 +0x2c1 fp=0x
124c5d4c sp=0x124c5ca8
main.reloadLoop(0x124a8380, 0x13eecc0, 0x124ac8c0)
        d:/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:236 +0
xc4f fp=0x124c5fd4 sp=0x124c5d4c
main.(*program).run(0x14d5ef4)
        d:/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:300 +0
x69 fp=0x124c5fe8 sp=0x124c5fd4
runtime.goexit()
        C:/Go/src/runtime/asm_386.s:1629 +0x1 fp=0x124c5fec sp=0x124c5fe8
created by main.(*program).Start
        d:/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:295 +0
x51

goroutine 1 [chan receive]:
github.com/kardianos/service.(*windowsService).Run(0x124ac8c0, 0x14d5ef4, 0x1273
a120)
        d:/go/src/github.com/kardianos/service/service_windows.go:273 +0x127
main.main()
        d:/go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:335 +0
x30c

goroutine 18 [syscall]:
os/signal.signal_recv(0x0)
        C:/Go/src/runtime/sigqueue.go:116 +0x14f
os/signal.loop()
        C:/Go/src/os/signal/signal_unix.go:22 +0x1a
created by os/signal.init.1
        C:/Go/src/os/signal/signal_unix.go:28 +0x37

goroutine 22 [select]:
github.com/influxdata/telegraf/agent.(*Agent).Test.func1(0x12720d40, 0x12720d00)

        d:/go/src/github.com/influxdata/telegraf/agent/agent.go:184 +0xa4
created by github.com/influxdata/telegraf/agent.(*Agent).Test
        d:/go/src/github.com/influxdata/telegraf/agent/agent.go:191 +0xc6
@danielnelson danielnelson added bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution platform/windows labels Mar 16, 2017
@PierreF
Copy link
Contributor

PierreF commented Apr 18, 2017

Looks like a duplicate of #2468

@danielnelson
Copy link
Contributor

Closing in favor of #2468

@ronnix
Copy link

ronnix commented Sep 4, 2017

FYI, the default configuration enables win_perf_counter plugins, which works fine on 64-bit Windows, but causes a crash on 32-bit Windows (see #2468).

A workaround is to comment all the [[inputs.win_perf_counters.*]] sections, and to uncomment the following sections:

[[inputs.cpu]]
[[inputs.disk]]
[[inputs.diskio]]
[[inputs.mem]]
[[inputs.swap]]

Maybe changing the default config shipped with the 32-bit build would prevent this bad out-of-the-box experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution platform/windows
Projects
None yet
Development

No branches or pull requests

4 participants