Skip to content

Commit

Permalink
Hostgroupsummary: Support name_ci in quick searches
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Mar 21, 2024
1 parent a034449 commit 26b809f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Icingadb/Model/Hostgroupsummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/**
* @property string $id
* @property string $display_name
* @property string $name_ci
* @property string $name
* @property int $hosts_down_handled
* @property int $hosts_down_unhandled
Expand Down Expand Up @@ -75,6 +76,8 @@ public function getKeyName()
public function getColumns()
{
return [
'name' => 'hostgroup_name',
'name_ci' => 'hostgroup_name_ci',
'display_name' => 'hostgroup_display_name',
'hosts_down_handled' => new Expression(
'SUM(CASE WHEN host_state = 1'
Expand All @@ -94,7 +97,6 @@ public function getColumns()
'SUM(CASE WHEN host_state = 0 THEN 1 ELSE 0 END)'
),
'hosts_severity' => new Expression('MAX(host_severity)'),
'name' => 'hostgroup_name',
'services_critical_handled' => new Expression(
'SUM(CASE WHEN service_state = 2'
. ' AND (service_handled = \'y\' OR service_reachable = \'n\') THEN 1 ELSE 0 END)'
Expand Down Expand Up @@ -153,6 +155,7 @@ public function getUnions()
[
'hostgroup_id' => 'hostgroup.id',
'hostgroup_name' => 'hostgroup.name',
'hostgroup_name_ci' => 'hostgroup.name_ci',
'hostgroup_display_name' => 'hostgroup.display_name',
'host_id' => 'host.id',
'host_state' => 'state.soft_state',
Expand All @@ -174,6 +177,7 @@ public function getUnions()
[
'hostgroup_id' => 'hostgroup.id',
'hostgroup_name' => 'hostgroup.name',
'hostgroup_name_ci' => 'hostgroup.name_ci',
'hostgroup_display_name' => 'hostgroup.display_name',
'host_id' => new Expression('NULL'),
'host_state' => new Expression('NULL'),
Expand All @@ -192,6 +196,7 @@ public function getUnions()
[
'hostgroup_id' => 'hostgroup.id',
'hostgroup_name' => 'hostgroup.name',
'hostgroup_name_ci' => 'hostgroup.name_ci',
'hostgroup_display_name' => 'hostgroup.display_name',
'host_id' => new Expression('NULL'),
'host_state' => new Expression('NULL'),
Expand Down

0 comments on commit 26b809f

Please sign in to comment.