diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-01-17 12:32:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 12:32:44 +0200 |
commit | 3296f78436ce1f474cd38de7e842df6cf2f1f112 (patch) | |
tree | 935e5d9a8d1a9c3f5e96442a952f9af1698df96a /health/health.c | |
parent | 8c201ccadf298ccea5cc85a3aede72f8e3843fed (diff) |
Add localhost hostname to the edit_command (#11793)
* include localhost hostname in edit_command
* since the edit_command now contains the localhost name, dont pass it again to the script
Diffstat (limited to 'health/health.c')
-rw-r--r-- | health/health.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/health/health.c b/health/health.c index 820af93f38..7bb05233cd 100644 --- a/health/health.c +++ b/health/health.c @@ -350,9 +350,9 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) { } } - char *edit_command = ae->source ? health_edit_command_from_source(ae->source) : strdupz("UNKNOWN=0"); + char *edit_command = ae->source ? health_edit_command_from_source(ae->source) : strdupz("UNKNOWN=0=UNKNOWN"); - snprintfz(command_to_run, ALARM_EXEC_COMMAND_LENGTH, "exec %s '%s' '%s' '%u' '%u' '%u' '%lu' '%s' '%s' '%s' '%s' '%s' '" CALCULATED_NUMBER_FORMAT_ZERO "' '" CALCULATED_NUMBER_FORMAT_ZERO "' '%s' '%u' '%u' '%s' '%s' '%s' '%s' '%s' '%s' '%d' '%d' '%s' '%s' '%s' '%s' '%s'", + snprintfz(command_to_run, ALARM_EXEC_COMMAND_LENGTH, "exec %s '%s' '%s' '%u' '%u' '%u' '%lu' '%s' '%s' '%s' '%s' '%s' '" CALCULATED_NUMBER_FORMAT_ZERO "' '" CALCULATED_NUMBER_FORMAT_ZERO "' '%s' '%u' '%u' '%s' '%s' '%s' '%s' '%s' '%s' '%d' '%d' '%s' '%s' '%s' '%s'", exec, recipient, host->registry_hostname, @@ -381,8 +381,7 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) { buffer_tostring(warn_alarms), buffer_tostring(crit_alarms), ae->classification?ae->classification:"Unknown", - edit_command, - localhost->registry_hostname + edit_command ); ae->flags |= HEALTH_ENTRY_FLAG_EXEC_RUN; |