From c7fd242bd638cd5f962b6539413c3eb8434d0f4e Mon Sep 17 00:00:00 2001 From: Kevin Alberts Date: Sat, 25 Apr 2020 14:43:14 +0200 Subject: [PATCH] Enable output flushing --- collectd_plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/collectd_plugin.py b/collectd_plugin.py index a714086..828785e 100644 --- a/collectd_plugin.py +++ b/collectd_plugin.py @@ -48,10 +48,10 @@ while True: if http_noopen_match: http_current_transfers, http_current_users = 0, 0 - print("PUTVAL \"{}/shares/gague-smb_open_connections\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_current_users)) - print("PUTVAL \"{}/shares/gague-smb_active_users\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_active_users)) - print("PUTVAL \"{}/shares/gague-smb_open_files\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_current_files)) - print("PUTVAL \"{}/shares/gague-http_active_users\" interval={} N:{}".format(HOSTNAME, INTERVAL, http_current_users)) - print("PUTVAL \"{}/shares/gague-http_open_transfers\" interval={} N:{}".format(HOSTNAME, INTERVAL, http_current_transfers)) + print("PUTVAL \"{}/shares/gague-smb_open_connections\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_current_users), flush=True) + print("PUTVAL \"{}/shares/gague-smb_active_users\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_active_users), flush=True) + print("PUTVAL \"{}/shares/gague-smb_open_files\" interval={} N:{}".format(HOSTNAME, INTERVAL, smb_current_files), flush=True) + print("PUTVAL \"{}/shares/gague-http_active_users\" interval={} N:{}".format(HOSTNAME, INTERVAL, http_current_users), flush=True) + print("PUTVAL \"{}/shares/gague-http_open_transfers\" interval={} N:{}".format(HOSTNAME, INTERVAL, http_current_transfers), flush=True) time.sleep(INTERVAL)