'All'); foreach ($slas as $sla) { // Set a default type, if we know about it, it will be overwritten below. $text = 'Unknown'; $sla_type = $sla['rtt_type']; if (!in_array($sla_type, $sla_types)) { if (isset($config['sla_type_labels'][$sla_type])) { $text = $config['sla_type_labels'][$sla_type]; } } else { $text = ucfirst($sla_type); } $sla_types[$sla_type] = $text; } asort($sla_types); $status_options = array( 'all' => 'All', 'up' => 'Up', 'down' => 'Down', ); echo "SLA » "; // SLA Types, on the left. $sep = ''; foreach ($sla_types as $sla_type => $text) { if (!$vars['view']) { $vars['view'] = $sla_type; } echo $sep; if ($vars['view'] == $sla_type) { echo ""; } echo generate_link($text, $vars, array('view' => $sla_type)); if ($vars['view'] == $sla_type) { echo ''; } $sep = ' | '; } unset($sep); // The status option - on the right echo '
'; echo "Status » "; $sep = ''; foreach ($status_options as $option => $text) { if (empty($vars['opstatus'])) { $vars['opstatus'] = $option; } echo $sep; if ($vars['opstatus'] == $option) { echo ""; } echo generate_link($text, $vars, array('opstatus' => $option)); if ($vars['opstatus'] == $option) { echo ''; } $sep = ' | '; } unset($sep); print_optionbar_end(); foreach ($slas as $sla) { if ($vars['view'] != 'all' && $vars['view'] != $sla['rtt_type']) { continue; } $opstatus = ($sla['opstatus'] === '0') ? 'up' : 'down'; d_echo("
Opstatus :: var: ".$vars['opstatus'].", db: ".$sla['opstatus'].", name: ".$opstatus."
"); if ($vars['opstatus'] != 'all' && $vars['opstatus'] != $opstatus) { continue; } $name = 'SLA #'.$sla['sla_nr'].' - '.$sla_types[$sla['rtt_type']]; if ($sla['tag']) { $name .= ': '.$sla['tag']; } if ($sla['owner']) { $name .= ' (Owner: '.$sla['owner'].')'; } // Jitter has more graphs. Display a sub-page if ($sla['rtt_type'] == 'jitter') { $name = ' $sla['sla_id'])).'">'.$name.''; } else { $name = htmlentities($name); } // If we have an error highlight the row. if ($sla['opstatus'] == 2) { $danger = "panel-danger"; } else { $danger = ''; } $graph_array = array(); $graph_array['device'] = $device['device_id']; $graph_array['height'] = '100'; $graph_array['width'] = '215'; $graph_array['to'] = $config['time']['now']; $graph_array['type'] = 'device_sla'; $graph_array['id'] = $sla['sla_id']; echo '

'.$name.'

'; echo "
"; include 'includes/print-graphrow.inc.php'; echo '
'; echo '
'; echo '
'; } $pagetitle[] = 'SLAs';