Module: nagvis Branch: master Commit: 6bc82b0b7e34aba447e18c552d23ce3a59f21968 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=6bc82b0b7e34aba447e18c552d23ce3a59f21968
Author: Roman Kyrylych <[email protected]> Date: Wed Jul 29 14:00:47 2009 +0300 backends: Implemented getObjectsEx in Merlin backend Signed-off-by: Roman Kyrylych <[email protected]> --- .../includes/classes/GlobalBackendmerlinmy.php | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/share/nagvis/includes/classes/GlobalBackendmerlinmy.php b/share/nagvis/includes/classes/GlobalBackendmerlinmy.php index ea31f29..318fb36 100644 --- a/share/nagvis/includes/classes/GlobalBackendmerlinmy.php +++ b/share/nagvis/includes/classes/GlobalBackendmerlinmy.php @@ -248,6 +248,23 @@ class GlobalBackendmerlinmy implements GlobalBackendInterface { */ public function getObjectsEx($type) { $ret = Array(); + + if($type == 'host') { + $QUERYHANDLE = $this->mysqlQuery('SELECT id, host_name AS name, address FROM host ORDER BY host_name'); + } elseif($type == 'service') { + $QUERYHANDLE = $this->mysqlQuery('SELECT id, host_name AS host, service_description AS description FROM service ORDER BY host_name'); + elseif(in_array($type, array('hostgroup', 'servicegroup'))) { + $QUERYHANDLE = $this->mysqlQuery("SELECT id, {$type}_name AS name, alias FROM $type ORDER BY {$type}_name"); + } else { + return Array(); + } + + while($data = mysql_fetch_array($QUERYHANDLE, MSQL_ASSOC)) { + $ret[] = $data; + } + + // Free memory + mysql_free_result($QUERYHANDLE); return $ret; } ------------------------------------------------------------------------------ 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
