mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
parent
ceb32679d8
commit
a14f800d9e
@ -77,6 +77,7 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
'host_state_type',
|
'host_state_type',
|
||||||
'host_last_state_change',
|
'host_last_state_change',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
'service_description',
|
'service_description',
|
||||||
'service_display_name',
|
'service_display_name',
|
||||||
|
@ -52,6 +52,7 @@ class Monitoring_HostsController extends Controller
|
|||||||
'host_icon_image_alt',
|
'host_icon_image_alt',
|
||||||
'host_name',
|
'host_name',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_problem',
|
'host_problem',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
@ -91,6 +92,7 @@ class Monitoring_HostsController extends Controller
|
|||||||
'host_icon_image_alt',
|
'host_icon_image_alt',
|
||||||
'host_name',
|
'host_name',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_problem',
|
'host_problem',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
|
@ -75,6 +75,7 @@ class Monitoring_ListController extends Controller
|
|||||||
'host_display_name',
|
'host_display_name',
|
||||||
'host_state' => $stateColumn,
|
'host_state' => $stateColumn,
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_acknowledged',
|
'host_acknowledged',
|
||||||
'host_output',
|
'host_output',
|
||||||
'host_attempt',
|
'host_attempt',
|
||||||
@ -151,6 +152,7 @@ class Monitoring_ListController extends Controller
|
|||||||
'host_state_type',
|
'host_state_type',
|
||||||
'host_last_state_change',
|
'host_last_state_change',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
'service_description',
|
'service_description',
|
||||||
'service_display_name',
|
'service_display_name',
|
||||||
|
@ -54,6 +54,7 @@ class Monitoring_ServicesController extends Controller
|
|||||||
'host_icon_image_alt',
|
'host_icon_image_alt',
|
||||||
'host_name',
|
'host_name',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_output',
|
'host_output',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_problem',
|
'host_problem',
|
||||||
@ -101,6 +102,7 @@ class Monitoring_ServicesController extends Controller
|
|||||||
'host_icon_image_alt',
|
'host_icon_image_alt',
|
||||||
'host_name',
|
'host_name',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_output',
|
'host_output',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_problem',
|
'host_problem',
|
||||||
|
@ -14,11 +14,14 @@ use Icinga\Module\Monitoring\Object\Host;
|
|||||||
<?php if ($object->host_display_name !== $object->host_name): ?>
|
<?php if ($object->host_display_name !== $object->host_name): ?>
|
||||||
<small>(<?= $this->escape($object->host_name); ?>)</small>
|
<small>(<?= $this->escape($object->host_name); ?>)</small>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
|
<?= $this->render('partials/host/statusicons.phtml'); ?>
|
||||||
<br>
|
<br/>
|
||||||
<?= $this->escape($object->host_address); ?>
|
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
|
||||||
|
<span class="address padded" title="IPv6 address"><?= $this->escape($object->host_address6); ?></span>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
|
||||||
|
<span class="address padded" title="IPv4 address"><?= $this->escape($object->host_address); ?></span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?= $this->render('partials/host/statusicons.phtml'); ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -15,11 +15,13 @@ use Icinga\Module\Monitoring\Object\Service;
|
|||||||
<?php if ($object->host_display_name !== $object->host_name): ?>
|
<?php if ($object->host_display_name !== $object->host_name): ?>
|
||||||
<small>(<?= $this->escape($object->host_name); ?>)</small>
|
<small>(<?= $this->escape($object->host_name); ?>)</small>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
|
<br/>
|
||||||
<br>
|
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
|
||||||
<?= $this->escape($object->host_address); ?>
|
<span class="address padded" title="IPv6 address"><?= $this->escape($object->host_address6); ?></span>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
|
||||||
|
<span class="address padded" title="IPv4 address"><?= $this->escape($object->host_address); ?></span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?= $this->render('partials/host/statusicons.phtml'); ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="state <?= Service::getStateText($object->service_state); ?><?= $object->service_handled ? ' handled' : ''; ?>">
|
<tr class="state <?= Service::getStateText($object->service_state); ?><?= $object->service_handled ? ' handled' : ''; ?>">
|
||||||
|
@ -25,6 +25,7 @@ class HoststatusQuery extends IdoQuery
|
|||||||
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
||||||
'host_action_url' => 'h.action_url',
|
'host_action_url' => 'h.action_url',
|
||||||
'host_address' => 'h.address',
|
'host_address' => 'h.address',
|
||||||
|
'host_address6' => 'h.address6',
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
||||||
'host_icon_image' => 'h.icon_image',
|
'host_icon_image' => 'h.icon_image',
|
||||||
|
@ -27,6 +27,7 @@ class ServicestatusQuery extends IdoQuery
|
|||||||
'hosts' => array(
|
'hosts' => array(
|
||||||
'host_action_url' => 'h.action_url',
|
'host_action_url' => 'h.action_url',
|
||||||
'host_address' => 'h.address',
|
'host_address' => 'h.address',
|
||||||
|
'host_address6' => 'h.address6',
|
||||||
'host_alias' => 'h.alias COLLATE latin1_general_ci',
|
'host_alias' => 'h.alias COLLATE latin1_general_ci',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
||||||
'host_icon_image' => 'h.icon_image',
|
'host_icon_image' => 'h.icon_image',
|
||||||
|
@ -39,6 +39,7 @@ class StatusQuery extends IdoQuery
|
|||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_address' => 'h.address',
|
'host_address' => 'h.address',
|
||||||
|
'host_address6' => 'h.address6',
|
||||||
'host_ipv4' => 'INET_ATON(h.address)',
|
'host_ipv4' => 'INET_ATON(h.address)',
|
||||||
'host_icon_image' => 'h.icon_image',
|
'host_icon_image' => 'h.icon_image',
|
||||||
'host_icon_image_alt' => 'h.icon_image_alt',
|
'host_icon_image_alt' => 'h.icon_image_alt',
|
||||||
|
@ -15,6 +15,7 @@ class HostStatus extends DataView
|
|||||||
'host_display_name',
|
'host_display_name',
|
||||||
'host_alias',
|
'host_alias',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_state_type',
|
'host_state_type',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
|
@ -29,6 +29,7 @@ class ServiceStatus extends DataView
|
|||||||
'host_state_type',
|
'host_state_type',
|
||||||
'host_last_state_change',
|
'host_last_state_change',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_problem',
|
'host_problem',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
'service_description',
|
'service_description',
|
||||||
|
@ -96,6 +96,7 @@ class Host extends MonitoredObject
|
|||||||
'host_active_checks_enabled',
|
'host_active_checks_enabled',
|
||||||
'host_active_checks_enabled_changed',
|
'host_active_checks_enabled_changed',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_alias',
|
'host_alias',
|
||||||
'host_check_command',
|
'host_check_command',
|
||||||
'host_check_execution_time',
|
'host_check_execution_time',
|
||||||
|
@ -14,11 +14,13 @@ class Macro
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private static $icingaMacros = array(
|
private static $icingaMacros = array(
|
||||||
'HOSTNAME' => 'host_name',
|
'HOSTNAME' => 'host_name',
|
||||||
'HOSTADDRESS' => 'host_address',
|
'HOSTADDRESS' => 'host_address',
|
||||||
'SERVICEDESC' => 'service_description',
|
'HOSTADDRESS6' => 'host_address6',
|
||||||
'host.name' => 'host_name',
|
'SERVICEDESC' => 'service_description',
|
||||||
'host.address' => 'host_address',
|
'host.name' => 'host_name',
|
||||||
|
'host.address' => 'host_address',
|
||||||
|
'host.address6' => 'host_address6',
|
||||||
'service.description' => 'service_description'
|
'service.description' => 'service_description'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ class Service extends MonitoredObject
|
|||||||
'host_acknowledged',
|
'host_acknowledged',
|
||||||
'host_active_checks_enabled',
|
'host_active_checks_enabled',
|
||||||
'host_address',
|
'host_address',
|
||||||
|
'host_address6',
|
||||||
'host_alias',
|
'host_alias',
|
||||||
'host_display_name',
|
'host_display_name',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
|
@ -4,12 +4,19 @@
|
|||||||
width: 16em;
|
width: 16em;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.pluginoutput {
|
.padded {
|
||||||
width: 100%;
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address, p.pluginoutput {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'DejaVu Sans Mono', 'Courier New', Courier, monospace;
|
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'DejaVu Sans Mono', 'Courier New', Courier, monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.pluginoutput {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
table.action td .pluginoutput {
|
table.action td .pluginoutput {
|
||||||
font-size: 0.875em;
|
font-size: 0.875em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
@ -16,11 +16,14 @@ class MacroTest extends BaseTestCase
|
|||||||
$hostMock = Mockery::mock('host');
|
$hostMock = Mockery::mock('host');
|
||||||
$hostMock->host_name = 'test';
|
$hostMock->host_name = 'test';
|
||||||
$hostMock->host_address = '1.1.1.1';
|
$hostMock->host_address = '1.1.1.1';
|
||||||
|
$hostMock->host_address6 = '::1';
|
||||||
|
|
||||||
$this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $hostMock), $hostMock->host_name);
|
$this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $hostMock), $hostMock->host_name);
|
||||||
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $hostMock), $hostMock->host_address);
|
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $hostMock), $hostMock->host_address);
|
||||||
|
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS6$', $hostMock), $hostMock->host_address6);
|
||||||
$this->assertEquals(Macro::resolveMacros('$host.name$', $hostMock), $hostMock->host_name);
|
$this->assertEquals(Macro::resolveMacros('$host.name$', $hostMock), $hostMock->host_name);
|
||||||
$this->assertEquals(Macro::resolveMacros('$host.address$', $hostMock), $hostMock->host_address);
|
$this->assertEquals(Macro::resolveMacros('$host.address$', $hostMock), $hostMock->host_address);
|
||||||
|
$this->assertEquals(Macro::resolveMacros('$host.address6$', $hostMock), $hostMock->host_address6);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testServiceMacros()
|
public function testServiceMacros()
|
||||||
@ -28,13 +31,16 @@ class MacroTest extends BaseTestCase
|
|||||||
$svcMock = Mockery::mock('service');
|
$svcMock = Mockery::mock('service');
|
||||||
$svcMock->host_name = 'test';
|
$svcMock->host_name = 'test';
|
||||||
$svcMock->host_address = '1.1.1.1';
|
$svcMock->host_address = '1.1.1.1';
|
||||||
|
$svcMock->host_address6 = '::1';
|
||||||
$svcMock->service_description = 'a service';
|
$svcMock->service_description = 'a service';
|
||||||
|
|
||||||
$this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $svcMock), $svcMock->host_name);
|
$this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $svcMock), $svcMock->host_name);
|
||||||
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $svcMock), $svcMock->host_address);
|
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $svcMock), $svcMock->host_address);
|
||||||
|
$this->assertEquals(Macro::resolveMacros('$HOSTADDRESS6$', $svcMock), $svcMock->host_address6);
|
||||||
$this->assertEquals(Macro::resolveMacros('$SERVICEDESC$', $svcMock), $svcMock->service_description);
|
$this->assertEquals(Macro::resolveMacros('$SERVICEDESC$', $svcMock), $svcMock->service_description);
|
||||||
$this->assertEquals(Macro::resolveMacros('$host.name$', $svcMock), $svcMock->host_name);
|
$this->assertEquals(Macro::resolveMacros('$host.name$', $svcMock), $svcMock->host_name);
|
||||||
$this->assertEquals(Macro::resolveMacros('$host.address$', $svcMock), $svcMock->host_address);
|
$this->assertEquals(Macro::resolveMacros('$host.address$', $svcMock), $svcMock->host_address);
|
||||||
|
$this->assertEquals(Macro::resolveMacros('$host.address6$', $svcMock), $svcMock->host_address6);
|
||||||
$this->assertEquals(Macro::resolveMacros('$service.description$', $svcMock), $svcMock->service_description);
|
$this->assertEquals(Macro::resolveMacros('$service.description$', $svcMock), $svcMock->service_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user