Package Products :: Package ZenUtils :: Module CheckBasicInstall |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenUtils.CheckBasicInstall

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__ = """CheckBasicInstall
    15  Sanity checker
    16  """
    17
    18  import Globals
    19  from ZenScriptBase import ZenScriptBase
    20
    21  PATHS = (
    22
    23      # Tools
    24      '/zport/RenderServer',
    25      '/zport/ReportServer',
    26      '/zport/ZenTableManager',
    27      '/zport/ZenPortletManager',
    28      '/zport/dmd/DeviceLoader',
    29      '/zport/dmd/ZenEventManager',
    30      '/zport/dmd/ZenEventHistory',
    31      '/zport/dmd/ZenUsers',
    32      '/zport/dmd/ZenLinkManager',
    33      '/zport/dmd/ZenPackManager',
    34
    35      # Catalogs
    36      '/zport/dmd/Devices/deviceSearch',
    37      '/zport/dmd/Devices/componentSearch',
    38      '/zport/dmd/maintenanceWindowSearch',
    39      '/zport/dmd/searchRRDTemplates',
    40      '/zport/dmd/zenPackPersistence',
    41      '/zport/dmd/Networks/ipSearch',
    42
    43      # Organizers and other trees
    44      '/zport/dmd/Locations',
    45      '/zport/dmd/Systems',
    46      '/zport/dmd/Groups',
    47      '/zport/dmd/Devices',
    48      '/zport/dmd/Devices/Server',
    49      '/zport/dmd/Devices/Server/Linux',
    50
    51      '/zport/dmd/Networks',
    52      '/zport/dmd/Mibs',
    53      '/zport/dmd/Monitors',
    54      '/zport/dmd/Processes',
    55
    56      '/zport/dmd/Manufacturers',
    57      '/zport/dmd/Manufacturers/Microsoft',
    58
    59      '/zport/dmd/Services',
    60      '/zport/dmd/Services/WinService',
    61      '/zport/dmd/Services/IpService',
    62      '/zport/dmd/Services/IpService/Privileged',
    63
    64      '/zport/dmd/Events',
    65      '/zport/dmd/Events/Status',
    66      '/zport/dmd/Events/Status/Ping'
    67  )
    68
    69 -class BadInstallError(Exception):
    70      """
    71      The database wasn't loaded correctly.
    72      """
    73
    74 -class CheckBasicInstall(ZenScriptBase):
    75      """
    76      Verify that all organizers were properly installed
    77      """
    78
    79 -    def check(self):
    80          """
    81          Sanity check that all organizers are available
    82          """
    83          _allgood = True
    84          for path in PATHS:
    85              try:
    86                  ob = self.dmd.unrestrictedTraverse(path)
    87              except KeyError:
    88                  self.log.critical(' Object %s not found.' % path)
    89                  _allgood = False
    90          if not _allgood:
    91              raise BadInstallError( 'This Zenoss database was not built properly.' )
    92
    93
    94  if __name__ == "__main__":
    95      tmbk = CheckBasicInstall(connect=True)
    96      tmbk.check()
    97