NAME

Add-DcsTrigger

SYNOPSIS

Creates a trigger for the specified task.

SYNTAX

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -SignalDuration <TimeSpan>   -StartTime <DateTime>   -Interval <TimeSpan>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -SignalDuration <TimeSpan>   -StartTime <DateTime>   -WeekDays <String[]>   -WeekInterval <Int32>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -SignalDuration <TimeSpan>   -StartTime <DateTime>   -DayInterval <Int32>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -SignalDuration <TimeSpan>   -StartTime <DateTime>   [ -Monthnumber <Int32> ]   -DayOfMonth <Int32>   -MonthlyInterval <Int32>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -SignalDuration <TimeSpan>   -StartTime <DateTime>   [ -Monthnumber <Int32> ]   -WeekDays <String[]>   -MonthlyInterval <Int32>   -Weeknumber <Int32>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -MonitorId <String>   -MonitorState <String>   -Comparison <String>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -TemplateTypeId <String>   -MonitorState <String>   -Comparison <String>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -FilterType <String[]>   -FilterValue <String[]>   -FilterComparison <String[]>   -RequireAll <Boolean>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

Add-DcsTrigger   -Task <Object>   [ -Description <String> ]   -VirtualDisk <String>   [ -Connection <String> ]   [ -PipelineVariable <String> ]

DESCRIPTION

Creates a trigger for the specified task. A trigger contains criteria that, when met, causes the task actions to be performed (see Add-DcsAction). One trigger can be added to the task each time the cmdlet is invoked.The trigger will be based on one of the following types of events: a scheduled time, a monitor state change, a message posted in the event log, or a replication checkpoint being received. There are several parameter sets for this cmdlet; five for scheduled time events, two for a monitor state change event, one for a log message event, and one for a replication checkpoint event. When creating a trigger for a log message event, filters are used to narrow the scope of the log messages. If multiple filters are configured, the number of values specified for FilterType, FilterValue, and FilterComparison parameters in the array must be identical and in an associated order. See example 7.

PARAMETERS

-Task<Object>
TaskData object, ID, or name of the task that the trigger will be added to.

Required: true
Position: named
Default value:
Accept pipeline input: true (ByValue)
Accept wildcard characters: false

-Description<String>
The description parameter has been deprecated and will always be empty. This parameter is left in the interface for backwards compatibility. It cannot be changed.

Required: false
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-SignalDuration<TimeSpan>
This parameter indicates how long the trigger will be considered active. If not specified, the default value of "00:00:00" will be used, which indicates no signal duration setting. This parameter is only relevant when multiple triggers exist, and the RequireAllTriggers parameter set to $true in Add-DcsTask. For example, if one trigger is set to run once at 8PM and another scheduled time trigger in the same task is set to run hourly and the SignalDuration parameter is set to 12 hours, then the action would run 12 times starting at 8PM. One way to provide the SignalDuration parameter would be by passing a variable created from invoking New-Object with the TypeName parameter of TimeSpan with the correct arguments (see the Help for New-Object). The TimeSpan parameter can also be provided in a string that represents the number of days, hours, and minutes in this format: "dd:dd:dd". This value does not require quotes. For instance, to keep the triggers active for one week, the value would be "07:00:00" or to keep the triggers active for 12 hours, the value would be "00:12:00".

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-StartTime<DateTime>
The beginning date and time of a scheduled time trigger. One way to provide the StartTime parameter would be by passing a variable created by invoking New-Object with the TypeName parameter of DateTime with the correct arguments (see the Help for New-Object, Get-Date). The StartTime parameter can also be provided in a string with the date and time. An example of the format to use is "04/06/2011 02:51:00 PM" which represents April 6, 2011 at 2:51 PM. This value must be in quotes.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Interval<TimeSpan>
When creating a scheduled time event, this parameter is used to indicate the amount of time in hours, minutes, seconds to wait between triggering the event again. The format to use is dd:dd:dd. This value does not require quotes. For instance, "02:15:30" would represent that the scheduled time event to occur every 2 hours, 15 minutes and 30 seconds. Use "00:00:00" to not set an interval.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Connection<String>
Alias of the connection to the server group. If not specified, the default connection is used.

Required: false
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-PipelineVariable<String>

Required: false
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-WeekDays<String[]>
When creating a scheduled time event based on specific days of the week, this parameter uses an array of the days on which the event will occur. Possible values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", and "Weekdays". The "Weekdays" value is exclusive; when "Weekdays" is used, then no other day is valid. For instance, for a scheduled time event to run Monday through Friday, the parameter value would be "Weekdays". For a scheduled time event to run Monday, Wednesday, and Friday, the parameter value would be "Monday", "Wednesday", "Friday".

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-WeekInterval<Int32>
When creating a weekly scheduled time event based on the WeekDays parameter, the WeekInterval indicates how many weeks are in-between each firing of the event. For example: A value of "1" indicates that the event will occur every week. A value of "2" indicates that the event will occur every two weeks (or every other week). A value of "3" indicates that the event will occur every three weeks.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-DayInterval<Int32>
When creating a scheduled time event, this parameter is used to indicate how often, in terms of days, that the event should be triggered. For example: To trigger the event every day, use "1". To trigger the event to run every two days (or every other day), use "2". To trigger the event every seven days, use "7".

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Monthnumber<Int32>
When creating a yearly scheduled time event, this parameter is used to signify the number of the month on which event will occur. For instance, January would be "1" and December would be "12". If Monthnumber and MonthlyInterval are both set, Monthnumber will supersede MonthlyInterval.

Required: false
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-DayOfMonth<Int32>
When creating a yearly or monthly scheduled time event based on the Monthnumber or MonthlyInterval parameters, the DayOfMonth parameter is used to indicate the day of the month when the event is triggered. Valid parameter values are 1 through 31. For instance a value of "2" would indicate the second day of the month.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-MonthlyInterval<Int32>
When creating a monthly scheduled time event, the MonthlyInterval parameter indicates how many months are in-between each firing of the event. For example: A value of 1 indicates that the event will occur every month. A value of 2 indicates that the event will occur every two months (or every other month). A value of 3 indicates that the event will occur every three months.(If Monthnumber and MonthlyInterval are both used in the parameter set, Monthnumber will supersede MonthlyInterval.)

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Weeknumber<Int32>
When creating a monthly scheduled time event, this parameter signifies the number of the week in a month when the event will occur. For instance, the first week in the month would be "1" and the forth week in the month would be "4".

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-MonitorId<String>
The ID of the monitor that will trigger the event. This parameter is used to specify an instance of a specific monitor. The monitor ID is included in the MonitorData object (ID field), which can be obtained from Get-DcsMonitor. See the example 5 for more information.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-MonitorState<String>
The state that will trigger the Monitor based event. Possible values in order from lowest to highest: "Healthy", "Attention", "Warning" , and "Critical". This parameter works in conjunction with the comparison operator.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-Comparison<String>
Monitor Comparison values are as follows: ">", ">=", "=", "<", and "<=".

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-TemplateTypeId<String>
The Type ID of the template used in the Monitor based trigger. This parameter is used to specify a selection of all instances of a monitor type. The template type ID is included in the MonitorDataTemplate object (TypeID field) and can be obtained from Get-DcsMonitorTemplate. See the example 6 for more information.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-FilterType<String[]>
The FilterType parameter is used to indicate what aspect of the log messages will be used to trigger the event. Potential values are: "Source", "SourceType", "MessageText", and "LogLevel". If creating multiple filters, the number of values for FilterType, FilterValue, and FilterComparison parameters must be equal and in an associated order.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-FilterValue<String[]>
The filter value that the LogMessage based trigger must contain to trigger the event. For a filter type of "Source", possible values include a string containing the name of a SAN resource. For a filter type of "SourceType", possible values include: "General", "Disk pools", "Mirrors", "Monitors", "Paths", "Physical disks", "Ports", "Replications", "Rollbacks", "Security", "Snapshots", "Hosts", "DataCore Servers", "Tasks", "Virtual disk sources", "Virtual disks", "Support", or "PerfStorage". For a filter type of "MessageText", possible values include a string from the message text field. For a filter type of "LogLevel", possible values include "Trace", "Info", "Warning", or "Error". If creating multiple filters, the number of values for FilterType, FilterValue, and FilterComparison parameters must be equal and in an associated order.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-FilterComparison<String[]>
The filter comparison value is used to compare the FilterValue to see whether the criteria have been met. Possible values are: "Contains", "DoesNotContain", "IsEqualTo", and "IsNotEqualTo". If creating multiple filters, the number of values for FilterType, FilterValue, and FilterComparison parameters must be equal and in an associated order.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-RequireAll<Boolean>
Indicates whether all Filters must be met when creating a log based event trigger.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-VirtualDisk<String>
The name or ID of the virtual disk that will receive the replication checkpoint marker.

Required: true
Position: named
Default value:
Accept pipeline input: false
Accept wildcard characters: false

INPUTS

TaskData : Object that identifies and describes the task.

OUTPUTS

TaskTriggerData : Object that identifies and describes the task trigger.

NOTES

Also see Get-DcsTask, Get-DcsTrigger, Remove-DcsTrigger, Add-DcsTask, Get-DcsMonitor, Get-DcsMonitorTemplate.

EXAMPLES


-------------- Example 1 Adds an hourly trigger --------------
Add-DcsTrigger -Task MyHourlyTask -Interval 01:00:00  -SignalDuration 00:00:00 -StartTime "07/28/2011 11:00:00 PM"
		

Creates a trigger for the task named "MyHourlyTask", starting at 11 PM on July 27, 2011 (see caption). The trigger will occur every hour. No signal duration is set. The StartTime returned in the object is displayed in UTC.

Interval:36000000000
Recurrence:TimeInterval
SignalDuration:0
StartTime:7/29/2011 3:00:00 AM
TaskId:c122c331-f334-437f-a176-db9d3053ab4f
Type:ScheduledTrigger
Description:
Id:a9125ed8-514c-48e8-9521-2dbb3c7d4f19
Caption:Every 01:00:00, starting on 7/28/2011 11:00:00 PM
ExtendedCaption:
Internal:False
   

-------------- Example 2 Adds a trigger that will occur every three days --------------
Add-DcsTrigger -Task MyTask -SignalDuration 00:00:00 -StartTime "10/18/11 11:45:00 AM" -DayInterval 3
		

Creates a trigger for the task named "MyTask", starting at 11:45 AM on October 18, 2011. The trigger will occur every three days. No signal duration is set. The StartTime returned in the object is displayed in UTC.

Weekdays:False
DailyInterval:3
Recurrence:Daily
SignalDuration:0
StartTime:10/18/2011 3:45:00 PM
TaskId:0049e781-b588-4019-b43d-3f88925dbbd4
Type:ScheduledTrigger
Description:
Id:f377926e-3361-44e4-9fe9-0882af0f6140
Caption:Every 3 days at 11:45:00, starting on 10/18/2011 11:45:00 AM
ExtendedCaption:
Internal:False
   

-------------- Example 3 Adds a trigger to run specific days of every week --------------
Add-DcsTrigger -Task MyTask -SignalDuration 00:00:00 -StartTime "10/18/11 1:00:00 PM" -WeekDays "Monday", "Wednesday", "Friday" -WeekInterval 1
		

Creates a trigger for the task named "MyTask", starting at 1:00 PM on October 18, 2011. The trigger will occur Monday, Wednesday, and Friday of every week. No signal duration is set. The StartTime returned in the object is displayed in UTC.

WeeklyInterval:1
WeekdaySelection:Monday, Wednesday, Friday
Recurrence:Weekly
SignalDuration:0
StartTime:10/18/2011 5:00:00 PM
TaskId:0049e781-b588-4019-b43d-3f88925dbbd4
Type:ScheduledTrigger
Description:
Id:8de47e2d-0cb5-4a1c-a1b8-016c9883218e
Caption:Once every 1 week at 13:00:00 starting on 10/18/2011 1:00:00 PM, on these days only: Mon Wed Fri
ExtendedCaption:
Internal:False
   

-------------- Example 4 Adds a trigger for a replication checkpoint received --------------
Add-DcsTrigger -Task MyTask -VirtualDisk "Virtual disk 2"
		

Creates a replication checkpoint trigger for the task named "MyTask". The trigger will occur when the virtual disk named "Virtual disk 2" receives a checkpoint marker.

VirtualDiskDataId:396397105a7a4094949f33adce4c2fb1
TaskId:0049e781-b588-4019-b43d-3f88925dbbd4
Type:CheckpointTrigger
Description:
Id:dca2bad428f3428cabf36acca28dda7a
Caption:Checkpoint Marker for Virtual disk 2
ExtendedCaption:
Internal:False
   

-------------- Example 5 Adds a trigger using the Monitor ID for a specific monitor instance --------------
$Monitor = Get-DcsMonitor -Object (Get-DcsClient -Client "HostVM1")
Add-DcsTrigger -Task MonitorStateChange -MonitorId $Monitor.Id -MonitorState Healthy -Comparison ">"
		

This example creates a trigger to monitor a specific host client for any state other than Healthy. The cmdlet Get-DcsMonitor is invoked to retrieve the MonitorData object for the host client named "HostVM1". The object is stored in the variable $Monitor. The cmdlet Add-DcsTrigger is invoked to add a trigger to the task "MonitorStateChange". The monitor ID is identified by supplying the variable $Monitor.Id (where the Id is stored). The trigger will monitor for all state greater than "Healthy", which include Attention, Warning and Critical states.

MonitoredObjectId:ClientMachineStateMonitor<8cdaebf4085b4a7fb3d53b0647cbf95e>
MonitorTemplateTypeId:
MonitorThreshold:Healthy
TriggerStateOperator:Greater
TaskId:2aba4b9b-e48b-4ef5-9926-8984e05823c2
Type:MonitorTrigger
Description:
Active:False
Sequencenumber:11463
Id:a5b46206-1a16-4070-8c75-fe27c2c9d7a8
Caption:State of HostVM1 > Healthy
ExtendedCaption:
Internal:False
   

-------------- Example 6 Adds a trigger using the Template ID to specify all monitor instances for a certain type --------------
Add-DcsTrigger -Task MonitorHosts -TemplateTypeId "T(DataCore.Executive.Controller.ClientMachineStateMonitor<DataCore.Executive.Controller.ClientMachine>)" -MonitorState Healthy -Comparison ">"
		

Creates a monitor trigger for the task named "MonitorHosts" by providing the template type ID "T(DataCore.Executive.Controller.ClientMachineStateMonitor<DataCore.Executive.Controller.ClientMachine>)" to specify all monitor instances of that type. The trigger will occur when the monitor is greater than Healthy, which includes the states Attention, Warning and Critical. The template type ID was found by invoking Get-DcsMonitorTemplate and providing the correct type ID from the returned templates.

MonitoredObjectId:
MonitorTemplateTypeId:T(DataCore.Executive.Controller.ClientMachineStateMonitor<DataCore.Executive.Controller.ClientMachine>)
MonitorThreshold:Healthy
TriggerStateOperator:Greater
TaskId:827fec88-94cd-487d-a2d4-e3354d968f55
Type:MonitorTrigger
Description:
Id:c7e52761-2891-432f-bac7-64429259c7c9
Caption:State of Hosts > Healthy
ExtendedCaption:
Internal:False
   

-------------- Example 7 Adds a log message trigger with two filters. --------------
$Tasks = Get-DcsTask
$tasks | Add-DcsTrigger -FilterType "SourceType","LogLevel" -FilterValue "Disk pools","Warning" -FilterComparison "IsEqualTo","IsEqualTo" -RequireAll $true
		

The cmdlet Get-DcsTask is invoked to get all TaskData objects and stored in the variable $Tasks. (In this case, there is one task created.) The variable $Tasks is piped to cmdlet Add-DcsTrigger and the cmdlet is invoked to add a single trigger with two filters to the existing task "Task1". The first filter will be satisfied when a log message is received for any disk pool; the filter type is "SourceType", filter value is "Disk pools", and filter comparison is "IsEqualTo". The second filter will be satisfied when a log message is received for a log message at the warning level; filter type is "LogLevel", filter value is "Warning", and filter comparison is "IsEqualTo". The RequireAll parameter is set to true, which means that both filters must be satisfied, so the trigger will fire when a message is received for a disk pool that is at the warning level.

MessageFilters:{Source type = Disk pools, Log level = Warning}
Connective:LogicalAnd
TaskId:380f189b-80dd-4a09-b0cd-f3647fb330f3
Type:MessageTrigger
Description:
Sequencenumber:36931
Id:d757d6ea-4569-43f2-8285-4ec5d13d447d
Caption:Log messages matching [Source type = Disk pools] AND [Log level = Warning]
ExtendedCaption:
Internal:False
   

-------------- Example 8 Adds a one time scheduled trigger --------------
Add-DcsTrigger -Task "Task 1" -Interval 00:00:00 -SignalDuration 00:00:00 -StartTime "06/18/2012 15:30:00 PM"
		

Creates a trigger for the task named "Task 1" that occurs once (because the interval is set to zero) that occurs at 3:30 PM on June 18, 2012 (see caption). No signal duration is set. The StartTime returned in the object is displayed in UTC.

Recurrence:OneTime
SignalDuration:0
StartTime:6/18/2012 7:30:00 PM
TaskId:380f189b-80dd-4a09-b0cd-f3647fb330f3
Type:ScheduledTrigger
Description:
Sequencenumber:26431
Id:e5953632-56c8-4ff1-bdda-746141cb6031
Caption:At 3:30 PM on 6/18/2012
ExtendedCaption:
Internal:False
   

-------------- Example 9 Adds a daily weekday trigger --------------
Add-DcsTrigger -Task "Task 1" -SignalDuration 00:00:00 -StartTime "06/18/2012 15:30:00 PM" -WeekInterval 1 -WeekDays "Weekdays"
		

Creates a daily weekday trigger for the task named "Task 1", starting at 3:30 PM on June 18, 2012 (see caption). No signal duration is set. The WeekInterval is set to "1" and the WeekDays parameter is set to "Weekdays" so the trigger will occur every week Monday through Friday. No signal duration is set. The StartTime returned in the object is displayed in UTC.

Weekdays:True
DailyInterval:1
Recurrence:Daily
SignalDuration:0
StartTime:6/18/2012 7:30:00 PM
TaskId:380f189b-80dd-4a09-b0cd-f3647fb330f3
Type:ScheduledTrigger
Description:
Sequencenumber:26474
Id:6672488b-bf18-4774-a06a-e877a9bd6e24
Caption:Every weekday at 3:30 PM starting on 6/18/2012
ExtendedCaption:
Internal:False
   

-------------- Example 10 Adds a monthly trigger on a specified day of the month --------------
Add-DcsTrigger -Task "Task 1" -SignalDuration 00:00:00 -StartTime "06/18/2012 14:00:00 PM" -MonthlyInterval 1 -DayOfMonth "15"
		

Creates a trigger for the task named "Task 1". The MonthlyInterval parameter is set to "1" and the DayOfMonth parameter is set to "15" so the trigger occurs every month on the 15th day of the month. The trigger starts at 2PM on June 18, 2012 (see caption). No signal duration is set. The StartTime returned in the object is displayed in UTC.

MonthlyByDateFlag:True
MonthIntervalByDaynumber:1
DaynumberInMonth:15
DayOfWeekInMonthlyByWeek:Sunday
WeekNumInMonthlyByWeek:0
MonthIntervalByWeek:0
Recurrence:Monthly
SignalDuration:0
StartTime:6/18/2012 6:00:00 PM
TaskId:380f189b-80dd-4a09-b0cd-f3647fb330f3
Type:ScheduledTrigger
Description:
Sequencenumber:26504
Id:300729ca-e219-4e24-aea6-d6701504224a
Caption:On the 15th day of every month at 2:00 PM starting on 6/18/2012
ExtendedCaption:
Internal:False
   

-------------- Example 11 Adds a yearly trigger for a specific month and day --------------
Add-DcsTrigger -Task "Task 1" -SignalDuration 00:00:00 -StartTime "06/18/2012 20:00:00 PM" -Monthnumber 1 -DayOfMonth "15" -MonthInterval 12
		

Creates a trigger for the task named "Task 1". The Monthnumber is set to "1", the DayOfMonth is set to "15", and the MonthInterval is set to "12" or every 12 months, so the trigger occurs yearly every January 15th. The trigger starts at 2PM on June 18, 2012 (see caption). No signal duration is set. The StartTime returned in the object is displayed in UTC.

YearlyByDateFlag:True
YearlyByDateMonth:1
YearlyByDateDay:15
YearlyWeek:0
YearlyDayOfWeek:Sunday
YearlyMonth:0
Recurrence:Yearly
SignalDuration:0
StartTime:6/19/2012 12:00:00 AM
TaskId:380f189b-80dd-4a09-b0cd-f3647fb330f3
Type:ScheduledTrigger
Description:
Sequencenumber:26728
Id:17348b39-67f7-4f65-a313-aa6d9b812ce8
Caption:Every year on the 15th day of January at 8:00 PM starting on 6/18/2012
ExtendedCaption:
Internal:False