diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2023-07-25 19:53:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 19:53:28 +0300 |
commit | fd1edfb699ea2572046a8f7189b6f389a3e22840 (patch) | |
tree | 1445a7f35eca50cf65b56885c330d1b0f3f0c8e9 /database/rrdcalc.c | |
parent | 2d23be7b8fff7bc56e431398cf028025edfa7099 (diff) |
Allow to create alert hashes with --disable-cloud (#15519)
* check for alarm ids with zero hashes
* use zeroblob(16)
Diffstat (limited to 'database/rrdcalc.c')
-rw-r--r-- | database/rrdcalc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/database/rrdcalc.c b/database/rrdcalc.c index 4e9873140d..8e41df8d65 100644 --- a/database/rrdcalc.c +++ b/database/rrdcalc.c @@ -82,10 +82,14 @@ uint32_t rrdcalc_get_unique_id(RRDHOST *host, STRING *chart, STRING *name, uint3 alarm_id = sql_get_alarm_id(host, chart, name, next_event_id, config_hash_id); if (!alarm_id) { - if (unlikely(!host->health_log.next_alarm_id)) - host->health_log.next_alarm_id = (uint32_t)now_realtime_sec(); + //check possible stored config hash as zeroes or null + alarm_id = sql_get_alarm_id_check_zero_hash(host, chart, name, next_event_id, config_hash_id); + if (!alarm_id) { + if (unlikely(!host->health_log.next_alarm_id)) + host->health_log.next_alarm_id = (uint32_t)now_realtime_sec(); - alarm_id = host->health_log.next_alarm_id++; + alarm_id = host->health_log.next_alarm_id++; + } } } |