time()) { $update_state['alert_status'] = '3'; } } else { $update_state['ignore_until'] = ['NULL']; } if (is_array($update_state)) { $up_s = dbUpdate($update_state, 'alert_table', '`alert_table_id` = ?', [$vars['alert_entry']]); } // Refresh array because we've changed the database. $entry = get_alert_entry_by_id($vars['alert_entry']); } // End actions humanize_alert_entry($entry); $alert_rules = cache_alert_rules(); $alert = $alert_rules[$entry['alert_test_id']]; $state = safe_json_decode($entry['state']); $conditions = safe_json_decode($alert['conditions']); $entity = get_entity_by_id_cache($entry['entity_type'], $entry['entity_id']); // r($entry); // r($alert); ?>

Alert Details

Type
Entity
Checker
Fail Msg

Status

'; foreach ($state['failed'] as $test) { $metric_def = $config['entities'][$alert['entity_type']]['metrics'][$test['metric']]; $format = NULL; $symbol = ''; if (!safe_empty($test['value'])) { if (isset($metric_def['format'])) { $format = isset($entity[$metric_def['format']]) ? $entity[$metric_def['format']] : $metric_def['format']; } if (isset($metric_def['symbol'])) { $symbol = isset($entity[$metric_def['symbol']]) ? $entity[$metric_def['symbol']] : $metric_def['symbol']; } } $alert['state_popup'] .= ''; } $alert['state_popup'] .= '
Status
Last Changed
'; $alert['state_popup'] .= '
MetricCondValueMeasured
' . $test['metric'] . '' . $test['condition'] . '' . format_value($test['value'], $entity['entity_format']) . $entity['entity_symbol'] . '' . format_value($state['metrics'][$test['metric']], $entity['entity_format']) . $entity['entity_symbol'] . '
'; } elseif (safe_count($state['metrics'])) { $alert['state_popup'] .= ''; $alert['state_popup'] .= ''; foreach ($state['metrics'] as $metric => $value) { $alert['state_popup'] .= ''; } $alert['state_popup'] .= '
MetricValue
' . $metric . '' . format_value($value, $entity['entity_format']) . $entity['entity_symbol'] . '
'; } echo $alert['state_popup']; ?>
'horizontal', 'id' => 'update_alert_entry', 'title' => 'Alert Settings', //'icon' => 'oicon-gear', 'fieldset' => ['edit' => ''], ]; $form['row'][0]['editing'] = [ 'type' => 'hidden', 'value' => 'yes' ]; $form['row'][1]['ignore_until'] = [ 'type' => 'datetime', //'fieldset' => 'edit', 'name' => 'Ignore Until', 'placeholder' => '', //'width' => '250px', 'readonly' => $readonly, 'disabled' => empty($entry['ignore_until']), 'min' => 'current', 'value' => $entry['ignore_until'] ?: '' ]; $form['row'][1]['ignore_until_enable'] = [ 'type' => 'toggle', 'view' => 'toggle', 'size' => 'big', 'palette' => 'blue', 'readonly' => $readonly, 'onchange' => "toggleAttrib('disabled', 'ignore_until')", 'value' => !empty($entry['ignore_until']) ]; $form['row'][2]['ignore_until_ok'] = [ 'type' => 'toggle', 'name' => 'Ignore Until OK', //'fieldset' => 'edit', 'view' => 'toggle', 'size' => 'big', 'palette' => 'blue', 'readonly' => $readonly, 'value' => $entry['ignore_until_ok'] ]; if (!$readonly) { // Hide button for readonly $form['row'][7]['submit'] = [ 'type' => 'submit', 'name' => 'Save Changes', 'icon' => 'icon-ok icon-white', 'div_style' => 'padding-top: 10px; padding-bottom: 10px;', 'right' => TRUE, 'class' => 'btn-primary', 'readonly' => $readonly, 'value' => 'update-alert-entry' ]; } print_form($form); unset($form); ?>
'Historical Availability']); ?>
"); // end row $vars['entity_type'] = $entry['entity_type']; $vars['entity_id'] = $entry['entity_id']; print_alert_log($vars); } else { print_error("Unfortunately, this alert entry id does not seem to exist in the database!"); } // EOF