-
Notifications
You must be signed in to change notification settings - Fork 41
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
Error checking serverStatus:undefined method `[]' for nil:NilClass #34
Comments
I ran into the same thing with the latest metrics change. |
Can you try the latest version (1.1.0) and see if it fixes this issue. |
I still got this error |
For me this error occurred because I did not supply the proper credentials to authenticate to the mongodb database. (--user, --password options) |
@nnsaln is this still an issue for you? |
@eheydrick I am still seeing the issue with check-mongodb-metrics.rb I am trying to run the simple Check failed to run: undefined method |
@ankitjain2 I notice you are not using embedded ruby from the path, does this bug affect you if you use sensu embedded ruby? |
Can someone confirm that specifying credentials as per: #34 (comment) solves the issue? We should ensure that credentials are not required as last I checked mongodb does not authentication despite this being a good security posture. |
Also I am noticing that the same issue effects multiple checks based on the comments here, we should keep track of which ones are affected and their resolution:
|
@ankitjain2 @nnsaln @andrewawagner can you please confirm that #34 (comment) fixes this for you? I would like to know if its a matter of improving error handling or a bug. |
I had the same issue, however, i added the role "clusterMonitor" to a user I created on the admin database and it workes .... |
interesting, let's minimally document that it needs that permission for the user and can look at better error handling. |
Error checking serverStatus:undefined method
[]' for nil:NilClass ["/etc/sensu/plugins/apps/metrics-mongodb.rb:173:in
gather_replication_metrics'", "/etc/sensu/plugins/apps/metrics-mongodb.rb:140:inrun'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.3.0/lib/sensu-plugin/cli.rb:57:in
block in class:CLI'"]The text was updated successfully, but these errors were encountered: