diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index d2643e98..e5316de9 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -26,6 +26,9 @@ #include "log.h" #include "xrdp_configure_options.h" +#include +#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);