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
New SENSU handling added to "contacts" #199
Conversation
|
||
def sensu_client_socket(msg) | ||
u = UDPSocket.new | ||
u.send(msg + "\n", 0, '127.0.0.1', 3030) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Socket is configurable in sensu client, can this be made configurable here?
Is it better to use 'localhost' rather than '127.0.0.1' so that it is not IPv4 specific?
Guys, Hi. Any news? Regards, Andrei |
Thanks for the submission. Could you add some basic tests for this new contact? |
Eric, Hi. Thanks for that. What do you exactly mean by "tests"? I'll have a look at some other contacts in the meantime. Regards, Andrei |
Here's an example: https://github.com/mojombo/god/blob/master/test/test_prowl.rb |
Thanks, I will have a look. Regards, Andrei |
Eric, Hi. Added. Please have a look. Thanks in advance. Regards, Andrei |
@@ -0,0 +1,12 @@ | |||
#!/usr/bin/env ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #!
line shouldn't be necessary.
Done! Thanks a lot for your inputs, Eric. Regards, Andrei |
:host => host, | ||
:time => time, | ||
} | ||
parcel = { 'name' => eval("\"" + arg(:check_name) + "\""), 'status' => arg(:status_code).nil? ? self.status_code : arg(:status_code), 'output' => data.to_json, 'handler' => arg(:handler).empty? ? self.handler : arg(:handler) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but I didn't notice this eval
before. Can you give me more details as to why this is needed? I'm pretty worried about having eval
s floating around. Is there a way we could do this without an eval?
Agreed, Eric. Code changed and tested. Regards, Andrei |
Thanks! |
New SENSU handling added to "contacts"
Adding a SENSU handling to "contacts".