Hi, everyone here. Who has used the AWS zenpack? I have used the codes as following in my zenpack:
def add_ec2account(self, accountname, accesskey, secretkey, collector):
deviceRoot = self._dmd.getDmdRoot("Devices")
device = deviceRoot.findDeviceByIdExact(accountname)
if device:
return False, _t("A device named %s already exists." % accountname)
@transact
def create_device():
dc = self._dmd.Devices.getOrganizer('/Devices/AWS/EC2')
account = dc.createInstance(accountname)
account.setPerformanceMonitor(collector)
account.ec2accesskey = accesskey
account.ec2secretkey = secretkey
account.index_object()
notify(IndexingEvent(account))
# This must be committed before the following model can be
# scheduled.
create_device()
# Schedule a modeling job for the new account.
account = deviceRoot.findDeviceByIdExact(accountname)
account.collectDevice(setlog=False, background=True)
return True
I want to know that whoever has been add 2 or more aws instances in your zenoss? In my zenoss, after I have developed the zenpack, I can't add the 2 instances without ip display in the web page like the aws.
Thank you!
-----James