powershellscripts.com

Tutorials  PowerShell Cmdlet Help for New-AlarmAction



NAME
New-AlarmAction

SYNOPSIS
Creates an alarm action and attaches it to the specified alarm.

SYNTAX
New-AlarmAction [-AlarmDefinition] -Snmp [-Server ] [-WhatIf] [-Confirm] [ meters>]

New-AlarmAction [-AlarmDefinition] -Email [-Subject ] -To [-Cc ] [-B
ody ] [-Server ] [-WhatIf] [-Confirm] []

New-AlarmAction [-AlarmDefinition] -Script -ScriptPath [-Server ] [-WhatIf]
[-Confirm] []


DESCRIPTION
Creates an alarm action and attaches it to the specified alarm.


PARAMETERS
-AlarmDefinition
Specify the alarm definition for which you want to configure actions.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Snmp
Indicate that a SNMP message is sent when the alarm is activated.

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

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

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

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

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

-Confirm
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.

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

-Email
Indicate that when the alarm is activated, the system sends an e-mail message to the specified address. Use the
Subject, To, CC, and Body parameters to customize the alarm message.

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

-Subject
Specify a subject for the e-mail message you want to send.

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

-To
Specify the e-mail address to which you want to send a message.

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

-Cc
Specify the e-mail addresses you want to add to the CC field of the e-mail message.

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

-Body
Specify the text of the e-mail message.

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

-Script
Indicate that a script is run when the alarm is activated.

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

-ScriptPath
Specify the file path to the script that will run when the alarm is activated.

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


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
AlarmAction


NOTES




-------------- Example 1 --------------

C:\PS>Get-AlarmDefinition -Name "Alarm1" | New-AlarmAction -Snmp


Creates an alarm action SNMP.





-------------- Example 2 --------------

C:\PS>Get-AlarmDefinition -Name "Alarm1" | New-AlarmAction -Script -ScriptPath 'c:\test.ps1'


Creates an alarm action script.





-------------- Example 3 --------------

C:\PS>Get-AlarmDefinition -Name "Alarm1" | New-AlarmAction -Email -To 'test@vmware.com' -CC @('test1@vmware.com', '
test2@vmware.com') -Body 'Test body' -Subject 'Test subject'


Creates an alarm action Email.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/New-AlarmAction.html
Get-AlarmAction
Get-AlarmActionTrigger
Get-AlarmDefinition
New-AlarmActionTrigger
Remove-AlarmAction
Remove-AlarmActionTrigger
Set-AlarmDefinition