diff options
author | Timothy Pearson <tpearson@raptorengineering.com> | 2019-03-02 20:23:07 -0600 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-03-02 20:23:07 -0600 |
commit | cf73dcdccfe3e96f04722fdc286a0ddf51db276a (patch) | |
tree | 355a3f9836927719767d9873d7316f5b060dbb6b | |
parent | c5bab5b98a826ef472cd9b814d2dfee2dc76ed20 (diff) | |
download | xrdp-proprietary-cf73dcdccfe3e96f04722fdc286a0ddf51db276a.tar.gz xrdp-proprietary-cf73dcdccfe3e96f04722fdc286a0ddf51db276a.zip |
Add additional statistics reporting
-rw-r--r-- | xrdp/xrdp.c | 21 |
1 files changed, 21 insertions, 0 deletions
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 <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); |