Skip navigation
1 2 3 4 Previous Next 42350 Views 45 Replies Latest reply: Aug 24, 2010 1:09 PM by Adrian Bool RSS Go to original post
  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    30. Aug 16, 2010 3:24 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    Thanks to the_jack providing access to his box, got a fix. See this ticket for info: http://dev.zenoss.loc/trac/ticket/7196.

     

    You can fix everything like so:

     

    $ zenpatch 22038
    $ zendmd
    >>> for b in dmd.global_catalog():
    ...     dmd.global_catalog.catalog_object(b.getObject(), idxs=["allowedRolesAndUsers"])
    ...
    >>> commit()
    
    

     

    I'm not yet clear on the conditions that bring out this bug in CMFCore, but this will definitely take care of it.

     

    This fix will be in 3.0.2 as well.

     

    --Ian

  • Adrian Bool Rank: White Belt 11 posts since
    Apr 1, 2010
    Currently Being Moderated
    31. Aug 16, 2010 4:13 PM (in response to Ian McCracken)
    Re: Devices "missing in action"?

    That's worked here; many thanks Ian.

  • s_aldinger Rank: White Belt 9 posts since
    Aug 4, 2010
    Currently Being Moderated
    32. Aug 16, 2010 4:32 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    Same here, great work!

  • s_aldinger Rank: White Belt 9 posts since
    Aug 4, 2010
    Currently Being Moderated
    33. Aug 16, 2010 6:50 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    It appears that any device added after this fix is still invisible.

    However rerunning the zdmd commands will bring them back.

  • Adrian Bool Rank: White Belt 11 posts since
    Apr 1, 2010
    Currently Being Moderated
    34. Aug 17, 2010 3:44 AM (in response to Ian McCracken)
    Re: Devices "missing in action"?
    I think we have another, related issue.
    I previously had my Devices ordered within a flat list of Location objects representing the data centres in which they resided.  In order to visually search for these locations quicker, I've place a list of country names as container objects in the Locations hierarchy, moving the data centre Location object into their respective country Location object.
    This too has resulted in the devices being hidden in the UI.  All of the Location objects (both country and data centre) now report (0) for the number of objects within them.
    As before, when I browse to the Zope DMD interface I can see the devices within the proper hierarchy.
    I've ran the,
    for b in dmd.global_catalog():                                                    
    dmd.global_catalog.catalog_object(b.getObject(),idxs=["allowedRolesAndUsers"])
    commit()
    But that made no change on this occasion.  A stop/start of Zenoss - just in case - has made no difference.
    Looks like a very similar bug; but at some sightly different part of Zenoss... An ideas on how to determine where?
    Cheers,
    aid
  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    35. Aug 17, 2010 1:58 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    s_aldinger: Sorry, should have said: restart Zenoss after you patch in the change, otherwise nothing's got the new code and will still do it the old way.

     

    Adrian: The fix will apply to Locations just as devices, so this is a different issue. Run these two things:

     

    $ zendmd

    >>> from Products.Zuul.interfaces import ICatalogTool

    >>> ICatalogTool(dmd).search('Products.ZenModel.Location.Location').total

    >>> len(dmd.global_catalog(objectImplements="Products.ZenModel.Location.Location"))

     

    They should give you two numbers that are a) not zero, and b) the same.

     

    --------------------------------------
    Ian McCracken
    Senior Software Developer
    Zenoss, Inc.
    O: 410.990.0274 x7018
  • Adrian Bool Rank: White Belt 11 posts since
    Apr 1, 2010
    Currently Being Moderated
    36. Aug 17, 2010 4:05 PM (in response to Ian McCracken)
    Re: Devices "missing in action"?

    Hi Ian,

     

    They do both produce the same non-zero output,

    >>> from Products.Zuul.interfaces import ICatalogTool
    >>> ICatalogTool(dmd).search('Products.ZenModel.Location.Location').total
    16
    <objectImplements="Products.ZenModel.Location.Location"))                   
    16

     

    There are however 19 devices in my system.  I did the following,

    >>> [l.id for l in dmd.global_catalog(objectImplements="Products.ZenModel.Location.Location")]

    ['NL', 'nkf.ams', 'ixn5.ams', 'gsw.ams', 'tc2.ams', 'UK', 'thn.lon', 'the.lon', 'ifl2.man', 'FR', 'eq2.par', 'th2.par', 'ixn3.ams', 'DE', 'ixn1.fra', 'Locations']

    Arr, this is listing just the Location 'wrapper' objects (all present).
    Should my Device (mainly switch) objects also respond to objectImplements="Products.ZenModel.Location.Location" in order for them to be included in the Location hierarchy?
    Regards,
    aid
  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    37. Aug 17, 2010 4:15 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?
    Should my Device (mainly switch) objects also respond to objectImplements="Products.ZenModel.Location.Location" in order for them to be included in the Location hierarchy?

     

    Not at all. So, wait, sorry, perhaps I misunderstood. Is the problem that the locations aren't visible, or that the devices aren't visible in the locations?

  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    38. Aug 17, 2010 4:17 PM (in response to Ian McCracken)
    Re: Devices "missing in action"?

    Those were just searching for the locations themselves, not devices at all. You have 16 locations, and they're all indexed properly.

  • Adrian Bool Rank: White Belt 11 posts since
    Apr 1, 2010
    Currently Being Moderated
    39. Aug 17, 2010 4:40 PM (in response to Ian McCracken)
    Re: Devices "missing in action"?

    The latter, the devices aren't visible in the locations.

     

    As with the previous issue, if I got to the Zope DMD interface and navigate to,

     

    /zport/dmd/Locations/UK/thn.lon/devices

     

    I can see the proper Devices (switches) listed.

  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    40. Aug 18, 2010 11:46 AM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    Okay, let's walk this through.

     

    First, let's see what is indexed for devices. Pick a device in a location, doesn't matter which. Get its id. Then:

     

    $ zendmd
    >>> brain = dmd.global_catalog(id='mydeviceid')[0]
    >>> dmd.global_catalog._catalog.indexes['path']._unindex[brain.getRID()]
    

     

    Those are all the paths under which the device was found. If the location path is in there, it's something else. If it isn't, do:

     

    >>> from Products.Zuul.catalog.global_catalog import IndexableWrapper
    >>> device = brain.getObject()
    >>> for p in IndexableWrapper(device).path():
    ...        print '/'.join(p)
    

     

    Check to see if the location path is in there.

  • Adrian Bool Rank: White Belt 11 posts since
    Apr 1, 2010
    Currently Being Moderated
    41. Aug 18, 2010 2:20 PM (in response to Ian McCracken)
    Re: Devices "missing in action"?
    Hi Ian,
    No Locations listed for the first query,
    brain = dmd.global_catalog(id='arcturus.packetrade.com')[0]  
    dmd.global_catalog._catalog.indexes['path']._unindex[brain.getRID()]
    OOSet(['/zport/dmd/Devices/Network/Switch/Foundry/devices/arcturus.packetrade.com', '/zport/dmd/Networks/c.d.65.0/c.d.65.56/ipaddresses/c.d.65.61/device', '/zport/dmd/Networks/a.b.184.0/a.b.184.0/ipaddresses/a.b.184.2/device', '/zport/dmd/Networks/a.b.184.0/a.b.184.136/ipaddresses/a.b.184.137/device', '/zport/dmd/Networks/a.b.184.0/a.b.184.140/ipaddresses/a.b.184.142/device', '/zport/dmd/Networks/a.b.184.0/a.b.184.224/ipaddresses/a.b.184.225/device', '/zport/dmd/Networks/a.b.184.0/a.b.184.32/ipaddresses/a.b.184.34/device'])
    But the Location does appear for the second query,
    device = brain.getObject()
    for p in IndexableWrapper(device).path(): print '/'.join(p)
    /zport/dmd/Devices/Network/Switch/Foundry/devices/arcturus.packetrade.com
    /zport/dmd/Locations/NL/tc2.ams/devices/arcturus.packetrade.com
    /zport/dmd/Networks/a.b.184.0/a.b.184.224/ipaddresses/a.b.184.225/device
    /zport/dmd/Networks/a.b.184.0/a.b.184.136/ipaddresses/a.b.184.137/device
    /zport/dmd/Networks/a.b.184.0/a.b.184.140/ipaddresses/a.b.184.142/device
    /zport/dmd/Networks/a.b.184.0/a.b.184.0/ipaddresses/a.b.184.2/device
    /zport/dmd/Networks/a.b.184.0/a.b.184.32/ipaddresses/a.b.184.34/device
    /zport/dmd/Networks/c.d.65.0/c.d.65.56/ipaddresses/c.d.65.61/device
    Thanks for looking into this.
    aid
  • syspimp Rank: White Belt 17 posts since
    Apr 15, 2010
    Currently Being Moderated
    42. Aug 20, 2010 6:59 AM (in response to Ian McCracken)
    Re: Devices "missing in action"?

    This works for only 1 pageview.  If I click on Infrastructure, it is blank until I run the code you posted.  Whe the for loop is finished, the devices appear, but I get this in zendmd:

     

    >>> for b in dmd.global_catalog():
    ...  dmd.global_catalog.catalog_object(b.getObject(), idxs=["allowedRolesAndUsers"])
    ...
    Traceback (most recent call last):
      File "<console>", line 2, in <module>
      File "/opt/zenoss/lib/python/Products/ZCatalog/CatalogBrains.py", line 92, in getObject
        target = parent.restrictedTraverse(path[-1])
      File "/opt/zenoss/lib/python/OFS/Traversable.py", line 310, in restrictedTraverse
        return self.unrestrictedTraverse(path, default, restricted=True)
      File "/opt/zenoss/lib/python/OFS/Traversable.py", line 293, in unrestrictedTraverse
        raise e
    NotFound: 135554119_31
    >>> commit()

     

    This bug made us revert back to 2.5.2 the first time we upgraded.  Each time I visit the Infrastructure page, I must run this code in zendmd to make the devices appear.  I've applied the patch as well.  Any suggestions?  I've restarted zenoss since running the code/patch.

     

    Thanks!

  • syspimp Rank: White Belt 17 posts since
    Apr 15, 2010
    Currently Being Moderated
    43. Aug 20, 2010 10:12 AM (in response to syspimp)
    Re: Devices "missing in action"?

    I still get the error, but I just wanted to leave the comment that my Infrastruture appears if I let the page stay there for 2 mins.  It doesn't indicate that it's loading, but I guess thats AJAX for you.

     

    Added a new device class causes the device list to disappear (except for groups, locations and systems organizers), until 2 mins later when it will reappear.

  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    44. Aug 24, 2010 12:30 PM (in response to Adrian Bool)
    Re: Devices "missing in action"?

    Just letting you know I'm still investigating this. Sorry for the latency; I'll try to get something soon.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points