You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.1 KiB
PHP

<?php
require_once(dirname(__FILE__) . "/../../common.inc.php");
pre_init();
init_session();
grab_request_vars();
check_prereqs();
check_authentication(true);
report_notifications_disabled_generate_report();
function report_notifications_disabled_generate_report()
{
$hosts = report_notifications_disabled_get_hosts();
$services = report_notifications_disabled_get_services();
do_page_start(array("page_title" => "Notifications Disabled Report"), true);
echo "<h5>Disabled Hosts</h5>";
echo report_notifications_disabled_get_host_table($hosts);
echo "<br>";
echo "<h5>Disabled Services</h5>";
echo report_notifications_disabled_get_service_table($services);
}
function report_notifications_disabled_get_host_table($data)
{
$header_row = "<tr>";
$header_row .= "<th>Host</th>";
$header_row .= "<th>User</th>";
$header_row .= "<th>When</th>";
$header_row .= "</tr>";
return "<table class=\"table table-condensed table-striped table-bordered\">" . $header_row . report_notifications_disabled_get_rows($data) . "</table>";
}
function report_notifications_disabled_get_service_table($data)
{
$header_row = "<tr>";
$header_row .= "<th>Host</th>";
$header_row .= "<th>Service</th>";
$header_row .= "<th>User</th>";
$header_row .= "<th>When</th>";
$header_row .= "</tr>";
return "<table class=\"table table-condensed table-striped table-bordered\">" . $header_row . report_notifications_disabled_get_rows($data) . "</table>";
}
function report_notifications_disabled_get_rows($data)
{
$rows = "";
foreach ($data as $row_data) {
$rows .= report_notifications_disabled_get_row($row_data);
}
return $rows;
}
function report_notifications_disabled_get_row($row_data)
{
$row = "<tr>";
$row .= "<td>" . $row_data["host_name"] . "</td>";
if (!empty($row_data["service_description"])) {
$row .= "<td>" . $row_data["service_description"] . "</td>";
}
$row .= "<td>" . $row_data["user"] . "</td>";
$row .= "<td>" . $row_data["when"] . "</td>";
return $row;
}