From 7eda9364fd93906d6657e720681e8c079cb2ce1e Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 23 Apr 2010 10:51:27 -0400 Subject: [PATCH 1/2] Adding LinkUp/LinkDown when a region is started or stoped. Those two events could be used to compute the region availibility --- OpenSim/Region/Application/OpenSimBase.cs | 5 ++--- OpenSim/Region/Framework/Interfaces/ISnmpModule.cs | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f3aaa76f56..06bb886158 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -350,11 +350,9 @@ namespace OpenSim if (scene.SnmpService != null) { scene.SnmpService.ColdStart(1,scene); + scene.SnmpService.LinkDown(scene); } -// it should be a LinkDown event -// Maped inside opennms -// bad... if (scene.SnmpService != null) { scene.SnmpService.Warning("Loading prins", scene); @@ -439,6 +437,7 @@ namespace OpenSim if (scene.SnmpService != null) { scene.SnmpService.Warning("The region is operational", scene); + scene.SnmpService.LinkUp(scene); } scene.StartTimer(); diff --git a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs index 8a83fe986a..cc313221a2 100644 --- a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs @@ -15,4 +15,9 @@ public interface ISnmpModule void Major(string Message, Scene scene); void ColdStart(int step , Scene scene); void Shutdown(int step , Scene scene); + // + // Node Start/stop events + // + void LinkUp(Scene scene); + void LinkDown(Scene scene); } From 85646b157ce0e07ef37e41de72b553bb377243e1 Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 23 Apr 2010 12:40:27 -0400 Subject: [PATCH 2/2] Adding some more SNMP events and some refactoring Signed : The Masqued Foxi --- OpenSim/Region/Application/OpenSimBase.cs | 21 ++++++++++++------- .../Framework/Interfaces/ISnmpModule.cs | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 06bb886158..1ec96a01a2 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -355,7 +355,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("Loading prins", scene); + scene.SnmpService.BootInfo("Loading prins", scene); } // Prims have to be loaded after module configuration since some modules may be invoked during the load @@ -363,7 +363,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("Creating region texture", scene); + scene.SnmpService.BootInfo("Creating region texture", scene); } // moved these here as the terrain texture has to be created after the modules are initialized @@ -375,8 +375,8 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("Grid Registration in progress", scene); - } + scene.SnmpService.BootInfo("Grid Registration in progress", scene); + } try { scene.RegisterRegionWithGrid(); @@ -396,7 +396,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("Grid Registration done", scene); + scene.SnmpService.BootInfo("Grid Registration done", scene); } // We need to do this after we've initialized the @@ -408,7 +408,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("ScriptEngine started", scene); + scene.SnmpService.BootInfo("ScriptEngine started", scene); } m_sceneManager.Add(scene); @@ -421,7 +421,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("Initializing region modules", scene); + scene.SnmpService.BootInfo("Initializing region modules", scene); } if (do_post_init) { @@ -436,7 +436,7 @@ namespace OpenSim if (scene.SnmpService != null) { - scene.SnmpService.Warning("The region is operational", scene); + scene.SnmpService.BootInfo("The region is operational", scene); scene.SnmpService.LinkUp(scene); } @@ -448,6 +448,11 @@ namespace OpenSim private void ShutdownRegion(Scene scene) { m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); + if (scene.SnmpService != null) + { + scene.SnmpService.BootInfo("The region is shutting down", scene); + scene.SnmpService.LinkDown(scene); + } IRegionModulesController controller; if (ApplicationRegistry.TryGet(out controller)) { diff --git a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs index cc313221a2..16a243c2b1 100644 --- a/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISnmpModule.cs @@ -20,4 +20,5 @@ public interface ISnmpModule // void LinkUp(Scene scene); void LinkDown(Scene scene); + void BootInfo(string data, Scene scene); }