From f7d7a9728ed88990c42b11c71eb8bc7bf7ee1dbd Mon Sep 17 00:00:00 2001 From: liu0x54 Date: Wed, 10 Jun 2020 10:41:12 +0000 Subject: [PATCH] [TD-580] add the config audit record --- src/modules/monitor/src/monitorSystem.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/modules/monitor/src/monitorSystem.c b/src/modules/monitor/src/monitorSystem.c index 560a91e13f..eefc88a6e7 100644 --- a/src/modules/monitor/src/monitorSystem.c +++ b/src/modules/monitor/src/monitorSystem.c @@ -216,9 +216,6 @@ void monitorInitDatabase() { taos_query_a(monitor->conn, monitor->sql, monitorInitDatabaseCb, NULL); } else { monitor->state = MONITOR_STATE_INITIALIZED; - monitorPrint("monitor service init success"); - aLPrint(AUDIT_INFO, "system","success", "Database Started!"); - monitorStartTimer(); } } @@ -239,6 +236,22 @@ void monitorInitDatabaseCb(void *param, TAOS_RES *result, int code) { monitor->state = MONITOR_STATE_UN_INIT; monitorStartSystemRetry(); } + + + aLPrint(AUDIT_INFO, "system","success", "Database Started!"); + char content[80] = {0}; + sprintf(content, " Set the max auth retry: %d ", tsMaxAuthRetry); + aLPrint(AUDIT_INFO, "system", "success", content); + + if (tsEnableMonitorModule == 1) { + sprintf(content, " audit is on "); + } else { + sprintf(content, " audit is off "); + } + aLPrint(AUDIT_INFO, "system", "success", content); + + monitorStartTimer(); + aLPrint(AUDIT_INFO, "system","success", "Database Started!"); } void monitorStopSystem() { @@ -446,6 +459,7 @@ void monitorSaveLog(int level, const char *const format, ...) { return; } + int len = snprintf(sql, (size_t)max_length, "import into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName, taosGetTimestampUs(), level); -- GitLab