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

WiP: Alignak specific stuff #681

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
35cb117
Update test configuration
mohierf Dec 16, 2018
1eab371
Manage Alignak arbiter in the main module - get status thread
mohierf Dec 16, 2018
b397a21
Display Alignak parameters - schedulers configuration
mohierf Dec 16, 2018
f4c4115
Alignak MongoDB logs
mohierf Dec 16, 2018
a594e7c
Alignak system menu with the live state and the events log
mohierf Dec 16, 2018
fe47d22
Alignak statistics - first version
mohierf Dec 17, 2018
ddcfa28
Closes #676 - Contacts list with icon
mohierf Dec 13, 2018
eb8ca94
Fix hostgroups filtering behaviour
mohierf Dec 18, 2018
9b0dc47
Revert some of 1435bdb about comment tab
Dec 18, 2018
445c31d
Closes #696 - fix and improve broken parameters view
mohierf Dec 21, 2018
7aeabc9
Helper functions to render notes and actions
mohierf Dec 19, 2018
cfcd48d
Closes #677 - render notes and actions in the element view
mohierf Dec 20, 2018
0ebc860
Closes #677 - render notes and actions in the problems view
mohierf Dec 20, 2018
c8f7c77
Fix a CSS media query for width around 992px
mohierf Jan 2, 2019
c20d924
Revert "Closes #677 - render notes and actions in the problems view"
Jan 2, 2019
a1bf880
Revert "Closes #677 - render notes and actions in the element view"
Jan 2, 2019
80e58c5
Revert "Helper functions to render notes and actions"
Jan 2, 2019
205edf7
Debug notes_url display in cv_hosts
Jan 2, 2019
0a614a6
Closes #677 - render notes and actions in the element view
mohierf Dec 20, 2018
a6081ca
Helper functions to render notes and actions
mohierf Dec 19, 2018
2d197ff
Closes #699 - enhance plain text search engine
mohierf Dec 21, 2018
8aadced
Improve hovering title (Aka) for host name if host has a display_name
mohierf Dec 28, 2018
e1fbefa
Load shinken-action.js only once!
mohierf Dec 30, 2018
fdcd2eb
Improve Alignak parameters view
mohierf Dec 31, 2018
799b25e
Improve host custom view
mohierf Dec 31, 2018
eae5408
Clean element view and update test configuration
mohierf Dec 31, 2018
292e22b
Alert if user and BIs are not consistent (log + user preference message)
mohierf Dec 18, 2018
aedbfda
Manage BI filter in the search query parameter
mohierf Dec 19, 2018
9e1c187
BI cleaning - review comments
mohierf Dec 31, 2018
48c3e0f
Add a duration check criteria: last_check
mohierf Jan 1, 2019
6c4a73e
Clean the anonymous user mode and the currently view
mohierf Jan 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a duration check criteria: last_check
Allows to filter elements on the last check time
mohierf committed Jan 3, 2019
commit 48c3e0f45b67d85205306b2e5317f5270257a5e2
7 changes: 5 additions & 2 deletions module/datamanager.py
Original file line number Diff line number Diff line change
@@ -543,9 +543,12 @@ def search_hosts_and_services(self, search, user, get_impacts=True, sorter=None,
except ValueError:
items = []

if t == 'duration':
if t in ['duration', 'last_check']:
seconds_per_unit = {"s": 1, "m": 60, "h": 3600, "d": 86400, "w": 604800}
times = [(i, time.time() - int(i.last_state_change)) for i in items]
if t == 'duration':
times = [(i, time.time() - int(i.last_state_change)) for i in items]
else:
times = [(i, time.time() - int(i.last_chk)) for i in items]
try:
if s.startswith('>='):
s = int(s[2:-1]) * seconds_per_unit[s[-1].lower()]
3 changes: 2 additions & 1 deletion module/views/modal_helpsearch.tpl
Original file line number Diff line number Diff line change
@@ -62,10 +62,11 @@
<p><strong>Note</strong> that the WebUI has a default configured filter. Hosts and services that do not have a BI greater than or equal this filter will not be dislayed in the UI. Currently, this filter is <code>bi>={{app.problems_business_impact}}</code>.</p>

<h4>Search by duration</h4>
<p>You can also search by the duration of the last state change. This is very useful to find elements that are warning or critical for a long time. For example:</p>
<p>You can also search by the duration of the last state change or by the elapsed time since the last check. This is very useful to find elements that are warning or critical for a long time or that did not get checked since a while. For example:</p>
<ul>
<li><code>isnot:OK duration:>1w</code> Matches hosts and services not OK for at least one week.</li>
<li><code>isnot:OK duration:<1h</code> Matches hosts and services not OK for less than one hour.</li>
<li><code>last_check:>1d</code> Matches hosts and services not checked in the last day.</li>
</ul>
<p>You can use the following time units: s(econds), m(inutes), h(ours), d(ays), w(eeks).</p>