From 7e396fdf3f612b40ffc1cf10ee04b2b224ef2e35 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 9 Oct 2013 11:48:42 +0200 Subject: [PATCH] Implement hosts view refs #4824 --- doc/Icinga-Design/documentation.html | 1 + .../controllers/ListController.php | 4 +- .../views/scripts/list/hosts.phtml | 54 +++++---- .../Backend/Ido/Query/HoststatusQuery.php | 2 + .../library/Monitoring/Object/Host.php | 4 +- .../Monitoring/View/HoststatusView.php | 2 + public/css/icons.css | 104 ++++++++++++++++++ public/css/main.css | 6 +- public/img/images/acknowledgement.png | Bin 0 -> 501 bytes public/img/images/comment.png | Bin 0 -> 491 bytes public/img/images/create.png | Bin 0 -> 475 bytes public/img/images/dashboard.png | Bin 0 -> 415 bytes public/img/images/disabled.png | Bin 0 -> 535 bytes public/img/images/edit.png | Bin 0 -> 486 bytes public/img/images/error.png | Bin 0 -> 532 bytes public/img/images/flapping.png | Bin 0 -> 621 bytes public/img/images/in_downtime.png | Bin 0 -> 490 bytes public/img/images/remove.png | Bin 0 -> 661 bytes public/img/images/save.png | Bin 0 -> 506 bytes public/img/images/service.png | Bin 0 -> 496 bytes public/img/images/submit.png | Bin 0 -> 418 bytes public/img/images/unhandled.png | Bin 0 -> 553 bytes public/img/images/user.png | Bin 0 -> 487 bytes 23 files changed, 144 insertions(+), 33 deletions(-) create mode 100644 public/css/icons.css create mode 100644 public/img/images/acknowledgement.png create mode 100644 public/img/images/comment.png create mode 100644 public/img/images/create.png create mode 100644 public/img/images/dashboard.png create mode 100644 public/img/images/disabled.png create mode 100644 public/img/images/edit.png create mode 100644 public/img/images/error.png create mode 100644 public/img/images/flapping.png create mode 100644 public/img/images/in_downtime.png create mode 100644 public/img/images/remove.png create mode 100644 public/img/images/save.png create mode 100644 public/img/images/service.png create mode 100644 public/img/images/submit.png create mode 100644 public/img/images/unhandled.png create mode 100644 public/img/images/user.png diff --git a/doc/Icinga-Design/documentation.html b/doc/Icinga-Design/documentation.html index fc9cd9897..3e2ff269a 100644 --- a/doc/Icinga-Design/documentation.html +++ b/doc/Icinga-Design/documentation.html @@ -113,6 +113,7 @@
+ Up
Since  30.09. diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index bbea98652..b6f5fc0a5 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -116,7 +116,9 @@ class Monitoring_ListController extends MonitoringController 'host_notes_url', 'host_last_comment', 'host_active_checks_enabled', - 'host_passive_checks_enabled' + 'host_passive_checks_enabled', + 'host_current_check_attempt', + 'host_max_check_attempts' ) )->getQuery(); $this->view->hosts = $query->paginate(); diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 2374e72d1..f795aa7a6 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -15,37 +15,42 @@ $viewHelper = $this->getHelper('MonitoringState'); Status Host - Output + util()->getHostStateName($host->host_state)); ?> href('monitoring/show/host', array('host' => $host->host_name)); ?> activeRowHref === $hostLink) ? 'class="active"' : ''; ?> > - + + + + + host_handled && $host->host_state > 0): ?> - {{UNHANDLED_ICON}} + host_acknowledged && !$host->host_in_downtime): ?> - {{ACKNOWLEDGED_ICON}} + host_is_flapping): ?> - {{FLAPPING_ICON}} + @@ -57,7 +62,7 @@ $viewHelper = $this->getHelper('MonitoringState'); host_in_downtime): ?> - {{IN_DOWNTIME_ICON}} + @@ -68,43 +73,38 @@ $viewHelper = $this->getHelper('MonitoringState'); - {{ACTIVE_CHECKS_DISABLED_ICON}} + host_last_comment !== null): ?> - {{COMMENT_ICON}} + +
- host_state_type == 0): ?> - - {{SOFTSTATE_ICON}} - - - monitoringState($host, 'host')); ?> - Since  - timeSince($host->host_last_state_change); ?> -
- - - - host_unhandled_service_count): ?> - + host_unhandled_service_count): ?> + host_unhandled_service_count; ?> - + + monitoringState($host, 'host')); ?>
Since + timeSince($host->host_last_state_change); ?> (host_current_check_attempt; ?>/host_max_check_attempts; ?>) +
+ + + + - host_name ?>
- host_address ?> + host_name ?> (host_address ?>)
host_action_url)): ?> @@ -113,10 +113,8 @@ $viewHelper = $this->getHelper('MonitoringState'); host_notes_url)): ?> Notes - - - escape(substr(strip_tags($host->host_output), 0, 10000)); ?> +
escape(substr(strip_tags($host->host_output), 0, 10000)); ?> diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index 9c4c700ac..8738f3e3d 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -41,6 +41,8 @@ class HoststatusQuery extends AbstractQuery 'host_last_time_up' => 'hs.last_time_up', 'host_last_time_down' => 'hs.last_time_down', 'host_last_time_unreachable' => 'hs.last_time_unreachable', + 'host_current_check_attempt' => 'hs.current_check_attempt', + 'host_max_check_attempts' => 'hs.max_check_attempts', 'host_severity' => 'CASE WHEN hs.current_state = 0 THEN diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index 59f32cf32..4b1c275b1 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -59,8 +59,8 @@ class Host extends AbstractObject 'event_handler_enabled' => 'host_event_handler_enabled', 'flap_detection_enabled' => 'host_flap_detection_enabled', 'active_checks_enabled' => 'host_active_checks_enabled', - 'current_check_attempt' => 'host_current_check_attempt', - 'max_check_attempts' => 'host_max_check_attempts', + 'current_check_attempt' => 'host_current_check_attempt', + 'max_check_attempts' => 'host_max_check_attempts' 'last_notification' => 'host_last_notification', 'current_notification_number' => 'host_current_notification_number', 'percent_state_change' => 'host_percent_state_change', diff --git a/modules/monitoring/library/Monitoring/View/HoststatusView.php b/modules/monitoring/library/Monitoring/View/HoststatusView.php index b2c0aa1e6..ae499b455 100644 --- a/modules/monitoring/library/Monitoring/View/HoststatusView.php +++ b/modules/monitoring/library/Monitoring/View/HoststatusView.php @@ -37,6 +37,8 @@ class HoststatusView extends AbstractView 'host_last_time_up', 'host_last_time_down', 'host_last_time_unreachable', + 'host_current_check_attempt', + 'host_max_check_attempts', // Services 'services_cnt', diff --git a/public/css/icons.css b/public/css/icons.css new file mode 100644 index 000000000..f5508b888 --- /dev/null +++ b/public/css/icons.css @@ -0,0 +1,104 @@ + +.icinga-icon-acknowledgement { + background: transparent url("../img/images/acknowledgement.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-comment { + background: transparent url("../img/images/comment.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-create { + background: transparent url("../img/images/create.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-dashboard { + background: transparent url("../img/images/dashboard.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-disabled { + background: transparent url("../img/images/disabled.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} +.icinga-icon-edit { + background: transparent url("../img/images/edit.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-error { + background: transparent url("../img/images/error.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-flapping { + background: transparent url("../img/images/flapping.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-in-downtime { + background: transparent url("../img/images/in_downtime.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-remove { + background: transparent url("../img/images/remove.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-save { + background: transparent url("../img/images/save.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-service { + background: transparent url("../img/images/service.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-submit { + background: transparent url("../img/images/submit.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-unhandled { + background: transparent url("../img/images/unhandled.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-user { + background: transparent url("../img/images/user.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} diff --git a/public/css/main.css b/public/css/main.css index fe8017166..2c1c64bd1 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -1,3 +1,5 @@ +@import url("icons.css"); + body { padding-top: 70px; } .load-indicator .mask { @@ -298,7 +300,7 @@ select.input-sm { } .tacheader-status-ok { - background-color: #00CC33; + /* background-color: #00CC33; */ } .tacheader-status-warning { @@ -320,7 +322,7 @@ select.input-sm { } .tacheader-status-up { - background-color: #00CC33; + /* background-color: #00CC33; */ } diff --git a/public/img/images/acknowledgement.png b/public/img/images/acknowledgement.png new file mode 100644 index 0000000000000000000000000000000000000000..eb03d2db9fd1aa0a8b86c45d4fd31cbbda8e12fe GIT binary patch literal 501 zcmVT(!FYwK@`UE-y1AVA>fLztJuQ?pK#uz0aPA zel?;WNA$Oc_b8(O7SW$-t?628N{My6!v}0+)@kQ8e8Pjwx>HI##}%BY3J zuawxuMO>JNagYJLMK={0gm!TW=Q8V$ML%?~NTozK*q-1Pp5Q9hGwXN}Jk0=P)`sgC r<15y1_FwQH4rXk_Hl8h-dA@!DHO8Q#1R#?V00000NkvXXu0mjfW){$H literal 0 HcmV?d00001 diff --git a/public/img/images/comment.png b/public/img/images/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..b7d88a0ace463d9d9df4fc6c1ecf8ae4fba7fd05 GIT binary patch literal 491 zcmVL(oc)dQ4|O8&u^L%i`hw7iF@u=DT_gonzEf_H(tY#vQvuPY@}x46)3V$ zY$*#HCU(wkWNBk#V?nwWeovm6H1ja0?&93;_n!0pGxXl=rRMg8#{6_sYaGBb&ZA-h z1HK~h5>GP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aUOre7EI?)47-CcKWi-*QF;k}f8%dHH}Ct0l`cDPo__yW>zvz^ z#XEJM%(?b4k*}`fw1s$J--G#LVh`AP=l5&0$L=#Zkj-m9yLtPDo5wfU9H{2aKd)JB zyr@Px%x2}*Qvfc literal 0 HcmV?d00001 diff --git a/public/img/images/error.png b/public/img/images/error.png new file mode 100644 index 0000000000000000000000000000000000000000..62458999f89ed83086512a3a09d7dfbc92b30de8 GIT binary patch literal 532 zcmV+v0_**WP)L(lKk)K@bJ--#@tnK}akttOUW^=`F-Yw6L;J3me5+1wl|zR1hMlRs0xQ z*?4FmjfIv0tAOrWDWngH7K*SIw}DG?ITQyL-n@M?`(~N0*6M#^X4+*$dK!@yr)j#q z97LoOc#94faxU*D>3UO|KgUf}EaLbi(ZmrV(penB3%ta^h;;6+8{iop=Un7m;7Q|l zN3C_+NojC7rNL^$ODPSO8vc~h;L1+@HU|-D77KXTs8cxI@O>;a&7LD%#YWC$7?Jwe zz-C11=UiUn2d+SJ1`TGj^HA0 zjDJqf%RpH`;whEBw9X`^R|rX|&$`9uD9b&iJ>e`1%K( WnT^lgNzbML00005)6a{~K^O<{*Y|71+NF@#^1J=cC|hz;e(aW%)RqeeHf`;;YX5*eh@2d@ zjfexq!9j9yuu@9$qZKzv4l~K7D3{%XA}1e*osYgbt*54D-t){n@AvzeQB{@2ju2Ws zA+-A2v8Mlvi+CDi7^;De7{gxlqJf7g<@tIu#?U}NmZ6C~n7~wwVP#7BMh9NuIXWg+l3dU!rD@G8&0K^pOl;#?8B{;@>oqBq?CVP z5UVhPIb5y}ml!V>j@7`wZCqWZjW`?+77f!=)p7mE-dEDfr*szos#ngJMj{O zDdnmWLhA%};7Fkza2OY`5ncFD*!JNlrm!3*o48wyxrgnTOeufF8EnFBe8yJ{rIcq= z%Ev8qC^zvFYl=Z{Q_44ssk4~GISiCBUZfnr7F=zF(CWqJLUAUg{Hxuh7(*|Xmi_y9 zWZ|8Rrj#En`X`p(cs+#HTnMd0HTJg)i-{ORCwfxKpK9z6dK25uY2{{u00000NkvXX Hu0mjfTF@0O literal 0 HcmV?d00001 diff --git a/public/img/images/in_downtime.png b/public/img/images/in_downtime.png new file mode 100644 index 0000000000000000000000000000000000000000..d609df62e332dc928542da1f18ad85d60e747e6b GIT binary patch literal 490 zcmVdHQ5XgA-Jjbt;>a7;>|ASUCcMm!- zhG7J(VgEL9#%HX>7*0@EAxxa1!k3il_xCUmWB7nYTvj1Wbg_;f7{q$gGR5*=&(ocxjRTKsA&u@}4#yFopbL!=Z^ZmS4zBq z1^k*>k9y82C9YsSwq@3TM-kmP&SDL=;#_7u`9I`oti)my*}npp@ONgNEG6E+@1?|e zX8m+PgjuZ0tnW5#9>0v?XKXAbHf7dpcpC>wiO&YbXIkYY@-A$_7o+CEF&xGA%zC4g z*o5EkHQvPP%sSP`@8BZ#W!C92$gC%D2A4~T*E8#N?7(*18jvSi$A>cOH0b;O@r~#{ zkLa#PbQ^|vdz*;p?niVV4e?Rm_fI>0vQ^)kS(mVvaTOnD)^CRY$CgPe@Yhq=1N_-W zdg46MK`AkV6?iYRJ}4z#!9SVxekt*4Gj=Ys9(hKfl$ga!nRV~L?eB1-3EpZV3r*zk z;}P11jbn1)_Cdbntr7|^&=+@#qUi4_|j%U_ymq|x!dpG_- vhYy!lc^p6CtIT?OIr2c{0`_2YX1((tPzUQN{0FNI00000NkvXXu0mjf!6zy~ literal 0 HcmV?d00001 diff --git a/public/img/images/save.png b/public/img/images/save.png new file mode 100644 index 0000000000000000000000000000000000000000..2db271920d585eaeffc667dd78df6160689859ac GIT binary patch literal 506 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`JjLLym#5l7t?1mG){EDeTV4W0?? z5oX0-onm&F7MFW2Uv-ADS<@lo*}8^Vt6C1Ut_tBQ+<06%j`>@Iw7x6Dl+dL~&-l*V z*|>^_Ii2;EDU-~soxJx$rq(80*__1?*^r(P8@es{pVEfcd&NI9T(vk_k=2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