Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-27095

[API] There is a possibility to add maintenance state via host create/update request

XMLWordPrintable

    • Sprint candidates

      According to the documentation maintenanceid, maintenance_from, maintenance_status and maintenance_type are read-only parameters.

      Precondition:

      • Create host group and maintenance

      Steps to reproduce:

      • Try to create new or update existing host with maintenance parameters e.g.
      Create =>
      {
          "jsonrpc": "2.0",
          "method": "host.create",
          "params":{
              "host": "host_with_maintenance_test",
              "maintenanceid": "{maintenanceid}",
              "maintenance_type": 0,
              "maintenance_status": 1,
              "maintenance_from": 1760094034,
              "groups": [
                  {
                      "groupid": "{groupid}"
                  }
              ]
          },
          "id": 1
      }
      
      Update =>
      {
          "jsonrpc": "2.0",
          "method": "host.update",
          "params":{
              "hostid": "{host_id}",
              "maintenanceid": "{maintenanceid}",
              "maintenance_type": 0,
              "maintenance_status": 1,
              "maintenance_from": 1760094034
          },
          "id": 1
      }
      

      Result: Host is created with maintenance state.


      Expected: read-only parameters should be ignored or validated.

            zabbix.dev Zabbix Development Team
            kseve Kirils Seve
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 0.5h
                0.5h