diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index fd226a6dd..ccdb149d4 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -494,6 +494,44 @@ class ListController extends Controller $this->view->serviceGroups = $serviceGroups; } + /** + * List service groups + */ + public function servicegroupGridAction() + { + $this->addTitleTab( + 'servicegroup-grid', + $this->translate('Service Group Grid'), + $this->translate('Show the Service Group Grid') + ); + + $this->setAutorefreshInterval(15); + + $serviceGroups = $this->backend->select()->from('servicegroupsummary', array( + 'servicegroup_alias', + 'servicegroup_name', + 'services_critical_handled', + 'services_critical_unhandled', + 'services_ok', + 'services_pending', + 'services_total', + 'services_unknown_handled', + 'services_unknown_unhandled', + 'services_warning_handled', + 'services_warning_unhandled' + )); + $this->applyRestriction('monitoring/filter/objects', $serviceGroups); + $this->filterQuery($serviceGroups); + + $this->setupSortControl(array( + 'servicegroup_alias' => $this->translate('Service Group Name'), + 'services_severity' => $this->translate('Severity'), + 'services_total' => $this->translate('Total Services') + ), $serviceGroups, ['services_severity' => 'desc']); + + $this->view->serviceGroups = $serviceGroups; + } + /** * List host groups */ diff --git a/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml b/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml new file mode 100644 index 000000000..3c3b32d38 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml @@ -0,0 +1,212 @@ +compact): ?> +
+ tabs ?> +
+ sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No service groups found matching the filter.') ?>

+
+ +
+ +
+ services_critical_unhandled > 0): ?> + qlink( + $serviceGroup->services_critical_unhandled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 2 + ], + [ + 'class' => 'state-critical', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state CRITICAL in service group "%s"', + 'List %s services which are currently in state CRITICAL in service group "%s"', + $serviceGroup->services_critical_unhandled + ), + $serviceGroup->services_critical_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_warning_unhandled > 0): ?> + qlink( + $serviceGroup->services_warning_unhandled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 1 + ], + [ + 'class' => 'state-warning', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state WARNING in service group "%s"', + 'List %s services which are currently in state WARNING in service group "%s"', + $serviceGroup->services_warning_unhandled + ), + $serviceGroup->services_warning_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_unknown_unhandled > 0): ?> + qlink( + $serviceGroup->services_unknown_unhandled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 3 + ], + [ + 'class' => 'state-unknown', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state UNKNOWN in service group "%s"', + 'List %s services which are currently in state UNKNOWN in service group "%s"', + $serviceGroup->services_unknown_unhandled + ), + $serviceGroup->services_unknown_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_critical_handled > 0): ?> + qlink( + $serviceGroup->services_critical_handled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 2 + ], + [ + 'class' => 'state-critical handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"', + 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"', + $serviceGroup->services_critical_handled + ), + $serviceGroup->services_critical_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_warning_handled > 0): ?> + qlink( + $serviceGroup->services_warning_handled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 1 + ], + [ + 'class' => 'state-warning handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"', + 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"', + $serviceGroup->services_warning_handled + ), + $serviceGroup->services_warning_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_unknown_handled > 0): ?> + qlink( + $serviceGroup->services_unknown_handled, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 3 + ], + [ + 'class' => 'state-unknown handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"', + 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"', + $serviceGroup->services_unknown_handled + ), + $serviceGroup->services_unknown_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_pending > 0): ?> + qlink( + $serviceGroup->services_pending, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_state' => 99 + ], + [ + 'class' => 'state-pending', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currenlty in state PENDING in service group "%s"', + 'List %s services which are currently in state PENDING in service group "%s"', + $serviceGroup->services_pending + ), + $serviceGroup->services_pending, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_ok > 0): ?> + qlink( + $serviceGroup->services_ok, + 'monitoring/list/servicegrid', + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_state' => 0 + ], + [ + 'class' => 'state-ok', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state OK in service group "%s"', + 'List %s services which are currently in state OK in service group "%s"', + $serviceGroup->services_ok + ), + $serviceGroup->services_ok, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + +
+ 0 +
+ + qlink( + $serviceGroup->servicegroup_alias, + 'monitoring/list/servicegrid', + ['servicegroup_name' => $serviceGroup->servicegroup_name], + [ + 'title' => sprintf( + $this->translate('List all services in the group "%s"'), + $serviceGroup->servicegroup_alias + ) + ] + ) ?> +
+ +
+ \ No newline at end of file