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

Added rudimentary json_info command #23

Closed
wants to merge 1 commit into from
Closed

Added rudimentary json_info command #23

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 26, 2013

Hi kostya,

This is a simple, probably bad json_info command added to the eye CLI. I wanted to be able to feed eye status to other monitoring systems, and JSON is a great cross-language machine-readable format.

json_info currently simply outputs the response from the eye server as ran through JSON.generate. I'm sure it can be prettified, but I have just started playing with it and wanted to get the ball rolling quickly. As I continue to work on this I may add refined output and specs for this.

What do you think? Do you want to change the command name?

Thanks,

Milan Iliev

@kostya
Copy link
Owner

kostya commented Dec 26, 2013

Hi, thanks.
I prefer option eye info -j for example to render json. (or maybe by env variable)
Also, require 'json' better doing in method, for faster cli.
Also, if you want to control by http, there is already gem reel-eye in branch reel, which returns jsons.

@hamann
Copy link
Contributor

hamann commented Dec 29, 2013

What's reel-eye? Is it documented?

@kostya
Copy link
Owner

kostya commented Dec 29, 2013

you can read diff master...reel
reel-eye is the same eye with configurable http server which enabled by:

Eye.config do
  http :enable => true, :host => "127.0.0.1", :port => 12345
end

I am not including in default gem because many additional dependencies.

@ghost
Copy link
Author

ghost commented Dec 29, 2013

Kostya,

Thanks for the well-considered response. You are right, of course; my patch
was built as an quick-and-ugly hack and I did not know about reel-eye.

I did figure out the config from the diff. How do you use the API though?

Going to / shows me the home screen with the version OK.

But what URL do I need to hit to see info or issue commands?

It seems I need /api/info, but that just returns a 404. So does /info.

That am I doing wrong?

Thank you so much for eye!

Milan

On Sun, Dec 29, 2013 at 6:47 AM, kostya [email protected] wrote:

you can read diff master...reelhttps://github.com/kostya/eye/compare/master...reel
reel-eye is the same eye with configurable http server which enabled by:

Eye.config do
http :enable => true, :host => "127.0.0.1", :port => 12345end

I am not including in default gem because many additional dependencies.


Reply to this email directly or view it on GitHubhttps://github.com//pull/23#issuecomment-31315658
.

@kostya
Copy link
Owner

kostya commented Dec 29, 2013

i am not using reel-eye in prod, this was a proof of concept.

this is works for me:
curl 'https://localhost:12345/api/info?filter=all'

curl -X PUT 'https://localhost:12345/api/restart?filter=all'

@kostya
Copy link
Owner

kostya commented Jan 18, 2014

is reel-eye enought? closing this.

@kostya kostya closed this Jan 18, 2014
@kostya
Copy link
Owner

kostya commented May 12, 2014

from 0.6.rc, i cut reel-eye into gem: https://github.com/kostya/eye-http
reel-eye not going to be supported

@ghost
Copy link
Author

ghost commented May 12, 2014

Thanks! Your patch worked perfectly, by the way, we've been using reel-eye

On Monday, May 12, 2014, kostya [email protected] wrote:

from 0.6.rc cut reel-eye into gem https://github.com/kostya/eye-http
there is no more reel-eye


Reply to this email directly or view it on GitHubhttps://github.com//pull/23#issuecomment-42899710
.

@kostya
Copy link
Owner

kostya commented May 13, 2014

it should be easy to switch to eye-http, because it almost the same as reel-eye.
reel-eye was a hack.

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.

2 participants