jane,

i would first go through ips and check type/path by doing:

>>> for ip in Ips:
>>>     ip
>>>     ip.__dict__

this should result in something like:
<IpInterface at 
/zport/dmd/Devices/Server/Linux/devices/mydevice.yadda.com/os/interfaces/eth0>
{'adminStatus': 1, 'links': <ToManyRelationship at links>, 'createdTime': 
DateTime('2009/05/07 12:26:19.488 GMT-5'), 'dependencies': <ToManyRelationship 
at dependencies>, '_objects': ({'meta_type': 'ToManyRelationship', 'id': 
'dependencies'}, {'meta_type': 'ToManyRelationship', 'id': 'dependents'}, 
{'meta_type': 'ToManyRelationship', 'id': 'links'}, {'meta_type': 
'ToOneRelationship', 'id': 'os'}, {'meta_type': 'ToManyRelationship', 'id': 
'ipaddresses'}, {'meta_type': 'ToManyRelationship', 'id': 'iproutes'}), 
'speed': 1000000000, 'id': 'eth0', 'macaddress': '00:50:56:8A:59:71', 
'interfaceName': 'eth0', 'title': 'eth0', 'operStatus': 1, 'os': 
<ToOneRelationship at os>, '__primary_parent__': <ToManyContRelationship at 
interfaces>, '_ipAddresses': [], 'mtu': 1500, 'ipaddresses': 
<ToManyRelationship at ipaddresses>, 'ifindex': 2, 'iproutes': 
<ToManyRelationship at iproutes>, 'dependents': <ToManyRelationship at 
dependents>, 'type': 'ethernetCsmacd'}

chip


jcurry wrote:
> I have a little code in zendmd as follows:
> 
> 
> > 
> > >>> dev=find('switch.skills-1st.co.uk')
> > >>> devmac='00:0E:50:88:34:E6'
> > >>> Ips=dmd.ZenLinkManager.layer2_catalog(macaddress=devmac)
> > >>> print Ips
> > [<Products.ZCatalog.Catalog.mybrains object at 0xb5fe5c34>, 
> > <Products.ZCatalog.Catalog.mybrains object at 0xb5fe5c5c>, 
> > <Products.ZCatalog.Catalog.mybrains object at 0xb5fe5c84>, 
> > <Products.ZCatalog.Catalog.mybrains object at 0xb5fe5cac>, 
> > <Products.ZCatalog.Catalog.mybrains object at 0xb5fe5cd4>]
> > >>>                                                             
> > 
> 
> 
> The idea is that it searches for devices with a particular MAC address.  I 
> can then use the following to get IP addresses:
> 
> 
> > 
> > >>>
> > >>> for i in Ips:
> > ...   print i.getObject().manageIp
> > ...
> > 10.0.0.254
> > 10.0.0.254
> > 10.0.0.254
> > 10.0.0.254
> > 10.0.0.254
> > >>>           
> > 
> 
> 
> This works fine for this particular device but I have a different device 
> where it barfs out.  Question is, how do I find more information about these 
> <Products.ZCatalog.Catalog.mybrains object at 0xb5fe5c34> objects??  How do I 
> look at the details of the object at 0xb5fe5c34>??
> 
> Any clues gratefully received!
> 
> Cheers,
> Jane





-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=34534#34534

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to