Quantcast
Channel: Zenoss Community: Message List
Viewing all articles
Browse latest Browse all 1097

Put devices in location with zendmd

$
0
0

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.


Viewing all articles
Browse latest Browse all 1097

Trending Articles