diff options
author | Alex Kalimulin <aleksandrs.kalimulins@zabbix.com> | 2021-05-10 20:32:12 +0300 |
---|---|---|
committer | Alex Kalimulin <aleksandrs.kalimulins@zabbix.com> | 2021-05-10 20:32:27 +0300 |
commit | 3d8fef5b8418e66e05747abeef814ab1f7f94c9d (patch) | |
tree | e52f4a54e074fcd11800fb444d75b63f43930b1c /src | |
parent | e2f2e6e24fc3b4fb887e468949d61b3ba1aa4cb2 (diff) |
.......... [ZBXNEXT-6411] removed conversion of SNMPv1 template suffix for seeds; updated templates.tmpl
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/zbxdbupgrade/dbupgrade_5030.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/libs/zbxdbupgrade/dbupgrade_5030.c b/src/libs/zbxdbupgrade/dbupgrade_5030.c index d86adc8d289..37898d5a5c1 100644 --- a/src/libs/zbxdbupgrade/dbupgrade_5030.c +++ b/src/libs/zbxdbupgrade/dbupgrade_5030.c @@ -6517,8 +6517,7 @@ static int DBpatch_5030189(void) static char *update_template_name(char *old) { - char *ptr, new[MAX_STRING_LEN], *ptr_snmp, buffer[7]; - int version; + char *ptr, new[MAX_STRING_LEN], *ptr_snmp; #define MIN_TEMPLATE_NAME_LEN 3 #define STRING_SNMP_LABEL "SNMP" @@ -6532,13 +6531,9 @@ static char *update_template_name(char *old) ptr = zbx_strdup(ptr, new); } - for (version = 1; version <= 2; version++) - { - zbx_snprintf(buffer, sizeof(buffer), "%sv%d", STRING_SNMP_LABEL, version); - ptr_snmp = string_replace(ptr, buffer, STRING_SNMP_LABEL); - zbx_free(ptr); - ptr = ptr_snmp; - } + ptr_snmp = string_replace(ptr, "SNMPv2", STRING_SNMP_LABEL); + zbx_free(ptr); + ptr = ptr_snmp; return ptr; } @@ -6700,8 +6695,6 @@ static int DBpatch_5030192(void) trigger_expr = zbx_strdup(NULL, row[i + 2]); - zabbix_log(LOG_LEVEL_DEBUG, "%s: trigger expression: %s", __func__, trigger_expr); - if ('\0' == *trigger_expr) { if (0 == i) @@ -6756,8 +6749,6 @@ static int DBpatch_5030192(void) zbx_eval_compose_expression(&ctx, &composed_expr[i]); zbx_eval_clear(&ctx); - zabbix_log(LOG_LEVEL_DEBUG, "%s: result expression '%s'", __func__, composed_expr[i]); - zbx_free(trigger_expr); } @@ -6766,8 +6757,6 @@ static int DBpatch_5030192(void) if (NULL != composed_expr[1]) zbx_snprintf_alloc(&seed, &seed_alloc, &seed_offset, "/%s", composed_expr[1]); - zabbix_log(LOG_LEVEL_DEBUG, "%s: seed: %s", __func__, seed); - uuid = zbx_gen_uuid4(seed); zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "update triggers set uuid='%s'" " where triggerid=%s;\n", uuid, row[0]); @@ -7145,8 +7134,6 @@ static int DBpatch_5030199(void) trigger_expr = zbx_strdup(NULL, row[i + 2]); - zabbix_log(LOG_LEVEL_DEBUG, "trigger expression: %s", trigger_expr); - if ('\0' == *trigger_expr) { if (0 == i) @@ -7201,8 +7188,6 @@ static int DBpatch_5030199(void) zbx_eval_compose_expression(&ctx, &composed_expr[i]); zbx_eval_clear(&ctx); - zabbix_log(LOG_LEVEL_DEBUG, "result expression '%s'", composed_expr[i]); - zbx_free(trigger_expr); } @@ -7211,8 +7196,6 @@ static int DBpatch_5030199(void) if (NULL != composed_expr[1]) zbx_snprintf_alloc(&seed, &seed_alloc, &seed_offset, "/%s", composed_expr[1]); - zabbix_log(LOG_LEVEL_DEBUG, "seed: %s", seed); - uuid = zbx_gen_uuid4(seed); zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "update triggers set uuid='%s'" " where triggerid=%s;\n", uuid, row[0]); |