Apr 25, 2013 10:06 AM
Why so many transforms for Vmware Devices
-
Like (0)
Hi All ,
I see lot of transforms written for Vmware Devices , i am not sure if these are custom buit (only is my set up) or in all the standard set up where vmware zenpacks are installed . Below are few such transforms . Kindly suggest .
/VMware/Guest/Power/On | ||
#IF THIS IS A GUEST POWER ON, CHANGE GUEST STATUSES | ||
if device is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'powerState', None ) != 'poweredOn': | ||
@transact | ||
def updateDb(): | ||
guests[0].powerState='poweredOn' | ||
updateDb() | ||
-------------------------------------------------------------------------------- | ||
/VMware/Guest/Power/Off | ||
#IF THIS IS A GUEST POWER OFF, CHANGE GUEST STATUSES | ||
if device is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'powerState', None ) != 'poweredOff': | ||
@transact | ||
def updateDb(): | ||
guests[0].powerState='poweredOff' | ||
updateDb() | ||
-------------------------------------------------------------------------------- | ||
/VMware/Guest/Power/Shutdown | ||
#IF THIS IS A GUEST POWER SHUTDOWN, CHANGE GUEST STATUSES | ||
if device is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'powerState', None ) != 'poweredOff': | ||
@transact | ||
def updateDb(): | ||
guests[0].powerState='poweredOff' | ||
updateDb() | ||
-------------------------------------------------------------------------------- | ||
/VMware/Guest/Power/Standby | ||
#IF THIS IS A GUEST POWER STANDBY, CHANGE GUEST STATUSES | ||
if device is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'powerState', None ) != 'suspended': | ||
@transact | ||
def updateDb(): | ||
guests[0].powerState='suspended' | ||
updateDb() | ||
-------------------------------------------------------------------------------- | ||
/VMware/Guest/Power/Suspend | ||
#IF THIS IS A GUEST POWER SUSPEND, CHANGE GUEST STATUSES | ||
if device is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'powerState', None ) != 'suspended': | ||
@transact | ||
def updateDb(): | ||
guests[0].powerState='suspended' | ||
updateDb() | ||
-------------------------------------------------------------------------------- | ||
/VMware/Guest/Connection/Disconnect | ||
#IF THIS IS A GUEST DISCONNECT, CHANGE GUEST STATUSES | ||
if dev is not None and evt.component: | ||
from Products.Zuul.utils import unbrain | ||
guests = map(unbrain, device.vmwareGuestSearch(id=evt.component)) | ||
if guests and getattr(guests[0], 'connectionState', None ) != 'disconnected': | ||
@transact | ||
def updateDb(): | ||
guests[0].connectionState='disconnected' | ||
updateDb() |
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||