Module: nagvis
Branch: master
Commit: 4cdc43940ad2a5511542e3a76a470d65eefc438d
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=4cdc43940ad2a5511542e3a76a470d65eefc438d

Author: unknown <[email protected]>
Date:   Fri Jul 31 13:18:51 2009 +0300

gmap: Added possibility to replace nagios objects in locations.xml

Signed-off-by: unknown <[email protected]>

---

 share/netmap/Location.php |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/share/netmap/Location.php b/share/netmap/Location.php
index 78c8eb1..01696e5 100644
--- a/share/netmap/Location.php
+++ b/share/netmap/Location.php
@@ -143,6 +143,15 @@ class Location
                                $location['label'] = $label;
                                $location['address'] = $address;
                                $location['description'] = $description;
+
+                               // remove all children
+                               unset($location->host);
+                               unset($location->service);
+                               unset($location->hostgroup);
+                               unset($location->servicegroup);
+
+                               $object->toXML($location);
+
                                $success = true;
                                break;
                        }
@@ -151,7 +160,7 @@ class Location
                if (!isset($success))
                        throw new Exception('Location does not exist');
 
-               $location = new Location($id, $point, $label, $address, 
$description);
+               $location = new Location($id, $point, $label, $address, 
$description, $object);
 
                if (file_put_contents('locations.xml', $xml->asXML()) !== FALSE)
                        return $location;


------------------------------------------------------------------------------
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

Reply via email to