diff --git a/src/zabbix_server/trapper/nodecommand.c b/src/zabbix_server/trapper/nodecommand.c index 739b479d..ffa6eeab 100644 --- a/src/zabbix_server/trapper/nodecommand.c +++ b/src/zabbix_server/trapper/nodecommand.c @@ -498,9 +498,12 @@ static int execute_script(zbx_uint64_t scriptid, zbx_uint64_t hostid, zbx_uint64 goto fail; } + zabbix_log(LOG_LEVEL_DEBUG, "Substituting macros in script command: '%s'", script.command); substitute_macro(script.command, "{MANUALINPUT}", manualinput, &expanded_cmd, &expanded_cmd_size); + zabbix_log(LOG_LEVEL_DEBUG, "Macros substituted: original script body: (%p) '%s', final script body: (%p) '%s'", script.command, script.command, expanded_cmd, expanded_cmd); script.command = zbx_strdup(script.command, expanded_cmd); + zabbix_log(LOG_LEVEL_DEBUG, "Script command replaced: (%p) '%s'", script.command, script.command); zbx_free(expanded_cmd); } @@ -524,6 +527,7 @@ static int execute_script(zbx_uint64_t scriptid, zbx_uint64_t hostid, zbx_uint64 NULL, &host, NULL, NULL, NULL, NULL, NULL, user_timezone, &script.command, macro_type, error, sizeof(error))) { + zabbix_log(LOG_LEVEL_DEBUG, "Simple, unmasked, macro substitution failed"); goto fail; } @@ -531,6 +535,7 @@ static int execute_script(zbx_uint64_t scriptid, zbx_uint64_t hostid, zbx_uint64 NULL, NULL, NULL, NULL, NULL, user_timezone, &script.command_orig, macro_type, error, sizeof(error))) { + zabbix_log(LOG_LEVEL_DEBUG, "Simple macro substitution failed"); THIS_SHOULD_NEVER_HAPPEN; goto fail; }