Repository navigation
v1.40
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.pycreates 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.pythen sends every object of the server back through its ownX.updateunchanged, 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 functionfor an interface'savailable/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 byscripts/build_write_contracts.pyintosrc/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/*_updatecall 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 touserid,hostprototype.templates[]down totemplateid,maintenance.hosts[]down tohostid, triggerdependencies[]down totriggerid), the sub-objects aselectXxxproduced (hosts,triggers,graphs,discoveryRule,valuemap,parentTemplates), the host columns a template or an LLD rule returns because it shares the table (tls_accepton a template,value_typeon an LLD rule), and on 7.0 the deprecated twin of a renamed field returned next to the new one (content_type/message_formaton a media type,rights/hostgroup_rightson a user group). A create keeps the fields an update refuses only because the object already has them (hostidonitem.create,imagetypeonimage.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 = falseturns it off;zabbix_raw_api_callis never touched. The tool descriptions of the affected*_update/*_createtools say so in one sentence. trigger_getandtriggerprototype_getexpand the expression by default. WithoutexpandExpressionZabbix returns{33806}>{$THRESHOLD}, a form a model can neither read nor send back throughtrigger_update(incorrect expression starting from "{33806}..."). PassexpandExpression: falseinextra_paramsfor the raw form.
Fixed
- Nested action identifiers (#101, #102 by @alexpostnik):
opconditions[].opconditionid/operationid,opcommand_hst[].opcommand_hstidandopcommand_grp[].opcommand_grpidare dropped beforeaction.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 breaksevaltype3, 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-onlyeval_formula. - A regular expression's
exp_delimiteris kept only on the delimited expression type (1, "any character string included");regexp.getreturns the stored,on every type andregexp.updaterefuses it elsewhere (value must be empty). report_updateturnedactive_since/active_tillinto epochs since v1.37.4's ISO 8601 conversion, whilereport.*take and return them asYYYY-MM-DDstrings (a character string is expected); the two fields now pass through unchanged on report methods.- Discard-unchanged preprocessing steps lost their
error_handleron 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.mdand the pull request template named a pytest command the repository cannot run; they now give theunittestcommand the suite uses. Theconfiguration_export/_importrow 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.pydrives 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 throughitem_update, release decides, raw call untouched, switch off), theexpandExpressiondefault, the conditional LLD and regexp rules and the config switch; the nested action identifiers from #102 asunittestcases intests/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), theguestuser's language, the read-onlySuper admin role, and a media type whose stored configuration is itself incomplete (Gmailwith an empty username); on 6.x additionally two platform quirks, a host prototype's interfaces listed byhostinterface.get(not updatable) and one stock graph with items from two hosts. Python 3.10 verified; installer matrix 18/18;install.sh updatefrom v1.39 on a clean container.