Module: nagvis Branch: master Commit: 27e3bfd705d138eb7b000a237d4a656d9da5c9f5 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=27e3bfd705d138eb7b000a237d4a656d9da5c9f5
Author: LaMi <[email protected]> Date: Mon Nov 23 10:19:54 2009 +0100 Fixed downtime detail handling for service objects --- .../core/classes/GlobalBackendmklivestatus.php | 44 +++++++++++++++----- 1 files changed, 33 insertions(+), 11 deletions(-) diff --git a/share/server/core/classes/GlobalBackendmklivestatus.php b/share/server/core/classes/GlobalBackendmklivestatus.php index 802828e..239a988 100644 --- a/share/server/core/classes/GlobalBackendmklivestatus.php +++ b/share/server/core/classes/GlobalBackendmklivestatus.php @@ -595,12 +595,23 @@ class GlobalBackendmklivestatus implements GlobalBackendInterface { // This handles only the first downtime. But this is not backend // specific. The other backends do this as well. - $d = $this->queryLivestatusSingle( - "GET downtimes\n". - "Columns: author comment start_time end_time\n" . - "Filter: host_name = ".$e[0]."\n" . - "Filter: service_description = ".$e[1]."\n"); - + + // Handle host/service downtime difference + if(isset($e[15]) && $e[15] > 0) { + // Service downtime + $d = $this->queryLivestatusSingle( + "GET downtimes\n". + "Columns: author comment start_time end_time\n" . + "Filter: host_name = ".$e[0]."\n" . + "Filter: service_description = ".$e[1]."\n"); + } else { + // Host downtime + $d = $this->queryLivestatusSingle( + "GET downtimes\n". + "Columns: author comment start_time end_time\n" . + "Filter: host_name = ".$e[0]."\n"); + } + $arrTmpReturn['downtime_author'] = $d[0]; $arrTmpReturn['downtime_data'] = $d[1]; $arrTmpReturn['downtime_start'] = $d[2]; @@ -823,11 +834,22 @@ class GlobalBackendmklivestatus implements GlobalBackendInterface { // This handles only the first downtime. But this is not backend // specific. The other backends do this as well. - $d = $this->queryLivestatusSingle( - "GET downtimes\n". - "Columns: author comment start_time end_time\n" . - "Filter: host_name = ".$hostName."\n" . - "Filter: service_description = ".$e[0]."\n"); + + // Handle host/service downtime difference + if(isset($e[15]) && $e[15] > 0) { + // Service downtime + $d = $this->queryLivestatusSingle( + "GET downtimes\n". + "Columns: author comment start_time end_time\n" . + "Filter: host_name = ".$hostName."\n" . + "Filter: service_description = ".$e[0]."\n"); + } else { + // Host downtime + $d = $this->queryLivestatusSingle( + "GET downtimes\n". + "Columns: author comment start_time end_time\n" . + "Filter: host_name = ".$hostName."\n"); + } $arrTmpReturn['downtime_author'] = $d[0]; $arrTmpReturn['downtime_data'] = $d[1]; ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
