This method allows you to create a maintenance as defined by the maintenance data array.
Parameter | Type | Optional | Description | Details |
---|---|---|---|---|
maintenance data | array or object | No | Array of Maintenance objects or a single object | maintenanceid shouldn't be specified |
groupids | array | No | Host group ids | |
hostids | array | No | Host ids |
Parameter | Description |
---|---|
result | Operation successful. Result will contain array of created Maintenance IDs. maintenanceid are assigned to each Maintenance object |
error | In case of any errors |
{
"jsonrpc":"2.0",
"method":"maintenance.create",
"params":[{
"groupids":[],
"hostids":["100100000010229"],
"name":"ZABBIX Servers",
"maintenance_type":"0",
"description":"",
"active_since":"1276163035",
"active_till":"1307698980"
}],
"auth":"038e1d7b1735c6a5436ee9eae095879e",
"id":3
}
Maintenance added successfully:
Maintenance already exists:
{
"jsonrpc":"2.0",
"error":{
"code":-32602,
"message":"Invalid params.",
"data":"[ CMaintenance::create ] Maintenance [ ZABBIX Servers ] already exists"
},
"id":3
}
{
"groupids": [
14
],
"name": "T1",
"maintenance_type": 0,
"description": "",
"active_since": "1276163035",
"active_till": "1307698980",
"timeperiods": [
{
"timeperiod_type": 0,
"start_date": "1307689239",
"period": 7200
}
]
}
{
"groupids": [
14
],
"name": "T2",
"maintenance_type": 0,
"description": "",
"active_since": "1276163035",
"active_till": "1307698980",
"timeperiods": [
{
"timeperiod_type": 2,
"start_time": 39600,
"period": 21720,
"every": 5
}
]
}
{
"groupids": [
14
],
"name": "T3",
"maintenance_type": 0,
"description": "",
"active_since": "1276163035",
"active_till": "1307698980",
"timeperiods": [
{
"timeperiod_type": 3,
"start_time": 39600,
"period": 21720,
"every": 2,
"dayofweek": 3
}
]
}