Add additional statistics reporting

master
Timothy Pearson 5 years ago
parent c5bab5b98a
commit cf73dcdccf

@ -26,6 +26,9 @@
#include "log.h"
#include "xrdp_configure_options.h"
#include <netdb.h>
#include "libraptorsmiface.h"
#if !defined(PACKAGE_VERSION)
#define PACKAGE_VERSION "???"
#endif
@ -641,6 +644,17 @@ main(int argc, char **argv)
/* end of daemonizing code */
}
// Update statistics
char hostname[512];
gethostname(hostname, 512);
struct hostent* hostinfo;
if((hostinfo=gethostbyname(hostname))) {
raptor_sm_stats_report_server_start(hostinfo->h_name);
}
else {
raptor_sm_stats_report_server_start(hostname);
}
g_threadid = tc_get_threadid();
g_listen = xrdp_listen_create();
g_signal_user_interrupt(xrdp_shutdown); /* SIGINT */
@ -686,6 +700,13 @@ main(int argc, char **argv)
log_end();
g_deinit();
if (hostinfo) {
raptor_sm_stats_report_server_stop(hostinfo->h_name);
}
else {
raptor_sm_stats_report_server_stop(hostname);
}
if (exit_status == 0)
{
g_exit(0);

Loading…
Cancel
Save