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

Random checks randomly failing with random errors #63

Open
WilliamDEdwards opened this issue Aug 5, 2018 · 1 comment
Open

Random checks randomly failing with random errors #63

WilliamDEdwards opened this issue Aug 5, 2018 · 1 comment

Comments

@WilliamDEdwards
Copy link

I have setup Sensu on three Windows servers yesterday. Two issues:

check-windows-ram.rb randomly returns: Access is denied.
check-windows-disk.rb randomly returns: Invalid XSL format (or) file name. It does actually return an OK with the disk space usage, but that warning wasn't there yesterday.
check-windows-process.rb randomly returns the errors in this issue: #33

What I gathered from that issue is that the fix is specifying the path to the Ruby executable. So I did:

/opt/sensu/embedded/bin/ruby.exe /opt/sensu/embedded/bin/check-windows-process.rb.bat -p activedirectory

I also tried:

C:\opt\sensu\embedded\bin\ruby.exe C:\opt\sensu\embedded\bin\check-windows-process.rb.bat -p activedirectory

Unfortunately, both return an error:

/opt/sensu/embedded/bin/check-windows-process.rb.bat:1: syntax error, unexpected tCONSTANT, expecting end-of-input
@ECHO OFF

Nothing changed on the servers. The same problems occurred on all three Windows Servers. It's Windows Server 2012.

Strange thing is that Sensu was setup on a Windows Server 2016 two days ago and this issue hasn't come up.

@WilliamDEdwards WilliamDEdwards changed the title Random checks failing Random checks randomly failing with random errors Aug 5, 2018
@csabo
Copy link
Contributor

csabo commented Aug 16, 2018

@WilliamDEdwards Couple of points

  • your file extension is defined as .rb.bat in your check definitions, did you modify the checks?
  • Sensu will convert the binary path, so "/opt/sensu/embedded/bin/ruby" is correct.

Try changing the extension back, and if you modified the code, re-pull from the repository!

Just in case it helps, here is an example check definition for one of my windows ruby checks (puppet)

  sensu::check{ 'cw-web-healthCheck_api-homecare_app':
    command     => '/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/check-homecare-api.rb log',
    handlers    => 'win_handler',
    interval    => 300,
    subscribers => 'homecare_app',
    standalone  => false,
    occurrences => 1,
    notify      => Service['sensu-enterprise'],
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants