From cedd827f7f0174ef152a6e2216a706070792301e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 12 Nov 2009 11:17:04 +1100 Subject: * Added some new syntax options for the Monitor Module's HTTP poll. --- .../Framework/Monitoring/MonitorModule.cs | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index b6a2025..11aca99 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -52,6 +52,36 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring public Hashtable StatsPage(Hashtable request) { + // If request was for a specific monitor + // eg url/?monitor=Monitor.Name + if (request.ContainsKey("monitor")) + { + string monID = (string) request["monitor"]; + + foreach (IMonitor monitor in m_monitors) + { + if (monitor.ToString() == monID) + { + Hashtable ereply3 = new Hashtable(); + + ereply3["int_response_code"] = 404; // 200 OK + ereply3["str_response_string"] = monitor.GetValue().ToString(); + ereply3["content_type"] = "text/plain"; + + return ereply3; + } + } + + // No monitor with that name + Hashtable ereply2 = new Hashtable(); + + ereply2["int_response_code"] = 404; // 200 OK + ereply2["str_response_string"] = "No such monitor"; + ereply2["content_type"] = "text/plain"; + + return ereply2; + } + string xml = ""; foreach (IMonitor monitor in m_monitors) { -- cgit v1.1