floyn
2013-05-07 09:57:22 UTC
floyn [http://community.zenoss.org/people/floyn] created the discussion
"Put devices in location with zendmd"
To view the discussion, visit: http://community.zenoss.org/message/73096#73096
--------------------------------------------------------------
Hello,
I have create a python script which add devices and locations with reading a file. I don't success to add devices in locations with the program, I tried this but I have no success :
if tab[1] and tab[2]:
               loc=dmd.getDmdRoot("Locations").createOrganizer(tab[1])
               loc.setAddress(tab[2])
               commit()
               for device in dmd.Devices.Network.Switch.getSubDevices():
                       for i in device.os.interfaces():
                               ipaddress = i.getIpAddress()
                               if ip[0] == ipaddress:
                                       device.changeDeviceLocationPath(tab[1])
                                       commit()
The location is added but the device don't move (probably not the good function).
ip[0] is the device ip, tab[1] the name of the location and tab[2] the location definition for the map api.
Thank you if you can help me.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73096#73096]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"Put devices in location with zendmd"
To view the discussion, visit: http://community.zenoss.org/message/73096#73096
--------------------------------------------------------------
Hello,
I have create a python script which add devices and locations with reading a file. I don't success to add devices in locations with the program, I tried this but I have no success :
if tab[1] and tab[2]:
               loc=dmd.getDmdRoot("Locations").createOrganizer(tab[1])
               loc.setAddress(tab[2])
               commit()
               for device in dmd.Devices.Network.Switch.getSubDevices():
                       for i in device.os.interfaces():
                               ipaddress = i.getIpAddress()
                               if ip[0] == ipaddress:
                                       device.changeDeviceLocationPath(tab[1])
                                       commit()
The location is added but the device don't move (probably not the good function).
ip[0] is the device ip, tab[1] the name of the location and tab[2] the location definition for the map api.
Thank you if you can help me.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73096#73096]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]