Archived community.zenoss.org | full text search
Skip navigation
4216 Views 3 Replies Latest reply: Oct 14, 2010 3:14 PM by Dave_the_Dude RSS
Dave_the_Dude Rank: White Belt 39 posts since
Aug 3, 2010
Currently Being Moderated

Oct 11, 2010 5:58 PM

How to remove installed software list from a Device or Device Class?

Hello everyone!

 

The default zenpack for linux devices collects a list of all installed software on each device every time the ZenModeler runs.  This takes forever, up to a minute generally.  We don't want to store a list of the installed software, as nobody in our enterprise cares about that from a management interface.

 

I've removed the SWInstalledMap plugin from the modeler plugins list for the /Server/Linux device class, and now that info is not collected when we are modeling Linux devices (which, by itself, reduced modeling time for Linux servers from about 90 seconds to 3 seconds).

 

Now, I'm trying to figure out how to remove the list of  installed software for all devices belonging to the /Server/Linux device  class.  Our Data.fs file is HUGE, and I'm thinking that removing all that unwanted software info from the DB would dramatically reduce the size of Data.fs.

 

I don't see how to do this anywhere in the documentation, and  assume I would need to use zendmd to do it.  Has anyone tried to do this?  Anyone have any ideas on how that would be done in zendmd?

  • phonegi Rank: Brown Belt 446 posts since
    Apr 15, 2009

    This will remove all of the software relationships from existing devices in your system.

     

    $ zendmd

    >>> for device in dmd.Devices.getSubDevices():

    ...     device.os.software._remove(suppress_events=True)

    ...

    >>> commit()

     

     

    This will remove all of the software products from your system:

     

    $ zendmd

    >>> from Products.ZenModel.SoftwareClass import SoftwareClass

    ... for product in dmd.Manufacturers.getProductsGen():

    ...    if isinstance(product, SoftwareClass):

    ...       dmd.Manufacturers._delOb( product.getId() )

    ...

    >>> commit()

     

    For obvious reasons I was not able to test this code, but I did verify that the desired objects would be affected.

     

    Finally, you may want to execute the zenoss script found in the /etc/cron.weekly folder. It says that it packs the database, so maybe check the file size of data.fs before and after you run these scripts.

More Like This

  • Retrieving data ...

Legend

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