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

Cannot use Maintenance.update

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 6.0.2
    • API (A), Documentation (D)
    • None
    • Windows

      We had some automated maintenance scripts to put things in maintenance during updates or code rolls and after upgrading to 6.0 they stopped working.
      The weird thing is that the update call won't accept any "timeperiods" with out complaining that "timeperiods" is an invalid parameter.
      So a request like this:

      {
          "method":  "maintenance.update",
          "params":  {
                         "active_since":  "1635397200",
                         "maintenanceid":  "252",
                         "name":  "Portal Even",
                         "description":  "",
                         "maintenance_type":  "0",
                         "groupids":  [
                                          322
                                      ],
                         "timeperiods":  [
                                             {
                                                 "timeperiod_type":  "0",
                                                 "every":  "1",
                                                 "month":  "0",
                                                 "dayofweek":  "0",
                                                 "day":  "1",
                                                 "start_time":  "0",
                                                 "period":  "300",
                                                 "start_date":  "1635423480"
                                             }
                         ],
                         "active_till":  "2140491600"
                     },
          "id":  1,
          "jsonrpc":  "2.0",
          "auth":  "XXXXXXXXXXXXX"
      } 

      Fails with the error:

      {
          "jsonrpc": "2.0",
          "error": {
              "code": -32602,
              "message": "Invalid params.",
              "data": "Invalid parameter \"/1/timeperiods/1\": unexpected parameter \"start_time\"."
          },
          "id": 1
      } 

      If I remove start_time it complains about the next parameter and so on. If I remove "timeperiods" the request succeeds.
      I did see that there were changes to update and to the maintenance object that were tied to ZBXNEXT-6890 
      So it looks like Hosts becomes HostIds and Groups became GroupIds and the timeperiod object no longer has timeperiodid. I believe my request should be valid so I think this might be a bug. 

            zabbix.dev Zabbix Development Team
            ericallenpaul Eric Paul
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: