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

sensu::checks failing when subscribers are specified #381

Closed
devopsprosiva opened this issue Jul 8, 2015 · 6 comments
Closed

sensu::checks failing when subscribers are specified #381

devopsprosiva opened this issue Jul 8, 2015 · 6 comments

Comments

@devopsprosiva
Copy link

Hi,

I've the following code in hiera to define a check.

sensu::checks:
'check_cpu':
command: '/etc/sensu/plugins/check-cpu.rb -w 75 -c 90'
handlers: 'mail'
subscribers: 'all'

After I added the subscribers parameter, the puppet agent run is failing with this error.

Error: undefined method sort' for nil:NilClass Error: /Stage[main]/Sensu/Sensu::Check[check_cpu]/Sensu_check[check_cpu]/subscribers: change from to all failed: undefined methodsort' for nil:NilClass

Thanks,
Siva

@poolski
Copy link
Contributor

poolski commented Jul 15, 2015

I think it's to do with the fact that the module expects an array for both subscribers and handlers, even if it's just one item.

Check out my JSON structure in #382, make handlers and subscribers into arrays and try again?

@devopsprosiva
Copy link
Author

@poolski I'm still getting this error.

Error: undefined method `sort' for nil:NilClass
Error: /Stage[main]/Sensu/Sensu::Check[check_http_wiki]/Sensu_check[check_http_wiki]/subscribers: change from  to all failed: undefined method `sort' for nil:NilClass
  • This is my yaml file with arrays for handlers and subscribers.
sensu::checks:
  'check_http_wiki':
    command: '/etc/sensu/plugins/check-http.rb -u http://localhost -s -k -r'
    handlers:
      - 'mail'
    subscribers:
      - 'all'

@poolski
Copy link
Contributor

poolski commented Jul 15, 2015

It may be that the "all" keyword is reserved, or something? I don't really know the ins and outs of this module so I'm just throwing ideas out there to see what sticks!

I don't use "subscribers" at all where the check is common to all devices.

@jlambert121
Copy link
Contributor

@devopsprosiva I believe this was fixed with #376. What version of the module are you using?

@devopsprosiva
Copy link
Author

@jlambert121 I was using an older version. Pulled the latest code now and testing. Thanks for the help.

@jlambert121
Copy link
Contributor

Awesome!

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

3 participants