'Basic', 'details' => 'Details', ]; echo '
'; echo '
'; echo '
'; echo 'Services » '; $sep = ''; foreach ($menu_options as $option => $text) { if (empty($vars['view'])) { $vars['view'] = $option; } echo $sep; if ($vars['view'] == $option) { echo ''; } echo generate_link($text, $vars, ['view' => $option]); if ($vars['view'] == $option) { echo ''; } $sep = ' | '; } unset($sep); if (Auth::user()->hasGlobalAdmin()) { echo ''; } echo '
'; if (count($services) > '0') { // Loop over each service, pulling out the details. echo ''; foreach ($services as $service) { $service['service_ds'] = htmlspecialchars_decode($service['service_ds']); if ($service['service_status'] == '2') { $status = '' . $service['service_type'] . ''; } elseif ($service['service_status'] == '1') { $status = '' . $service['service_type'] . ''; } elseif ($service['service_status'] == '0') { $status = '' . $service['service_type'] . ''; } else { $status = '' . $service['service_type'] . ''; } echo ''; echo ''; echo ''; echo ''; } } } echo '
'; echo '
' . $status . '
'; echo '
' . \LibreNMS\Util\Time::formatInterval(time() - $service['service_changed']) . '
'; echo '
' . $service['service_desc'] . '
'; echo '
' . nl2br(trim($service['service_message'])) . '
'; echo '
'; echo '
'; if (Auth::user()->hasGlobalAdmin()) { echo "
'; if ($vars['view'] == 'details') { // if we have a script for this check, use it. $check_ds = null; $check_script = \LibreNMS\Config::get('install_dir') . '/includes/services/check_' . strtolower($service['service_type']) . '.inc.php'; if (is_file($check_script)) { include $check_script; // If we have a replacement DS use it. if (isset($check_ds)) { $service['service_ds'] = $check_ds; } } $graphs = json_decode($service['service_ds'], true); foreach ($graphs as $k => $v) { $graph_array['device'] = $device['device_id']; $graph_array['type'] = 'service_graph'; $graph_array['id'] = $service['service_id']; $graph_array['ds'] = $k; echo '
'; include 'includes/html/print-graphrow.inc.php'; echo '
'; } else { echo '
No Services
'; } echo '
';