Skip to content

v1.40

Choose a tag to compare

@hermanekt hermanekt released this 19 Oct 22:17
· 13 commits to main since this release
3e34d86

v1.40 - 2026-10-19

The round-trip release. Two days after v1.39, #101 (@alexpostnik, with the fix in #102) showed that the v1.39 action cleanup had missed the row identifiers inside operation conditions and command targets, because the actions it was verified against had neither. The fix is the first commit of this release, under its author's name. The report also raised the wider question, which this release answers by measurement rather than by reading the documentation: for every object the server can update, what does X.get return that X.update refuses?

Added

  • An object copied from any get tool can be sent back through its update tool (#101). scripts/roundtrip_fixtures.py creates an object of every kind with every optional sub-structure filled (52 to 63 objects per release: actions of all five event sources with conditions, escalations and command targets, an LLD rule with a custom-expression filter, overrides and macro paths, a maintenance with all four time period kinds, a web scenario with steps, a map with links and shapes, a dashboard with pages and shares, a user directory with provisioning, ...); scripts/audit_write_roundtrip_live.py then sends every object of the server back through its own X.update unchanged, drops each refused key and tries again until the update is accepted, telling a key refused on every row that has it (read-only) from one refused on some rows only (it depends on the row's values and stays), and bisecting the refusals Zabbix reports without naming a key (Incorrect arguments passed to function for an interface's available / error / errors_from / disable_until). Run on 6.0.48, 6.2.9, 6.4.21, 7.0.30, 7.2.15 and 7.4.14 (6 000 to 20 000 API calls per release), merged by scripts/build_write_contracts.py into src/zabbix_mcp/api/write_contracts.json: 38 update methods and their 31 creates, 818 paths, each carrying the releases it applies to where the releases differ. Before every *_create / *_update call the server drops exactly those keys: read-only columns (templateid, flags, state, error, lastclock, lastvalue, uuid), row identifiers and parent references inside nested arrays (tags[].automatic, steps[].httptestid, macros[].hostid), the full objects a get echoes where the update takes an id (usergroup.users[] down to userid, hostprototype.templates[] down to templateid, maintenance.hosts[] down to hostid, trigger dependencies[] down to triggerid), the sub-objects a selectXxx produced (hosts, triggers, graphs, discoveryRule, valuemap, parentTemplates), the host columns a template or an LLD rule returns because it shares the table (tls_accept on a template, value_type on an LLD rule), and on 7.0 the deprecated twin of a renamed field returned next to the new one (content_type / message_format on a media type, rights / hostgroup_rights on a user group). A create keeps the fields an update refuses only because the object already has them (hostid on item.create, imagetype on image.create). Nothing a caller could have meant is dropped: a value the model changed, an explicit empty array, a key whose refusal depends on the object's state, and a field an update refuses only on a templated or discovered object, where Zabbix's own message (Cannot update "expression" for a templated trigger) is what the model needs to hear. [server].strip_write_params = false turns it off; zabbix_raw_api_call is never touched. The tool descriptions of the affected *_update / *_create tools say so in one sentence.
  • trigger_get and triggerprototype_get expand the expression by default. Without expandExpression Zabbix returns {33806}>{$THRESHOLD}, a form a model can neither read nor send back through trigger_update (incorrect expression starting from "{33806}..."). Pass expandExpression: false in extra_params for the raw form.

Fixed

  • Nested action identifiers (#101, #102 by @alexpostnik): opconditions[].opconditionid / operationid, opcommand_hst[].opcommand_hstid and opcommand_grp[].opcommand_grpid are dropped before action.create / action.update; refused on 6.0.48, 7.0.30 and 7.4.14 alike.
  • An LLD rule filter with a custom expression lost its formulaids: the server dropped them on every create / update since v1.14, which is right for And/Or filters and breaks evaltype 3, where Zabbix requires them. They are now dropped only without a custom expression, on the rule's filter and on every override filter, together with the read-only eval_formula.
  • A regular expression's exp_delimiter is kept only on the delimited expression type (1, "any character string included"); regexp.get returns the stored , on every type and regexp.update refuses it elsewhere (value must be empty).
  • report_update turned active_since / active_till into epochs since v1.37.4's ISO 8601 conversion, while report.* take and return them as YYYY-MM-DD strings (a character string is expected); the two fields now pass through unchanged on report methods.
  • Discard-unchanged preprocessing steps lost their error_handler on the way to Zabbix, which 7.x accepts and 6.x refuses (Item pre-processing is missing parameters: error_handler, error_handler_params); the step now carries the default handler (0, "") on every release, and a custom one, refused everywhere on those types, is reset to it.
  • CONTRIBUTING.md and the pull request template named a pytest command the repository cannot run; they now give the unittest command the suite uses. The configuration_export / _import row of the tools table says what the export covers and that it is not a database backup (#103, the rest of which we declined as operator policy rather than server documentation).

Tests

  • TEST_COUNT unit + e2e tests, all passing (NEW_TEST_COUNT new: tests/test_write_contracts.py drives the strip with a synthetic contract (top-level, nested and array paths, release markers, bulk payloads, odd shapes), checks the shipped contract (every method exists, every path is well formed, a create never drops a documented create field, the facts the audits established), the registered tools (dropped through item_update, release decides, raw call untouched, switch off), the expandExpression default, the conditional LLD and regexp rules and the config switch; the nested action identifiers from #102 as unittest cases in tests/test_action_payload.py). Live: the audit on six releases with the fixture set created and deleted on each; every object of every kind on the six releases (the fixtures plus what each box had, 400 to 1 200 distinct shapes per release) sent back through the MCP server's own get and update tools, with four classes of refusal left over on purpose because they are Zabbix's own and the model needs the message: a templated or discovered object (Cannot update a templated graph), the guest user's language, the read-only Super admin role, and a media type whose stored configuration is itself incomplete (Gmail with an empty username); on 6.x additionally two platform quirks, a host prototype's interfaces listed by hostinterface.get (not updatable) and one stock graph with items from two hosts. Python 3.10 verified; installer matrix 18/18; install.sh update from v1.39 on a clean container.