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

Can't Update timeperiod via api

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 2.2.17
    • API (A)
    • None

      I am trying to update timeperiod via api and i have been given this response.

      string(134) "{"jsonrpc":"2.0","error":
      {"code":-32602,"message":"Invalid params.","data":"At least one maintenance period must be created."}
      ,"id":1}"
      

       
      The following is being sent to Zabbix api

      $result = $this->sendRequest("maintenance.update",array(
       "maintenanceid" => $id,
       "name" => "test api",
       "maintenance_type" => 0,
       "description" =>"test api",
       "active_since"=> $t->start_date,
       "active_till" => $t->start_date+$t->period,
       "groups" => array(),
       "timeperiods" => array(
       "timeperiodid" => $t->timeperiodid, 
       "timeperiod_type" => 0,
       //"every" => 1,
       //"month"=> "0",
       //"dayofweek" => "0",
       //"day" => "1",
       //"start_time" => "43200",
       "period" => $t->period,
       "start_date" => $t->start_date, 
       ),
      ));
      

      Many Thanks for any advise.

      The maitennace and period is already setup in Zabbix using frontend.

      The api is to update pre existing timeperiod with new values.

      I have also tried to comment timeperiod id and it did not worked as well.

      Many Thanks
      Raf

            Unassigned Unassigned
            ber5ien Rafal Zdziech
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: