Module: nagvis
Branch: master
Commit: 696b75011b7293315c3bfb430d40bb8863c93f68
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=696b75011b7293315c3bfb430d40bb8863c93f68

Author: LaMi <[email protected]>
Date:   Fri Mar 26 20:21:16 2010 +0100

Maybe fixed PHP property access problem when using new livestatus backend

---

 share/server/core/ajax_handler.php                 |   23 ++++++++++++++++++++
 share/server/core/classes/objects/NagiosHost.php   |    2 -
 .../core/classes/objects/NagiosHostgroup.php       |    4 ---
 .../core/classes/objects/NagiosServicegroup.php    |    8 +++---
 4 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/share/server/core/ajax_handler.php 
b/share/server/core/ajax_handler.php
index defbe32..037653a 100644
--- a/share/server/core/ajax_handler.php
+++ b/share/server/core/ajax_handler.php
@@ -22,6 +22,8 @@
  *
  *****************************************************************************/
 
+xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
+
 // Include global defines
 require('../../server/core/defines/global.php');
 require('../../server/core/defines/matches.php');
@@ -159,6 +161,27 @@ try {
 
 echo $sContent;
 if (DEBUG&&DEBUGLEVEL&4) debugFinalize();
+
+$xhprof_data = xhprof_disable();
+
+//
+// Saving the XHProf run
+// using the default implementation of iXHProfRuns.
+//
+include_once "/d/nagvis-dev/src/xhprof-0.9.2/xhprof_lib/utils/xhprof_lib.php";
+include_once "/d/nagvis-dev/src/xhprof-0.9.2/xhprof_lib/utils/xhprof_runs.php";
+
+$xhprof_runs = new XHProfRuns_Default();
+
+// Save the run under a namespace "xhprof_foo".
+//
+// **NOTE**:
+// By default save_run() will automatically generate a unique
+// run id for you. [You can override that behavior by passing
+// a run id (optional arg) to the save_run() method instead.]
+//
+$run_id = $xhprof_runs->save_run($xhprof_data, "nagvis");
+
 exit(1);
 
 ?>
diff --git a/share/server/core/classes/objects/NagiosHost.php 
b/share/server/core/classes/objects/NagiosHost.php
index 5bc9ce0..c0c2f7e 100644
--- a/share/server/core/classes/objects/NagiosHost.php
+++ b/share/server/core/classes/objects/NagiosHost.php
@@ -497,8 +497,6 @@ class NagiosHost extends NagVisStatefulObject {
                        
                        // Also get summary state
                        $OBJ->fetchSummaryState();
-                       
-                       // At least summary output
                        $OBJ->fetchSummaryOutput();
                        
                        $this->members[] = $OBJ;
diff --git a/share/server/core/classes/objects/NagiosHostgroup.php 
b/share/server/core/classes/objects/NagiosHostgroup.php
index b73e139..95647f3 100644
--- a/share/server/core/classes/objects/NagiosHostgroup.php
+++ b/share/server/core/classes/objects/NagiosHostgroup.php
@@ -247,10 +247,6 @@ class NagiosHostgroup extends NagVisStatefulObject {
                                // object classes.
                                
$OBJ->setConfiguration($this->getObjectConfiguration());
                                
-                               // Also get summary state
-                               $OBJ->summary_state = $OBJ->state;
-                               $OBJ->summary_output = $OBJ->output;
-                               
                                // Put state counts to the object
                                if(isset($aServiceStateCounts[$aHost['name']])) 
{
                                        
$OBJ->setStateCounts($aServiceStateCounts[$aHost['name']]);
diff --git a/share/server/core/classes/objects/NagiosServicegroup.php 
b/share/server/core/classes/objects/NagiosServicegroup.php
index 3fb960a..a67f3e5 100644
--- a/share/server/core/classes/objects/NagiosServicegroup.php
+++ b/share/server/core/classes/objects/NagiosServicegroup.php
@@ -197,6 +197,10 @@ class NagiosServicegroup extends NagVisStatefulObject {
                        foreach($aServices AS $aService) {
                                $OBJ = new NagVisService($this->CORE, 
$this->BACKEND, $this->backend_id, $aService['host'], $aService['description']);
                                
+                               // Also get summary state
+                               $aService['summary_state'] = $OBJ->getState();
+                               $aService['summary_output'] = $OBJ->getOutput();
+                               
                                // Append contents of the array to the object 
properties
                                $OBJ->setObjectInformation($aService);
                                
@@ -206,10 +210,6 @@ class NagiosServicegroup extends NagVisStatefulObject {
                                // object classes.
                                
$OBJ->setConfiguration($this->getObjectConfiguration());
                                
-                               // Also get summary state
-                               $OBJ->summary_state = $OBJ->state;
-                               $OBJ->summary_output = $OBJ->output;
-                               
                                // Add child object to the members array
                                $this->members[] = $OBJ;
                        }


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to