2014-03-06 13:57:21 -05:00
|
|
|
<?php
|
|
|
|
|
$parts = explode('!', $object->check_command);
|
|
|
|
|
$command = array_shift($parts);
|
|
|
|
|
|
2015-09-24 17:42:12 -04:00
|
|
|
if ($showInstance): ?>
|
2015-09-24 17:43:03 -04:00
|
|
|
<tr>
|
2015-09-24 17:42:12 -04:00
|
|
|
<th><?= $this->translate('Instance') ?></th>
|
|
|
|
|
<td><?= $this->escape($object->instance_name) ?></td>
|
2015-08-26 04:54:01 -04:00
|
|
|
</tr>
|
2015-08-26 04:55:18 -04:00
|
|
|
<?php endif ?>
|
2015-09-24 17:43:03 -04:00
|
|
|
<tr>
|
2015-09-24 17:42:12 -04:00
|
|
|
<th><?= $this->translate('Command') ?></th>
|
2015-01-23 04:48:21 -05:00
|
|
|
<td>
|
2015-09-24 17:42:12 -04:00
|
|
|
<?= $this->escape($command) ?>
|
2017-07-04 11:24:57 -04:00
|
|
|
<?php if ($this->hasPermission('monitoring/command/process-check-result') && $object->passive_checks_enabled) {
|
2015-09-24 17:42:12 -04:00
|
|
|
$title = sprintf(
|
|
|
|
|
$this->translate('Submit a one time or so called passive result for the %s check'), $command
|
|
|
|
|
);
|
2015-02-23 11:26:56 -05:00
|
|
|
if ($object->getType() === $object::TYPE_HOST) {
|
|
|
|
|
echo $this->qlink(
|
2015-02-24 05:35:25 -05:00
|
|
|
$this->translate('Process check result'),
|
2015-01-23 04:48:21 -05:00
|
|
|
'monitoring/host/process-check-result',
|
2015-04-20 10:11:08 -04:00
|
|
|
array('host' => $object->getName()),
|
2015-02-24 05:35:25 -05:00
|
|
|
array(
|
2015-09-24 17:39:19 -04:00
|
|
|
'class' => 'action-link',
|
2015-02-24 05:35:25 -05:00
|
|
|
'data-base-target' => '_self',
|
2016-11-22 04:54:02 -05:00
|
|
|
'icon' => 'edit',
|
2015-02-24 05:35:25 -05:00
|
|
|
'title' => $title
|
|
|
|
|
)
|
2015-01-23 04:48:21 -05:00
|
|
|
);
|
|
|
|
|
} else {
|
2015-02-23 11:26:56 -05:00
|
|
|
echo $this->qlink(
|
2015-02-24 05:35:25 -05:00
|
|
|
$this->translate('Process check result'),
|
2015-01-23 04:48:21 -05:00
|
|
|
'monitoring/service/process-check-result',
|
2015-04-20 10:11:08 -04:00
|
|
|
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
|
2015-02-24 05:35:25 -05:00
|
|
|
array(
|
2015-09-24 17:39:19 -04:00
|
|
|
'class' => 'action-link',
|
2015-02-24 05:35:25 -05:00
|
|
|
'data-base-target' => '_self',
|
2016-11-22 04:54:02 -05:00
|
|
|
'icon' => 'edit',
|
2015-02-24 05:35:25 -05:00
|
|
|
'title' => $title
|
|
|
|
|
)
|
2015-01-23 04:48:21 -05:00
|
|
|
);
|
2015-02-23 11:26:56 -05:00
|
|
|
}
|
|
|
|
|
} ?>
|
2015-01-23 04:48:21 -05:00
|
|
|
</td>
|
2014-03-06 13:57:21 -05:00
|
|
|
</tr>
|
2015-01-23 04:48:21 -05:00
|
|
|
|
2014-03-06 13:57:21 -05:00
|
|
|
<?php
|
|
|
|
|
$row = "<tr>\n <th>%s</th>\n <td>%s</td>\n</tr>\n";
|
|
|
|
|
for ($i = 0; $i < count($parts); $i++) {
|
|
|
|
|
printf($row, '$ARG' . ($i + 1) . '$', $this->escape($parts[$i]));
|
|
|
|
|
}
|