|
|
|
|
@ -10,6 +10,8 @@ check_authentication(false);
|
|
|
|
|
|
|
|
|
|
generate_report();
|
|
|
|
|
|
|
|
|
|
$filter_services = array("plugin timed out");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function generate_report()
|
|
|
|
|
{
|
|
|
|
|
@ -24,6 +26,9 @@ Light Mode – Night
|
|
|
|
|
The report would show:
|
|
|
|
|
|
|
|
|
|
Host Name, Host Address, Service Description, Status Information, and Duration (hours)
|
|
|
|
|
|
|
|
|
|
Addendum:
|
|
|
|
|
We would need the services that have "CRITICAL - Plugin timed out while executing system call" as the status to be filtered out
|
|
|
|
|
*/
|
|
|
|
|
$default_services = "
|
|
|
|
|
Day Mode
|
|
|
|
|
@ -43,7 +48,6 @@ Host Name, Host Address, Service Description, Status Information, and Duration (
|
|
|
|
|
$service_array = array_map(function($el) { return trim($el); }, $service_array);
|
|
|
|
|
$service_array = array_filter($service_array, function($el) { return !empty($el); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do_page_start(array("page_title" => "Non-OK Services Report"), true);
|
|
|
|
|
echo '
|
|
|
|
|
<form method="get">
|
|
|
|
|
@ -98,6 +102,7 @@ Host Name, Host Address, Service Description, Status Information, and Duration (
|
|
|
|
|
function get_objects_down_services($services, $hours, $return_headers = true)
|
|
|
|
|
{
|
|
|
|
|
$arr = array();
|
|
|
|
|
global $filter_services;
|
|
|
|
|
|
|
|
|
|
if (!is_array($services)) {
|
|
|
|
|
echo "passed variable to get_objects_down_services() must be an array of service names\n";
|
|
|
|
|
@ -138,6 +143,16 @@ function get_objects_down_services($services, $hours, $return_headers = true)
|
|
|
|
|
$svc_arr['svc_desc'] = (string) $svc->name;
|
|
|
|
|
$svc_arr['svc_status'] = (string) $svc->status_text;
|
|
|
|
|
|
|
|
|
|
$match_filter = false;
|
|
|
|
|
foreach ($filter_services as $filter) {
|
|
|
|
|
if (strpos(strtolower($svc_arr["svc_status"]), strtolower($filter)) !== false) {
|
|
|
|
|
$match_filter = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($match_filter == true) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$state_change_time = strtotime($svc->last_state_change);
|
|
|
|
|
|
|
|
|
|
// something went wrong with strtotime..
|
|
|
|
|
|