Exception when running sensu client on Windows server 2012 R2

Hi,

I am trying to run a sensu 0.14 client on a Window server 2012 R2 and I got this error

message":“loading config files from directory”,“directory”:“C:\etc\sensu\conf.d”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:“loading config file”,“file”:“C:/etc/sensu/conf.d/client.json”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:“loading config file”,“file”:“C:/etc/sensu/conf.d/config.json”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:“config file applied changes”,“file”:“C:/etc/sensu/conf.d/config.json”,“changes”:{“rabbitmq”:[null,{“host”:“192.168.56.2”,“port”:5671,“vhost”:"/sensu",“user”:“sensu”,“password”:“REDACTED”,“ssl”:{“cert_chain_file”:"/etc/sensu/ssl/cert.pem",“private_key_file”:"/etc/sensu/ssl/key.pem"}}],“redis”:[null,{“host”:“192.168.56.2”,“port”:6379}],“api”:[null,{“host”:“192.168.56.2”,“bind”:“0.0.0.0”,“port”:4567}]}}

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in `set_tls_parms’: wrong number of arguments (6 for 4) (ArgumentError)

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in `start_tls'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:1154:in `upgrade_to_tls_if_necessary'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:571:in `post_init'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:58:in `block in new'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in `instance_eval'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in `new'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:679:in `bind_connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:649:in `connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:445:in `connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp.rb:242:in `connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport/rabbitmq.rb:17:in `connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport.rb:22:in `connect'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/daemon.rb:133:in `setup_transport'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:251:in `start'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:13:in `block in run'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in `call'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in `run_machine'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in `run'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:12:in `run'

from C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/bin/sensu-client:10:in `<top (required)>'

from C:/opt/sensu/embedded/bin/sensu-client:23:in `load'

from C:/opt/sensu/embedded/bin/sensu-client:23:in `<main>

Is there anything wrong with my config file?

config.json

    {

      "rabbitmq": {

        "host": "192.168.56.2",

        "port": 5671,

        "vhost": "/sensu",

        "user": "sensu",

        "password": "password",

        "ssl": {

          "cert_chain_file": "/etc/sensu/ssl/cert.pem",

          "private_key_file": "/etc/sensu/ssl/key.pem"

        }

      },

      "redis": {

        "host": "192.168.56.2",

        "port": 6379

      },

      "api": {

        "host": "192.168.56.2",

        "bind": "0.0.0.0",

        "port": 4567

      }

}

client.json

{

“client”: {

"name": "Windows8",

"address": "localhost",

"subscriptions": [ "all", "test" ]

}

I have used these config files on a linux box and the box can connect to the sensu alright. I have pinged the address 19.2168.56.2 from the windows and there is no issue.

How can I fix this problem?

Thanks, Tony

I believe this is Sensu client fails to start on Windows · Issue #791 · sensu/sensu · GitHub which was
fixed recently. (will be in 0.17
https://github.com/sensu/sensu/commit/0555be1455312a80ff90aa4ec7e120f4a49573be\)

···

On Sun, Feb 22, 2015 at 9:30 PM, Anthony Kong <anthony.hw.kong@gmail.com> wrote:

Hi,

I am trying to run a sensu 0.14 client on a Window server 2012 R2 and I got
this error

message":"loading config files from
directory","directory":"C:\\etc\\sensu\\conf.d"}
{"timestamp":"2015-02-23T16:23:11.845595+1100","level":"warn","message":"loading
config file","file":"C:/etc/sensu/conf.d/client.json"}
{"timestamp":"2015-02-23T16:23:11.845595+1100","level":"warn","message":"loading
config file","file":"C:/etc/sensu/conf.d/config.json"}
{"timestamp":"2015-02-23T16:23:11.845595+1100","level":"warn","message":"config
file applied
changes","file":"C:/etc/sensu/conf.d/config.json","changes":{"rabbitmq":[null,{"host":"192.168.56.2","port":5671,"vhost":"/sensu","user":"sensu","password":"REDACTED","ssl":{"cert_chain_file":"/etc/sensu/ssl/cert.pem","private_key_file":"/etc/sensu/ssl/key.pem"}}],"redis":[null,{"host":"192.168.56.2","port":6379}],"api":[null,{"host":"192.168.56.2","bind":"0.0.0.0","port":4567}]}}
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in
`set_tls_parms': wrong number of arguments (6 for 4) (ArgumentError)
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in
`start_tls'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:1154:in
`upgrade_to_tls_if_necessary'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:571:in
`post_init'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:58:in
`block in new'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in
`instance_eval'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in
`new'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:679:in
`bind_connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:649:in
`connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:445:in
`connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp.rb:242:in
`connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport/rabbitmq.rb:17:in
`connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport.rb:22:in
`connect'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/daemon.rb:133:in
`setup_transport'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:251:in
`start'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:13:in
`block in run'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in
`call'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in
`run_machine'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in
`run'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:12:in
`run'
from
C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/bin/sensu-client:10:in
`<top (required)>'
from C:/opt/sensu/embedded/bin/sensu-client:23:in `load'
from C:/opt/sensu/embedded/bin/sensu-client:23:in `<main>

Is there anything wrong with my config file?

config.json

        {
          "rabbitmq": {
            "host": "192.168.56.2",
            "port": 5671,
            "vhost": "/sensu",
            "user": "sensu",
            "password": "password",
            "ssl": {
              "cert_chain_file": "/etc/sensu/ssl/cert.pem",
              "private_key_file": "/etc/sensu/ssl/key.pem"
            }
          },
          "redis": {
            "host": "192.168.56.2",
            "port": 6379
          },
          "api": {
            "host": "192.168.56.2",
            "bind": "0.0.0.0",
            "port": 4567
          }
}

client.json

{
  "client": {
    "name": "Windows8",
    "address": "localhost",
    "subscriptions": [ "all", "test" ]
  }

I have used these config files on a linux box and the box can connect to the
sensu alright. I have pinged the address 19.2168.56.2 from the windows and
there is no issue.

How can I fix this problem?

Thanks, Tony

Please let me know if the 0.17.0.beta.1 MSI gives you any troubles. A stable build of the MSI will be available, after bug fixes have been confirmed.

Sean.

···

On Feb 23, 2015 7:58 AM, “Kyle Anderson” kyle@xkyle.com wrote:

I believe this is https://github.com/sensu/sensu/issues/791 which was

fixed recently. (will be in 0.17

https://github.com/sensu/sensu/commit/0555be1455312a80ff90aa4ec7e120f4a49573be)

On Sun, Feb 22, 2015 at 9:30 PM, Anthony Kong anthony.hw.kong@gmail.com wrote:

Hi,

I am trying to run a sensu 0.14 client on a Window server 2012 R2 and I got

this error

message":"loading config files from

directory",“directory”:“C:\etc\sensu\conf.d”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:"loading

config file",“file”:“C:/etc/sensu/conf.d/client.json”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:"loading

config file",“file”:“C:/etc/sensu/conf.d/config.json”}

{“timestamp”:“2015-02-23T16:23:11.845595+1100”,“level”:“warn”,“message”:"config

file applied

changes",“file”:“C:/etc/sensu/conf.d/config.json”,“changes”:{“rabbitmq”:[null,{“host”:“192.168.56.2”,“port”:5671,“vhost”:“/sensu”,“user”:“sensu”,“password”:“REDACTED”,“ssl”:{“cert_chain_file”:“/etc/sensu/ssl/cert.pem”,“private_key_file”:“/etc/sensu/ssl/key.pem”}}],“redis”:[null,{“host”:“192.168.56.2”,“port”:6379}],“api”:[null,{“host”:“192.168.56.2”,“bind”:“0.0.0.0”,“port”:4567}]}}

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in

`set_tls_parms’: wrong number of arguments (6 for 4) (ArgumentError)

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:419:in

`start_tls’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:1154:in

`upgrade_to_tls_if_necessary’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:571:in

`post_init’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:58:in

`block in new’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in

`instance_eval’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/em/connection.rb:49:in

`new’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:679:in

`bind_connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:649:in

`connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp/session.rb:445:in

`connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/amqp-1.3.0/lib/amqp.rb:242:in

`connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport/rabbitmq.rb:17:in

`connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-transport-1.0.0/lib/sensu/transport.rb:22:in

`connect’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/daemon.rb:133:in

`setup_transport’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:251:in

`start’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:13:in

`block in run’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in

`call’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in

`run_machine’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-em-2.4.0-x86-mingw32/lib/eventmachine.rb:187:in

`run’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/lib/sensu/client.rb:12:in

`run’

from

C:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-0.14.0/bin/sensu-client:10:in

`<top (required)>’

from C:/opt/sensu/embedded/bin/sensu-client:23:in `load’

from C:/opt/sensu/embedded/bin/sensu-client:23:in `

Is there anything wrong with my config file?

config.json

    {
      "rabbitmq": {
        "host": "192.168.56.2",
        "port": 5671,
        "vhost": "/sensu",
        "user": "sensu",
        "password": "password",
        "ssl": {
          "cert_chain_file": "/etc/sensu/ssl/cert.pem",
          "private_key_file": "/etc/sensu/ssl/key.pem"
        }
      },
      "redis": {
        "host": "192.168.56.2",
        "port": 6379
      },
      "api": {
        "host": "192.168.56.2",
        "bind": "0.0.0.0",
        "port": 4567
      }

}

client.json

{

“client”: {

"name": "Windows8",
"address": "localhost",
"subscriptions": [ "all", "test" ]

}

I have used these config files on a linux box and the box can connect to the

sensu alright. I have pinged the address 19.2168.56.2 from the windows and

there is no issue.

How can I fix this problem?

Thanks, Tony

Do you have a link to download the msi file?

Cheers

Hi Sean,

The new 0.17beta1 sensu services failed too but for other reason

Here is the error message in the sensu-client.err.log

C:\opt\sensu\embedded\bin\ruby: No such file or directory – C:/opt/sensu/embedded/bin/sensu-client (LoadError)

It also does not create any entry in the event viewers (0.14 will lodge something when it failed)

Cheers, Tony