foreach ($nagios_hosts as $host) { echo ".tag_{$host['tag']} { background-color: {$host['tagcolour']} }\n"; } ?> </style> <?php if (isset($extra_css)) { echo "<link rel=\"stylesheet\" href=\"{$extra_css}\">"; } ?> </head> <body> <div id="spinner"><h3><img src="images/ajax-loader.gif" align="absmiddle"> Refreshing...</h3></div> <div id="nagioscontainer"></div> <?php NagdashHelpers::render("settings_dialog.php", ["nagios_hosts" => $nagios_hosts, "unwanted_hosts" => $unwanted_hosts]); ?> <script> $(document).keypress(function(e) { if (e.which == 115) { // "s" $("#settings_modal").modal(); } }); $(document).ready(load_nagios_data(<?php echo $show_refresh_spinner === true; ?> )); </script> </body>
if (count($broken_services) > 0) { ?> <table class="widetable" id="broken_services"> <tr><th width="30%">Hostname</th><th width="50%">Service</th><th width="10%">Duration</th><th width="5%">Attempt</th></tr> <?php // Check for the presence of the 'sort_by_time' cookie, then the static config value. if (isset($filter_sort_by_time) && $filter_sort_by_time == 1 || $sort_by_time) { usort($broken_services, 'NagdashHelpers::cmp_last_state_change'); } foreach ($broken_services as $service) { $soft_style = $service['is_hard'] ? "" : "status_soft"; $blink_tag = $service['is_hard'] && $enable_blinking ? "<blink>" : ""; $tag = NagdashHelpers::print_tag($service['tag'], count($nagios_hosts)); echo "<tr>"; echo "<td>{$service['hostname']} " . $tag . " <span class='controls'>"; NagdashHelpers::render('controls.php', ["tag" => $service['tag'], "host" => $service['hostname'], "service" => $service['service_name']]); echo "</span></td>"; echo "<td class='bold {$nagios_service_status_colour[$service['service_state']]} {$soft_style}'>{$blink_tag}{$service['service_name']}<span class='detail'>{$service['detail']}</span></td>"; echo "<td>{$service['duration']}</td>"; echo "<td>{$service['current_attempt']}/{$service['max_attempts']}</td>"; echo "</tr>"; } ?> </table> <?php } else { ?> <table class="widetable status_green"><tr><td><b>All services OK</b></td></tr></table> <?php } // Check for the presence of the 'sort_by_time' cookie, then the static config value.