Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[dev.icinga.com #1657] add livesearch to 'show hosts' #661
This issue has been migrated from Redmine: https://dev.icinga.com/issues/1657
Created by mfriedrich on 2011-06-15 21:19:29 +00:00
would be cool for icinga classicui, and can happen with those many proof of concepts we already did. once and for all, this shouldn't happen based on the status.dat (but could be enabled throughout a cfg.cfg option - this might cause problems with heavy ajax polling and diskreads!) but use something like a core api using query filters to get the host list out of memory instead of parsing a file over and over.
2013-09-23 20:23:09 +00:00 by kepi 027b596c61553e46e48b192e537529c4a44b82f2
2013-09-25 19:06:34 +00:00 by ricardo 9ed61e9fed3161a082132e3b51a4aaca501c336e
2013-09-26 11:48:12 +00:00 by ricardo eba45779460295ddccf561d56d81d51220e77d36
2013-09-26 14:24:30 +00:00 by ricardo 79e1aee7878fa40876e07de2f517ffa6c85979bd
2013-09-30 16:47:28 +00:00 by kepi c769d44f34f1cf7a581bef8f6c5c3d00904a0558
2013-10-03 23:49:07 +00:00 by ricardo 5d000896d4bec0d518c32776c06b16083d506584
2013-10-07 11:00:06 +00:00 by kepi 93af651
2013-10-07 11:00:07 +00:00 by ricardo 33246d4
2013-10-07 11:00:07 +00:00 by ricardo e9db519
2013-10-07 11:00:07 +00:00 by ricardo a0e24b2
2013-10-07 11:00:07 +00:00 by kepi 0a4bad0
2013-10-07 11:00:50 +00:00 by ricardo cbdfd2c
2013-10-07 23:52:52 +00:00 by ricardo d1333be
2013-10-18 05:51:45 +00:00 by ricardo 6400160
2013-10-18 05:55:16 +00:00 by ricardo cc6f77e
Updated by ricardo on 2012-08-27 21:10:36 +00:00
Well. Still no code until now. But at least a design draft
Feel free to implement it, you will be my personal hero. And as I assume of every other Icinga user using Classic-UI.
Updated by kepi on 2013-09-22 13:47:41 +00:00
Here is patch against 'next' git branch with live search feature added.
I didn't compile it - test needed. I may miss something as I created this on our server and put to git after that.
Also I never worked with makefiles before so please fix my changes if needed. There is autocomplete.js.in file in html/js directory which uses
Anyway live search working as supposed on our installation so please try and come back with suggestions.
ricardo - cache is not implemented for now. I think it needs to be implemented on API's side to work as supposed.
I tried to use slightly different approach than in draft. As "host / service" is really long. Hosts are simply list as first and then there is group of found services for every host.
Sorry this take so long.
Updated by ricardo on 2013-09-25 19:44:12 +00:00
thanks so much for your patch. It worked instantly.
it lives for now in "feature/add-livesearch-to-menu-1657"
Next steps to do are:
Updated by kepi on 2013-09-25 20:03:54 +00:00
As for JSON output, you will prepare some special CGI or do you count with using more api views for now?
I'm still not sure about polling all data and local search. In fact you will drain much more resources with unnecessary polls - depending on use case. I.e. in my case I'm using search for about 5 % of my icinga uses. Most of time I'm using only TAC view. For me it will mean constant polling of API for no reason.
By the way, I'm using search feature of json API now. Isn't it much faster and "cheaper" to use it this way instead of fetching all server and service data constantly?
Local search can be done without any problem.
Fixing right side problem should be easy too.
Feel free to assign issue to me as long as we will decide about polling feature.
Updated by ricardo on 2013-09-26 14:41:07 +00:00
in current "feature/add-livesearch-to-menu-1657" I added a special request param "livesearchdata". This returns JSON data to use only in live search.
Initially I wanted to avoid that status.cgi gets request with every letter you type in. Because requesting status.cgi in big environments is very expensive.
And as you said, caching the data locally and polling it every x seconds, sucks as well.
How about this:
This way we most likely request status.cgi only once during search and user experience is the same.
Now hostgroups and servicegroups get returned as well. Can we add them to the result list as well?
Updated by kepi on 2013-09-26 14:45:56 +00:00
Can you upload me some json example so I can try? I don't have any icinga test machine now so it will be faster for me this way.
Your suggestion is good. It will be little harder to implement but more nice to servers.
Updated by mfriedrich on 2013-09-27 17:49:13 +00:00
redmine only allows to assign issues to roles with a defined state (i.e. an icinga padawan, or a developer). or the original author of the ticket (i.e. to ask for further input).
as remarked via mail to ricardo, it would be reasonable to get you into the padawan program, but that's ricardo's decision being responsible here.
Updated by kepi on 2013-09-29 19:51:45 +00:00
@dnsmichi: no need for now in this case. I don't have much time for hacking icinga unfortunately :)
@ricardo: patch against feature/add-livesearch-to-menu-1657 is attached.
It simply query server for first term entered (longer than 3 characters as you changed) and cache this result. When new term is entered, first 3 characters are compared to cache and if match is found, search is done locally.
I also set expire for cache to 90 seconds (you can easily change value to whatever suits you best on line 9).
Hostgroups and servergroups are included as well.
I also found that you made some typo in url (in part prepare hosts data). There was status.cgi instead of extinfo, so I corrected thas to correct value. At least I suppose whole purpose of this search is to jump quickly to host detail.
Width of query window is now smaller so it don't overlap.
As before, I test it only locally so please test.
Updated by ricardo on 2013-10-02 00:53:05 +00:00
Thank you so much Kepi. This is getting very close to what I imagined.
submitted an update to "feature/add-livesearch-to-menu-1657"
do you like the changes? Any more ideas/suggestions?
@dnsmichi: could this still make it into 1.10?
@everybody: TEST IT and tell me what you think.
Updated by kepi on 2013-10-02 08:01:49 +00:00
I agree that in most cases you want to know how services are doing but you can see it directly in live search. This is why I supposed it is better to go to detail directly. Anyway now I'm in doubt and you are probably right :) so keep it the way you change it.
Looking forward to see this on our servers :)
Updated by mfriedrich on 2013-10-02 23:34:00 +00:00
other than that, it's pretty fast :)
Updated by elagon on 2013-10-03 08:56:25 +00:00
I think colors reflects statuses :)
Updated by ricardo on 2013-10-03 11:34:44 +00:00
it's the status of the object (OK/DOWN/CRITICAL/...) with the color schema of tac header
The shadow is irritating? I thought it is better to distinguish it from the rest of the menu behind it. Didn't want to make it bold or italic to prevent a line break if it's not necessary.
Yup, no problem.
will arrow down work for you? Otherwise you have to click somewhere else in menu to lose focus on the search box and to make the results disappear.
Updated by ricardo on 2013-10-04 00:24:15 +00:00
in current "feature/add-livesearch-to-menu-1657"
how about this?
Updated by mfriedrich on 2013-10-04 14:51:48 +00:00
ah ok, my bad. i'm not really bringing the color into relation with a status, but that's obviously just my "i click on the total problems url in tac header only" behaviour.
not sure about that. the borders of the result dropdown could be made more emphasized, because you're right, the background contrast is awful with that mix of black/white/grey colors.
mouse event is perfectly fine like it behaves now:
i'd say this is pretty awesome for now :)
Updated by kepi on 2013-10-04 18:58:16 +00:00
I think maybe this could look more clean if you set white background and add something like color border to left side instead of full color background, something like this (only quick mockup):
Updated by mfriedrich on 2013-10-04 20:16:46 +00:00
+1 for the removed background colors and only adding them on the left side. looks much more clean and focused.
not sure about the header sections though - maybe that's too much the same of the original layout and may confuse users in their way of clicking or looking for information.
Updated by ricardo on 2013-10-05 09:39:16 +00:00
no, only new files which are by default included in the jquery-ui package
I really like Kepis approach. looks much more eye friendly.
Unfortunately I don't have time to add this the next few days. Damn.
Updated by mfriedrich on 2013-10-06 12:48:51 +00:00
since you're really wanting it in 1.10 you still got time for beautification (i guess that's how it's called) til beta time in ~1,5 weeks. feature freeze is only meant to take a cut and do not add any additional features, while working on the rest towards the final release - which i guess will be the case here, working on it.
so please merge the feature branch into next, and then we'll see about some changes in layout and style.
Updated by ricardo on 2013-10-15 20:00:28 +00:00