Restyle process info and shorten performance info

This commit is contained in:
Thomas Gelf 2014-03-10 00:49:21 +01:00
parent 5962fd71d0
commit e54c91c2f7
4 changed files with 301 additions and 389 deletions

View File

@ -52,26 +52,39 @@ class Monitoring_ProcessController extends MonitoringController
public function init()
{
$this->backend = Backend::createBackend($this->_getParam('backend'));
$this->getTabs()->add('info', array(
'title' => 'Process Info',
'url' =>'monitoring/process/info'
))->add('performance', array(
'title' => 'Performance Info',
'url' =>'monitoring/process/performance'
));
}
public function performanceAction()
public function infoAction()
{
$this->view->runtimevariables = (object)RuntimevariablesView::fromRequest(
$this->_request,
array('varname', 'varvalue')
)->getQuery()->fetchPairs();
$this->getTabs()->activate('info');
$this->setAutorefreshInterval(10);
$this->view->programstatus = ProgramstatusView::fromRequest(
$this->_request
)->getQuery()->fetchRow();
$this->view->backendName = $this->backend->getDefaultBackendName();
}
public function performanceAction()
{
$this->getTabs()->activate('performance');
$this->setAutorefreshInterval(10);
$this->view->runtimevariables = (object) RuntimevariablesView::fromRequest(
$this->_request,
array('varname', 'varvalue')
)->getQuery()->fetchPairs();
$this->view->checkperformance = $query = RuntimesummaryView::fromRequest(
$this->_request
)->getQuery()->fetchAll();
$this->view->backendName = $this->backend->getDefaultBackendName();
}
}

View File

@ -0,0 +1,172 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<?php
$ps = $this->programstatus;
$cf = $this->getHelper('CommandForm');
?>
<div class="content processinfo">
<p>Backend <strong><?= $this->backendName; ?></strong> is
<?= $ps->is_currently_running === '1' ? sprintf('running with pid %d', $ps->process_id) : 'not running'; ?>
since <?= $this->timeSince($ps->program_start_time); ?>.
<table class="avp">
<tbody>
<tr>
<th>Last status update</th>
<td><?= $this->timeSince($ps->status_update_time) ?> ago</td>
</tr>
<tr>
<th>Last check command</th>
<td><?= $this->timeSince($ps->last_command_check) ?> ago</td>
</tr>
<tr>
<th>Global host event handler</th>
<td><?= $ps->global_host_event_handler ? $ps->global_host_event_handler : 'Not set' ?></td>
</tr>
<tr>
<th>Global service event handler</th>
<td><?= $ps->global_service_event_handler ? $ps->global_service_event_handler : 'Not set' ?></td>
</tr>
<tr>
<th>Notifications enabled</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->notifications_enabled,
'enablenotifications',
'disablenotifications',
false,
array('global' => '1')
) ?>
<?php if ($ps->notifications_enabled === '1'): ?>
<a rel="tooltip" title="Disable notifications for a specific time on a program-wide basis" href="<?= $this->href('monitoring/command/disablenotificationswithexpire') ?>" data-base-target="_next">Temporarily disable</a>
<?php elseif ($ps->disable_notif_expire_time): ?>
Will be re-enabled in <strong><?= $this->timeUnless($ps->disable_notif_expire_time) ?></strong>
</div>
<?php endif; ?>
</td>
</tr>
<tr>
<th>Execute active service checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->active_service_checks_enabled,
'enableactivechecks',
'disableactivechecks',
false,
array('global' => 'service')
) ?></td>
</tr>
<tr>
<th>Accept passive service checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->passive_service_checks_enabled,
'startacceptingpassivechecks',
'stopacceptingpassivechecks',
false,
array('global' => 'service')
) ?></td>
</tr>
<tr>
<th>Execute active host checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->active_host_checks_enabled,
'enableactivechecks',
'disableactivechecks',
false,
array('global' => 'host')
) ?></td>
</tr>
<tr>
<th>Accept passive host checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->passive_host_checks_enabled,
'startacceptingpassivechecks',
'stopacceptingpassivechecks',
false,
array('global' => 'host')
) ?></td>
</tr>
<tr>
<th>Eventhandlers enabled</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->event_handlers_enabled,
'enableeventhandler',
'disableeventhandler',
false,
array('global' => '1')
) ?></td>
</tr>
<tr>
<th>Obsessing over host checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->obsess_over_hosts,
'startobsessing',
'stopobsessing',
false,
array('global' => 'host')
) ?></td>
</tr>
<tr>
<th>Obsessing over service checks</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->obsess_over_services,
'startobsessing',
'stopobsessing',
false,
array('global' => 'service')
) ?></td>
</tr>
<tr>
<th>Flap detection enabled</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->flap_detection_enabled,
'enableflapdetection',
'disableflapdetection',
false,
array('global' => '1')
) ?></td>
</tr>
<tr>
<th>Process performance data</th>
<td><?= $cf->toggleSubmitForm(
'',
$ps->process_performance_data,
'enableperformancedata',
'disableperformancedata',
false,
array('global' => '1')
) ?></td>
</tr>
<tr>
<th>Monitoring Process</th>
<td><?= $cf->labelSubmitForm(
'Restart',
'Restart the monitoring process',
'',
'restartprocess'
) ?>
<!--<?=
$cf->labelSubmitForm(
'Shutdown monitoring process',
'Shutdown the monitoring process',
'btn-cta',
'shutdownprocess'
);
?>-->
</td>
</tr>
</tbody>
</table>
</div>

View File

@ -1,38 +1,17 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<?php
$rv = $this->runtimeVariables()->create($this->runtimevariables);
$ps = $this->programstatus;
$cp = $this->checkPerformance()->create($this->checkperformance);
/** @var Zend_View_Helper_CommandForm $ch */
$ch = $this->getHelper('CommandForm');
$rv = $this->runtimeVariables()->create($this->runtimevariables);
$cp = $this->checkPerformance()->create($this->checkperformance);
?>
<h1>Process Information</h1>
<hr />
<div class="content processinfo">
<div class="panel panel-default">
<div class="panel-body">
Backend <strong><?= $this->backendName; ?></strong> is
<?= $ps->is_currently_running === '1' ? 'running' : 'not running'; ?>
(pid <?= $ps->process_id; ?>)
since <?= $this->timeSince($ps->program_start_time); ?> ago
(<?= $this->dateFormat()->formatDateTime($ps->program_start_time); ?>).
</div>
</div>
<?php if ($ps->disable_notif_expire_time): ?>
<div class="alert alert-warning">
<h4>Notifications disabled with expiration time</h4>
<p>
Notifications automatically turned on again on the
<strong><?= $this->dateFormat()->formatDateTime($ps->disable_notif_expire_time); ?></strong>
</p>
</div>
<?php endif; ?>
<div class="row">
<div class="col-md-7">
<h4>Object summaries</h4>
<table class="table-bordered table">
<h4>Object summaries</h4>
<table class="table-bordered table">
<thead>
<tr>
<td style="width: 300px;">&nbsp;</td>
@ -70,10 +49,10 @@
</td>
</tr>
</tbody>
</table>
</table>
<h4>Active checks</h4>
<table class="table-bordered table">
<h4>Active checks</h4>
<table class="table-bordered table">
<thead>
<tr>
<td style="width: 300px;">&nbsp;</td>
@ -100,10 +79,10 @@
<td><?= sprintf('%.3f', $cp->service_active_execution_avg); ?>s</td>
</tr>
</tbody>
</table>
</table>
<h4>Passive checks</h4>
<table class="table-bordered table">
<h4>Passive checks</h4>
<table class="table-bordered table">
<thead>
<tr>
<td style="width: 300px;">&nbsp;</td>
@ -124,262 +103,7 @@
<td><?= $cp->service_passive_count; ?></td>
</tr>
</tbody>
</table>
</table>
<h4>Actuality</h4>
<table class="table-bordered table">
<tbody>
<tr>
<td style="width: 300px;">
<strong>Last status update</strong>
</td>
<td>
<?= $this->dateFormat()->formatDateTime($ps->status_update_time); ?>
(since <?= $this->timeSince($ps->status_update_time); ?> ago)
</td>
</tr>
<tr>
<td>
<strong>Last check command</strong>
</td>
<td>
<?= $this->dateFormat()->formatDateTime($ps->last_command_check); ?>
(since <?= $this->timeSince($ps->last_command_check); ?> ago)
</td>
</tr>
</tbody>
</table>
<h4>Configuration</h4>
<table class="table-bordered table">
<tbody>
<tr>
<td style="width: 300px;">
<strong>Global host event handler</strong>
</td>
<td>
<?php if ($ps->global_host_event_handler): ?>
<?= $ps->global_host_event_handler; ?>
<?php else: ?>
Not set
<?php endif; ?>
</td>
</tr>
<tr>
<td style="width: 300px;">
<strong>Global service event handler</strong>
</td>
<td>
<?php if ($ps->global_service_event_handler): ?>
<?= $ps->global_service_event_handler; ?>
<?php else: ?>
Not set
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-5">
<h4>Commands</h4>
<?=
$ch->labelSubmitForm(
'Shutdown monitoring process',
'Shutdown the monitoring process',
'btn-cta',
'shutdownprocess'
);
?>
<br />
<?=
$ch->labelSubmitForm(
'Restart monitoring process',
'Restart the monitoring process',
'btn-cta',
'restartprocess'
);
?>
<?php if ($ps->notifications_enabled === '1'): ?>
<br />
<a rel="tooltip" title="Disable notifications for a specific time on a program-wide basis"
href="<?= $this->href('monitoring/command/disablenotificationswithexpire'); ?>"
class="button btn-cta btn-full-width">
Disable notification with expire
</a>
<?php endif; ?>
<br />
<table class="table">
<tbody>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Notifications enabled',
$ps->notifications_enabled,
'enablenotifications',
'disablenotifications',
false,
array(
'global' => '1'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Execute active service checks',
$ps->active_service_checks_enabled,
'enableactivechecks',
'disableactivechecks',
false,
array(
'global' => 'service'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Accept passive service checks',
$ps->passive_service_checks_enabled,
'startacceptingpassivechecks',
'stopacceptingpassivechecks',
false,
array(
'global' => 'service'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Execute active host checks',
$ps->active_host_checks_enabled,
'enableactivechecks',
'disableactivechecks',
false,
array(
'global' => 'host'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Accept passive host checks',
$ps->passive_host_checks_enabled,
'startacceptingpassivechecks',
'stopacceptingpassivechecks',
false,
array(
'global' => 'host'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Eventhandlers enabled',
$ps->event_handlers_enabled,
'enableeventhandler',
'disableeventhandler',
false,
array(
'global' => '1'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Obsessing over host checks',
$ps->obsess_over_hosts,
'startobsessing',
'stopobsessing',
false,
array(
'global' => 'host'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Obsessing over service checks',
$ps->obsess_over_services,
'startobsessing',
'stopobsessing',
false,
array(
'global' => 'service'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Flap detection enabled',
$ps->flap_detection_enabled,
'enableflapdetection',
'disableflapdetection',
false,
array(
'global' => '1'
)
);
?>
</td>
</tr>
<tr>
<td>
<?=
$ch->toggleSubmitForm(
'Process performance data',
$ps->process_performance_data,
'enableperformancedata',
'disableperformancedata',
false,
array(
'global' => '1'
)
);
?>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@ -7,3 +7,6 @@ table.action.comments td a, table.action.downtimes td a {
font-weight: bold;
}
.content.processinfo table.avp th {
width: 16em;
}