< Back

Set-ZabbixMaintenance

Sun Jan 19, 2020 6:15 pm

NAME Set-ZabbixMaintenance



SYNOPSIS

Set/update maintenance settings





SYNTAX

Set-ZabbixMaintenance [-MaintenanceName] <String> [-MaintenanceID] <String> [[-GroupID] <Array>] [[-HostID]

<Array>] [[-groups] <Array>] [[-hosts] <Array>] [[-timeperiods] <Array>] [[-MaintenanceDescription] <String>]

[[-MaintenanceType] <Int32>] [-ActiveSince] <Object> [-ActiveTill] <Object> [[-TimeperiodPeriod] <Int32>]

[[-TimePeriodType] <Int32>] [[-TimeperiodStartTime] <Int32>] [[-TimeperiodStartDate] <Object>] [[-TimeperiodEvery]

<Int32>] [[-TimeperiodDay] <Int32>] [[-TimeperiodDayOfWeek] <Int32>] [[-TimeperiodMonth] <Int32>] [[-jsonrpc]

<String>] [[-session] <String>] [[-id] <String>] [[-URL] <String>] [<CommonParameters>]





DESCRIPTION

Set/update maintenance settings





PARAMETERS

-MaintenanceName <String>

Maintenance name (case sensitive)



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-MaintenanceID <String>



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-GroupID <Array>



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostID <Array>



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-groups <Array>



Required? false

Position? 5

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-hosts <Array>



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-timeperiods <Array>



Required? false

Position? 7

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-MaintenanceDescription <String>

Maintenance Description



Required? false

Position? 8

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-MaintenanceType <Int32>

Maintenance maintenance type (0 - (default) with data collection; 1 - without data collection)



Required? false

Position? 9

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ActiveSince <Object>

Maintenance start time (epoch time format)



Required? true

Position? 10

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ActiveTill <Object>

Maintenance end time (epoch time format)



Required? true

Position? 11

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeperiodPeriod <Int32>

Maintenance timeperiod's period/duration (seconds)



Required? false

Position? 12

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimePeriodType <Int32>

Maintenance TimeperiodType (0 - (default) one time only; 2 - daily; 3 - weekly; 4 - monthly)



Required? false

Position? 13

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeperiodStartTime <Int32>

Time of day when the maintenance starts in seconds. Required for daily, weekly and monthly periods. (epoch

time)



Required? false

Position? 14

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeperiodStartDate <Object>

Maintenance timeperiod's start date. Required only for one time periods. Default: current date (epoch time

format)



Required? false

Position? 15

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeperiodEvery <Int32>

For daily and weekly periods every defines day or week intervals at which the maintenance must come into

effect.

For monthly periods every defines the week of the month when the maintenance must come into effect.

Possible values: 1 - first week; 2 - second week; 3 - third week; 4 - fourth week; 5 - last week.



Required? false

Position? 16

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeperiodDay <Int32>

Day of the month when the maintenance must come into effect

Required only for monthly time periods



Required? false

Position? 17

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-TimeperiodDayOfWeek <Int32>

Days of the week when the maintenance must come into effect

Days are stored in binary form with each bit representing the corresponding day. For example, 4 equals 100 in

binary and means, that maintenance will be enabled on Wednesday

Used for weekly and monthly time periods. Required only for weekly time periods



Required? false

Position? 18

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-TimeperiodMonth <Int32>

Months when the maintenance must come into effect

Months are stored in binary form with each bit representing the corresponding month. For example, 5 equals 101

in binary and means, that maintenance will be enabled in January and March

Required only for monthly time periods



Required? false

Position? 19

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 20

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 21

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 22

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 23

Default value ($global:zabSessionParams.url)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ZabbixMaintenance -MaintenanceName 'MaintenanceName' | Set-ZabbixMaintenance -GroupID

(Get-ZabbixHostGroup | ? name -eq 'HostGroupName').groupid -TimeperiodPeriod 44400 -HostID (Get-ZabbixHost | ?

name -match host).hostid



Will replace ZabbixHostGroup, hosts and set new duration for selected maintenance (MaintenanceName is case

sensitive)









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ZabbixMaintenance | ? name -eq 'MaintenanceName' | Set-ZabbixMaintenance -GroupID (Get-ZabbixHostGroup

| ? name -match 'homeGroup').groupid -verbose -TimeperiodPeriod 44400 -HostID (Get-ZabbixHost | ? name -match

host).hostid



Same as above (MaintenanceName is case insensitive)









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-ZabbixMaintenance | ? name -match 'maintenance' | Set-ZabbixMaintenance -GroupID (Get-ZabbixHostGroup |

? name -match 'Name1|Name2').groupid -TimeperiodPeriod 44400 -HostID (Get-ZabbixHost | ? name -match host).hostid



Replace ZabbixHostGroups, hosts, duration in multiple maintenances











RELATED LINKS