VMware Cloud Community
CloudRulez
Contributor
Contributor

Trigger based on Task

Is there a way to create an alarm trigger that base on Task?

When I am deploying a new VM machine, sometime I receive a time out error. I want my boss to know about it by an alert trigger that send him an email alert.

here is the task details.

Deploy OVF template
machie_test2
Operation timed out.         << -- I like to the alarm to triger base on this error.  is it posible?
coolman

VCENTER
1/18/2011 2:46:55 PM
1/18/2011 2:46:55 PM
1/18/2011 3:05:16 PM

I have tried all the tasks and events trigger under the datacenter, nothing seem to work.

It trigger other event but not task.

thanks in advance.

-C

Reply
0 Kudos
11 Replies
DSTAVERT
Immortal
Immortal

Reply
0 Kudos
CloudRulez
Contributor
Contributor

thanks,  I am using vsphere 4.0. I hope that feature exist.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

Does apply to 4 and 4.1

-- David -- VMware Communities Moderator
Reply
0 Kudos
CloudRulez
Contributor
Contributor

I am trying to get the alarm list by running Get_Alarms.ps1

I keep getting this error:

Get_alarms.ps1 cannot be loaded because of the execution of scripts is disabled on this system. please see "get-help about_signing" for more at line:0 char:0

any idea?

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

You will need to connect to the vCenter server to set alarms.

Is this a standalone ESXi server?

-- David -- VMware Communities Moderator
Reply
0 Kudos
DSTAVERT
Immortal
Immortal

You will need to set the execution policy.

Use the following to run any script.

Set-ExecutionPolicy  unrestricted

-- David -- VMware Communities Moderator
Reply
0 Kudos
CloudRulez
Contributor
Contributor

I put that in the script and I have the same error. Is there a specific place I need to put that?

I put that on the first line and it doesn't work.

Reply
0 Kudos
CloudRulez
Contributor
Contributor

i figured that out.. I put that command in cmdlet windows. 

Reply
0 Kudos
CloudRulez
Contributor
Contributor

now I got this error

The term 'Connect-VIServer' is not recognized as a cmdlet, function, operable program, or script file. Verify the term
and try again.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:1 char:17
+ Connect-VIServer  <<<<
The term 'Get-View' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try
again.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:3 char:21
+ $alarmMgr = Get-View  <<<< AlarmManager
The term 'Get-Folder' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and tr
y again.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:4 char:25
+ $rootfolder = Get-Folder  <<<< -Name "Datacenters" | Get-View
You cannot call a method on a null-valued expression.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:5 char:29
+ $alarms = $alarmMgr.GetAlarm( <<<< $rootfolder.MoRef)
The term 'Get-View' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try
again.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:11 char:20
+     $alview = Get-View  <<<< $alarm
You cannot call a method on a null-valued expression.
At C:\Documents and Settings\user\Desktop\Get_alarms2.ps1:12 char:37
+     if ($alview.Info.Expression.gettype( <<<< ).Name -eq "EventAlarmExpression")

Any idea?

Reply
0 Kudos
CloudRulez
Contributor
Contributor

I figured it out, thanks for the help

Reply
0 Kudos
CloudRulez
Contributor
Contributor

I created an event alarm based on "vm removed", it doesn't work. any idea?

I created an event alarm based on "vm created" and it works fine.

removed and delete multiple virtual vm, none triggered.

created multiple vm and all triggered fine.

identical setting, just different trigger.

trigger base on virtual machine and event trigger.

trigger = vm removed, statue = unset

action= sent email  and the rest set to once.

thanks in advance.

Reply
0 Kudos