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

New SENSU handling added to "contacts" #199

Merged
merged 8 commits into from Jan 30, 2015
Merged

Conversation

chiriaev
Copy link
Contributor

Adding a SENSU handling to "contacts".


def sensu_client_socket(msg)
u = UDPSocket.new
u.send(msg + "\n", 0, '127.0.0.1', 3030)
Copy link

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?

@chiriaev
Copy link
Contributor Author

Guys, Hi. Any news? Regards, Andrei

@eric
Copy link
Collaborator

eric commented Jan 21, 2015

Thanks for the submission. Could you add some basic tests for this new contact?

@chiriaev
Copy link
Contributor Author

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

@eric
Copy link
Collaborator

eric commented Jan 22, 2015

@chiriaev
Copy link
Contributor Author

Thanks, I will have a look. Regards, Andrei

@chiriaev
Copy link
Contributor Author

Eric, Hi. Added. Please have a look. Thanks in advance. Regards, Andrei

@@ -0,0 +1,12 @@
#!/usr/bin/env ruby
Copy link
Collaborator

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.

@eric eric changed the title [ GOD ] : New SENSU handling added to "contacts". New SENSU handling added to "contacts" Jan 28, 2015
@chiriaev
Copy link
Contributor Author

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) }
Copy link
Collaborator

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 evals floating around. Is there a way we could do this without an eval?

@chiriaev
Copy link
Contributor Author

Agreed, Eric. Code changed and tested. Regards, Andrei

@eric
Copy link
Collaborator

eric commented Jan 30, 2015

Thanks!

eric added a commit that referenced this pull request Jan 30, 2015
New SENSU handling added to "contacts"
@eric eric merged commit c491aae into mojombo:master Jan 30, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants