- log(DEBUG,"HTTP URL!");
-
- data << "<HTML><HEAD>";
- data << "<TITLE>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</TITLE>";
- data << "</HEAD><BODY>";
- data << "<H1>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</H1>";
-
- data << "<DIV ID='TOTALS'>";
- data << "<H2>Totals</H2>";
- data << "<TABLE>";
- data << "<TR><TD>Users</TD><TD>" << clientlist.size() << "</TD></TR>";
- data << "<TR><TD>Channels</TD><TD>" << chanlist.size() << "</TD></TR>";
- data << "<TR><TD>Opers</TD><TD>" << all_opers.size() << "</TD></TR>";
- data << "<TR><TD>Sockets</TD><TD>" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << " (Max: " << ServerInstance->SE->GetMaxFds() << " via socket engine '" << ServerInstance->SE->GetName() << "')</TD></TR>";
- data << "</TABLE>";
- data << "</DIV>";
-
- data << "<DIV ID='MODULES'>";
- data << "<H2>Modules</H2>";
- data << "<TABLE>";
- for (int i = 0; i <= MODCOUNT; i++)
+ data << "<inspircdstats>";
+
+ data << "<server><name>" << ServerInstance->Config->ServerName << "</name><gecos>" << Sanitize(ServerInstance->Config->ServerDesc) << "</gecos></server>";
+
+ data << "<general>";
+ data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
+ data << "<channelcount>" << ServerInstance->chanlist->size() << "</channelcount>";
+ data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>";
+ data << "<socketcount>" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << "</socketcount><socketmax>" << ServerInstance->SE->GetMaxFds() << "</socketmax><socketengine>" << ServerInstance->SE->GetName() << "</socketengine>";
+
+ time_t current_time = 0;
+ current_time = ServerInstance->Time();
+ time_t server_uptime = current_time - ServerInstance->startup_time;
+ struct tm* stime;
+ stime = gmtime(&server_uptime);
+ data << "<uptime><days>" << stime->tm_yday << "</days><hours>" << stime->tm_hour << "</hours><mins>" << stime->tm_min << "</mins><secs>" << stime->tm_sec << "</secs><boot_time_t>" << ServerInstance->startup_time << "</boot_time_t></uptime>";
+
+
+ data << "</general>";
+ data << "<modulelist>";
+ std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
+
+ for (std::vector<std::string>::iterator i = module_names.begin(); i != module_names.end(); ++i)