sensu-plugins / sensu-plugins-opsgenie

Sensu plugins for OpsGenie
http://sensu-plugins.io
MIT License
4 stars 24 forks source link

Handler exception #12

Closed dizzythinks closed 8 years ago

dizzythinks commented 8 years ago

I seem to receive this when trying to use this handler.

/opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-opsgenie-1.0.0/bin/handler-    opsgenie.rb:64:in `create_alert': undefined method `[]' for nil:NilClass (NoMethodError)
from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-opsgenie-1.0.0/bin/handler-opsgenie.rb:31:in `block in handle'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:124:in `timeout'
from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-opsgenie-1.0.0/bin/handler-opsgenie.rb:28:in `handle'
from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:in block in `<class:Handler>

The following is from my handlers.json

   "opsgenie": {
       "type": "pipe",
       "command": "/opt/sensu/embedded/bin/handler-opsgenie.rb -j /etc/sensu/conf.d/handlers.json"
    }

"opsgenie": {
    "customerKey": "MYKEY",
    "source": "alert-source",
    "overwrite_quiet_hours": true,
 }

Am using:

 sensu-plugin (1.2.0)
dizzythinks commented 8 years ago

Close this. I;m an idiot. Didnt read the changelog between 0.0.3 and 1.0.0 about json config.