From cf73dcdccfe3e96f04722fdc286a0ddf51db276a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 2 Mar 2019 20:23:07 -0600 Subject: [PATCH] Add additional statistics reporting --- xrdp/xrdp.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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);