def notFixed(): fileOpen = "boot.txt" section = "/proc/cmdline" content = {} SERVER = SUSE.getHostInfo() # print "SERVER = " + str(SERVER) if( SERVER['DistroVersion'] == 11 ): if( SERVER['DistroPatchLevel'] == 3 ): FIXED_VERSION = '3.0.101-0.21' elif( SERVER['DistroPatchLevel'] == 2 ): FIXED_VERSION = '3.0.101-0.7.19' else: Core.updateStatus(Core.ERROR, "Outside Service Pack scope, skipping IRQ remap test") return False if( SUSE.compareKernel(FIXED_VERSION) >= 0 ): Core.updateStatus(Core.IGNORE, "Patch applied, IRQ remap issue AVOIDED") return False else: Core.updateStatus(Core.ERROR, "Outside Distribution scope, skipping IRQ remap test") return False if Core.getSection(fileOpen, section, content): for line in content: if "intremap=off" in content[line]: Core.updateStatus(Core.IGNORE, "Found interrupt remapping issue intremap=off work around") return False return True
def getKdumpInfo(): INFO = {'Installed': False, 'Active': False} if( SUSE.packageInstalled('kdump') and SUSE.packageInstalled('kexec-tools') ): INFO['Installed'] = True SERVICE_NAME = 'kdump.service' SERVICE = SUSE.getServiceDInfo(SERVICE_NAME) if( len(SERVICE) > 0 and SERVICE['ActiveState'].lower() == 'active' ): INFO['Active'] = True return INFO
def kernelAffected(): SERVER = SUSE.getHostInfo() if( SERVER['DistroVersion'] == 11 ): if( SERVER['DistroPatchLevel'] == 2 ): KERNEL_VERSION = '3.0.38-0.5' elif( SERVER['DistroPatchLevel'] == 1 ): KERNEL_VERSION = '2.6.32.59-0.7' else: KERNEL_VERSION = SERVER['KernelVersion'] INSTALLED_VERSION = SUSE.compareKernel(KERNEL_VERSION) if( INSTALLED_VERSION < 0 ): return True return False
def VMWareGuest(): SYSTEM = SUSE.getBasicVirtualization() if( SYSTEM ): if "vmware" in SYSTEM['Manufacturer'].lower(): if "virtual machine" in SYSTEM['Identity'].lower(): return True return False
def xfsMounts(): FSLIST = SUSE.getFileSystems() for FS in FSLIST: if "xfs" in FS['Type']: if( FS['Mounted'] ): return True return False
def kdumpEnabled(): FILE_OPEN = "crash.txt" CONTENT = {} Enabled = 0 if SUSE.packageInstalled('kdump'): Enabled += 1 if SUSE.packageInstalled('kexec-tools'): Enabled += 1 if Core.listSections(FILE_OPEN, CONTENT): for LINE in CONTENT: if "/etc/sysconfig/kdump" in CONTENT[LINE]: Enabled += 1 break if( Enabled >= 3 ): return True else: return False
def testKernelFor(FIXED_VERSION): if( SUSE.compareKernel(FIXED_VERSION) < 0 ): if( checkMessages() ): Core.updateStatus(Core.CRIT, "Bug: Soft Lockups and scale_rt_power messages, update kernel to apply version " + str(FIXED_VERSION) + " or higher") else: Core.updateStatus(Core.WARN, "Possible Soft Lockups and scale_rt_power issue, update kernel to apply version " + str(FIXED_VERSION) + " or higher") else: Core.updateStatus(Core.IGNORE, "Kernel was patched")
def BootDetails(): FSLIST = SUSE.getFileSystems() for FS in FSLIST: if ("/boot" == FS['MountPoint']): C_TOTAL = DeHumanize(FS['Size']) C_USED = DeHumanize(FS['UsedSpace']) C_FREE = DeHumanize(FS['AvailSpace']) return {'total': C_TOTAL, 'used': C_USED, 'free': C_FREE} return {}
fileOpen = "boot.txt" section = "menu.lst" content = {} if Core.getSection(fileOpen, section, content): kernParam = re.compile("kernel.*i915.i915_enable_rc6=0") for line in content: if kernParam.search(content[line]): return False return True ############################################################################## # Main Program Execution ############################################################################## AFFECTED_KERNEL='3.0.42-0.7' if( SUSE.compareKernel(AFFECTED_KERNEL) > 0 and SUSE.compareKernel(SUSE.SLE12GA) < 0 ): if( guiLoaded() ): if( sandyBridgeFound() ): if( notResolved() ): Core.updateStatus(Core.CRIT, "Susceptible to random GUI lockups, kernel startup paramenter needed") else: Core.updateStatus(Core.IGNORE, "Kernel parameter avoids Sandy Bridge lockups") else: Core.updateStatus(Core.IGNORE, "Sandy Bridge not found, skipping test") else: Core.updateStatus(Core.IGNORE, "GUI not loaded, skipping sandy bridge test") else: Core.updateStatus(Core.IGNORE, "Outside the kernel scope, skipping sandy bridge test") Core.printPatternResults()
# Local Function Definitions ############################################################################## def foundDuplicateErrors(): fileOpen = "smt.txt" section = "smt-sync.log" content = {} DUP_ERROR = re.compile("SCCSync.*Duplicate entry.*/SCCSync.pm line 725", re.IGNORECASE) if Core.getSection(fileOpen, section, content): for line in content: if DUP_ERROR.search(content[line]): return True return False ############################################################################## # Main Program Execution ############################################################################## SMT = SUSE.getServiceInfo('smt') if( SMT['OnForRunLevel'] or SMT['Running'] > 0 ): if foundDuplicateErrors(): Core.updateStatus(Core.REC, "Detected inconsequential duplicate SCCSync.pm line 725 errors, run smt-repos to confirm functionality.") else: Core.updateStatus(Core.IGNORE, "No duplicate SCCSync.pm line 725 errors found, AVOIDED") else: Core.updateStatus(Core.ERROR, "ERROR: SMT not enable or running, skipping") Core.printPatternResults()
SECTION = "/var/log/messages" CONTENT = [] Failure = re.compile("multipath.*failed path|multipath.*failing path|multipath.*mark as failed", re.IGNORECASE) if Core.getRegExSection(FILE_OPEN, SECTION, CONTENT): for LINE in CONTENT: if Failure.search(LINE): return True return False ############################################################################## # Main Program Execution ############################################################################## RPM_NAME = 'multipath-tools' RPM_VERSION = '0.4.9-112.1' if( SUSE.packageInstalled(RPM_NAME) ): INSTALLED_VERSION = SUSE.compareRPM(RPM_NAME, RPM_VERSION) if( INSTALLED_VERSION == 0 ): if( pathFailure() ): Core.updateStatus(Core.CRIT, "MPIO path failure detected, all paths will fail - update multipath-tools") else: Core.updateStatus(Core.WARN, "Susceptible to multiple MPIO path failures - update multipath-tools") else: Core.updateStatus(Core.IGNORE, "Bug fix applied for " + RPM_NAME) else: Core.updateStatus(Core.ERROR, "ERROR: RPM package not installed: " + RPM_NAME) Core.printPatternResults()
CONTENT = [] if Core.getExactSection(FILE_OPEN, SECTION, CONTENT): for LINE in CONTENT: if "/allow_dio=0" in LINE: return True return False ############################################################################## # Main Program Execution ############################################################################## #KERNEL_VERSION = '3.0.101-0.47.71' #SLE11 SP3 #KERNEL_VERSION = '3.0.101-68' #SLE11 SP4 #KERNEL_VERSION = '3.12.51-52.31' #SLE12 SP0 KERNEL_VERSION = '3.12.51-60.20' #SLE12 SP1 INSTALLED_VERSION = SUSE.compareKernel(KERNEL_VERSION) if( INSTALLED_VERSION < 0 ): if( xfsMounts() ): if( directIOAllowed() ): Core.updateStatus(Core.WARN, "Direct IO writes to XFS may cause filesystem damage") else: Core.updateStatus(Core.IGNORE, "Direct IO required, skipping pattern") else: Core.updateStatus(Core.IGNORE, "No XFS mounts found, skipping pattern") else: Core.updateStatus(Core.IGNORE, "Bug fixes applied for " + KERNEL_VERSION) Core.printPatternResults()
import SUSE ############################################################################## # Overriden (eventually or in part) from SDP::Core Module ############################################################################## META_CLASS = "SLE" META_CATEGORY = "Technology" META_COMPONENT = "Preview" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_Note" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_Note=https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#Intro.Support.Techpreviews|META_LINK_Support=https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#fate-317917|META_LINK_Fate=https://fate.suse.com/317917" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## PACKAGE = 'java-1_7_0-openjdk' if( SUSE.packageInstalled(PACKAGE) ): Core.updateStatus(Core.WARN, "OpenJDK is unsupported technology preview software: " + str(PACKAGE)) else: Core.updateStatus(Core.ERROR, "Package not found: " + str(PACKAGE)) Core.printPatternResults()
META_CLASS = "SLE" META_CATEGORY = "Updates" META_COMPONENT = "Registration" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_TID" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_TID=http://www.suse.com/support/kb/doc.php?id=7016501|META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Register=https://www.suse.com/products/server/how-to-buy/" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## REPO_INFO = SUSE.getZypperRepoList() PROD_INFO = SUSE.getZypperProductList() UNREG_LIST = [] DISABLED_LIST = [] if( PROD_INFO ): for PRODUCT in PROD_INFO: #print "\n-PRODUCT: ", PRODUCT REGISTERED = False ENABLED = False REPO_KEY = (str(PRODUCT['InternalName']) + str(PRODUCT['Version'].split('-')[0]) + '-updates').lower() #print " KEY: ", REPO_KEY for REPO in REPO_INFO: if REPO_KEY in REPO['Alias'].lower(): REGISTERED = True if REPO['Enabled']: ENABLED = True
VALUE = 1 break else: if( VALUE_TMP > VALUE ): VALUE = VALUE_TMP # print "VALUE = " + str(VALUE) return int(VALUE) ############################################################################## # Main Program Execution ############################################################################## CHECK_LIST = [SUSE.SLE12GA, SUSE.SLE11SP1, SUSE.SLE10SP4] NOT_FOUND = True for AFFECTED in CHECK_LIST: KERN_VER = SUSE.compareKernel(AFFECTED) if( KERN_VER >= 0 ): NOT_FOUND = False RP_FILTER = getRPfilter() if( RP_FILTER == 0 ): Core.updateStatus(Core.IGNORE, "RP_FILTER within known limits") elif( RP_FILTER == 1 ): Core.updateStatus(Core.WARN, "Potential network communication issues due to rp_filter") else: Core.updateStatus(Core.REC, "Potential network communication issues due to rp_filter") break if( NOT_FOUND ): Core.updateStatus(Core.ERROR, "Outside the kernel scope, skipping rp_filter") Core.printPatternResults()
for line in content: MATCHED = ERROR.search(content[line]) if MATCHED: try: DENIED[MATCHED.group(1)] = True DENIED_COUNT += 1 except: True if( DENIED_COUNT > 0 ): Core.updateStatus(Core.WARN, "Observed " + str(DENIED_COUNT) + " AppArmor denial messages for profiles(s): " + str(DENIED.keys())) else: Core.updateStatus(Core.SUCC, "No AppArmor denial messages found") ############################################################################## # Main Program Execution ############################################################################## APPARMOR = SUSE.getServiceDInfo('apparmor.service') if( len(APPARMOR) > 0 ): if( APPARMOR['ActiveState'].lower() == 'active' and APPARMOR['SubState'].lower() == 'exited' ): checkRejectMessages() else: Core.updateStatus(Core.ERROR, "AppArmor not running, skipping profile check") else: Core.updateStatus(Core.ERROR, "AppArmor disabled, skipping profile check") Core.printPatternResults()
for LINE in CONTENT: if ERROR_MSG.search(LINE): return True SECTION = "/var/log/messages" CONTENT = [] if Core.getRegExSection(FILE_OPEN, SECTION, CONTENT): for LINE in CONTENT: if ERROR_MSG.search(LINE): return True return False ############################################################################## # Main Program Execution ############################################################################## if( SUSE.packageInstalled('orarun') ): if( SUSE.packageInstalled('libXi6') ): if( SUSE.packageInstalled('libcap1') ): Core.updateStatus(Core.IGNORE, "Orarun required packages installed, not applicable") else: if( errorMessagesFound() ): Core.updateStatus(Core.CRIT, "Failed oraran installation, missing required package: libcap1") else: Core.updateStatus(Core.WARN, "Oraran installation will fail, missing required package: libcap1") else: if( SUSE.packageInstalled('libcap1') ): if( errorMessagesFound() ): Core.updateStatus(Core.CRIT, "Failed oraran installation, missing required package: libXi6") else: Core.updateStatus(Core.WARN, "Oraran installation will fail, missing required package: libXi6") else:
############################################################################## # Overriden (eventually or in part) from SDP::Core Module ############################################################################## META_CLASS = "Basic Health" META_CATEGORY = "SLE" META_COMPONENT = "Cron" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_TID" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_TID=http://www.suse.com/support/kb/doc.php?id=7014607" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) PACKAGE = "cron" SERVICE = "cron.service" ############################################################################## # Main Program Execution ############################################################################## if( SUSE.packageInstalled(PACKAGE) ): SUSE.serviceDHealth(SERVICE) else: Core.updateStatus(Core.ERROR, "Basic Service Health; Package Not Installed: " + str(PACKAGE)) Core.printPatternResults()
META_CLASS = "Security" META_CATEGORY = "SUMA" META_COMPONENT = "struts" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_Security" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_Security=http://lists.opensuse.org/opensuse-security-announce/2014-07/msg00008.html" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) LTSS = False NAME = 'struts' MAIN = '' SEVERITY = 'Important' TAG = 'SUSE-SU-2014:0902-1' PACKAGES = {} SUMA = suma.getSumaInfo() if ( SUMA['Installed'] ): if ( SUMA['Version'] == '2.1' ): PACKAGES = { 'struts': '1.2.9-162.33.1', } SUSE.securityAnnouncementPackageCheck(NAME, MAIN, LTSS, SEVERITY, TAG, PACKAGES) else: Core.updateStatus(Core.ERROR, "ERROR: " + NAME + " Security Announcement: Outside the SUMA version scope") else: Core.updateStatus(Core.ERROR, "ERROR: " + NAME + " Security Announcement: SUMA Not Installed") Core.printPatternResults()
META_CLASS = "eDirectory" META_CATEGORY = "LUM" META_COMPONENT = "Authentication" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_TID" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_TID=https://www.novell.com/support/kb/doc.php?id=7015635|META_LINK_BUG=https://bugzilla.novell.com/show_bug.cgi?id=882906" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## SERVER = SUSE.getHostInfo() if( SERVER['OES'] ): if( SERVER['OESVersion'] == 11 ): if( SERVER['OESPatchLevel'] == 1 or SERVER['OESPatchLevel'] == 2 ): RPM_NAME = 'novell-NLDAPbase' RPM_VERSION = '8.8.7.4-0.4.6.1' if( SUSE.packageInstalled(RPM_NAME) ): INSTALLED_VERSION = SUSE.compareRPM(RPM_NAME, RPM_VERSION) if( INSTALLED_VERSION < 0 ): Core.updateStatus(Core.WARN, "Detected LUM authentication issue, update server to apply fixes") else: Core.updateStatus(Core.IGNORE, "LUM authentication issue AVOIDED") else: Core.updateStatus(Core.ERROR, "ERROR: " + RPM_NAME + " not installed") else: Core.updateStatus(Core.ERROR, "Outside the OES Patch Level Scope")
def winBindFailures(): fileOpen = "samba.txt" section = "wbinfo -u" content = {} if Core.getSection(fileOpen, section, content): for line in content: #if something in section if "Error looking up domain users" in content[line]: return True return False ############################################################################## # Main Program Execution ############################################################################## if( SUSE.compareKernel(SUSE.SLE11SP2) >= 0 and SUSE.compareKernel(SUSE.SLE11SP3) < 0 ): if( SUSE.packageInstalled("samba") and SUSE.packageInstalled("samba-winbind") ): if( SUSE.compareRPM("samba", "3.6.3-0.30.1") == 0 ): if( winBindRunning() ): Core.updateStatus(Core.WARN, "Winbind AD lookups may fail, update system for newer Samba packages") if( winBindFailures() ): Core.updateStatus(Core.CRIT, "Winbind AD lookup failure, update system for newer Samba packages") else: Core.updateStatus(Core.ERROR, "Winbind service is not running, skipping test") else: Core.updateStatus(Core.ERROR, "Samba version has been verified, skipping test") else: Core.updateStatus(Core.ERROR, "Samba/Winbind not installed, skipping test") else: Core.updateStatus(Core.ERROR, "Outside the kernel scope")
import sys, os, Core, SUSE ############################################################################## # Overriden (eventually or in part) from SDP::Core Module ############################################################################## META_CLASS = "SLE" META_CATEGORY = "Support" META_COMPONENT = "Life Cycle" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_Security" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_Security=http://lists.opensuse.org/opensuse-security-announce/2013-11/msg00007.html|META_LINK_LifeCycle=http://support.novell.com/lifecycle/" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## if( SUSE.compareKernel(SUSE.SLE10SP4) >= 0 and SUSE.compareKernel(SUSE.SLE10SP5) < 0 ): Core.updateStatus(Core.WARN, "General Support has ended for SLE10 SP4") else: Core.updateStatus(Core.ERROR, "Outside kernel scope, skipping product life cycle test") Core.printPatternResults()
section = 'CASAcli -l' content = {} if Core.getSection(fileOpen, section, content): for line in content: if "Found 0 credential set" in content[line]: return True return False ############################################################################## # Main Program Execution ############################################################################## PACKAGE_NAME = 'glibc' BROKE_VERSION = '2.11.3-17.62.1' if( SUSE.packageInstalled(PACKAGE_NAME) ): INFO = SUSE.getRpmInfo(PACKAGE_NAME) # print "INFO = " + str(INFO) # if( INFO['version'] == BROKE_VERSION ): if( INFO['version'] == BROKE_VERSION and FIXED_VERSION > INFO['version']): if( missingCASACredentials() ): Core.updateStatus(Core.CRIT, "CASA credentials missing") else: Core.updateStatus(Core.IGNORE, "CASA credentials present") else: Core.updateStatus(Core.IGNORE, "Valid version installed, issue fixed") else: Core.updateStatus(Core.ERROR, "Package not installed, abort test") Core.printPatternResults()
# Local Function Definitions ############################################################################## def delayedBootMessages(): FILE_OPEN = "boot.txt" SECTION = "/dmesg" CONTENT = [] ERROR_STRING = re.compile("pci.*vpd.*failed.*firmware bug", re.IGNORECASE) if Core.getRegExSection(FILE_OPEN, SECTION, CONTENT): for LINE in CONTENT: if ERROR_STRING.search(LINE): return True return False ############################################################################## # Main Program Execution ############################################################################## SERVER = SUSE.getHostInfo() thisVersion = '3.0.101-71' thatVersion = SERVER['KernelVersion'] if( Core.compareVersions(thisVersion, thatVersion) == 0 ): Core.updateStatus(Core.WARN, "Kernel is susceptible to delayed boots, update system to resolve") if( delayedBootMessages() ): Core.updateStatus(Core.CRIT, "Boot delays due to kernel issue, update system to resolve") else: Core.updateStatus(Core.IGNORE, "The kernel version " + str(SERVER['KernelVersion']) + " is sufficient") Core.printPatternResults()
def anyPackageFound(PACKAGES): for PACKAGE_NAME in PACKAGES: if ( SUSE.packageInstalled(PACKAGE_NAME) ): return True return False
def getKdumpInfo(): INFO = {'Installed': False, 'Active': False} if( SUSE.packageInstalled('kdump') and SUSE.packageInstalled('kexec-tools') ): INFO['Installed'] = True SERVICE_NAME = 'kdump.service' SERVICE = SUSE.getServiceDInfo(SERVICE_NAME) if( len(SERVICE) > 0 and SERVICE['ActiveState'].lower() == 'active' ): INFO['Active'] = True return INFO ############################################################################## # Main Program Execution ############################################################################## SERVER = SUSE.getHostInfo() if 'ppc64le' in SERVER['Architecture'].lower(): if( SERVER['DistroVersion'] == 12 and SERVER['DistroPatchLevel'] < 1 ): PACKAGE = 'kdump' AFFECTED_PACKAGE_VER = '0.8.15-10.1' KDUMP = getKdumpInfo() if( KDUMP['Active'] ): if( Core.compareVersions(SUSE.getRpmInfo(PACKAGE)['version'], AFFECTED_PACKAGE_VER) <= 0 ): Core.updateStatus(Core.CRIT, "Triggering kdump will fail to create a crashdump, consider makedumpfile") else: Core.updateStatus(Core.IGNORE, "Active Kdump crash issue resolved, not applicable") else: Core.updateStatus(Core.ERROR, "Kdump disabled, not applicable") else: Core.updateStatus(Core.ERROR, "Outside distribution and patchlevel scope, not applicable") else:
############################################################################## META_CLASS = "SLE" META_CATEGORY = "Technology" META_COMPONENT = "Preview" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_Note" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_Note=https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#Intro.Support.Techpreviews|META_LINK_Support=https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#fate-315333|META_LINK_Fate=https://fate.suse.com/315333|META_LINK_Docs=http://gcc.gnu.org/onlinedocs/gcc/" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## SERVER = SUSE.getHostInfo() PACKAGE = 'gcc' if "s390x" in SERVER['Architecture'].lower(): if( SUSE.packageInstalled(PACKAGE) ): Core.updateStatus(Core.WARN, "Hot Patching support in gcc on s390x is unsupported technology preview software") else: Core.updateStatus(Core.ERROR, "Package not installed: " + str(PACKAGE)) else: Core.updateStatus(Core.ERROR, "Invalid architecture: " + str(SERVER['Architecture'])) Core.printPatternResults()
Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Local Function Definitions ############################################################################## def checkDNSStartFail(): fileOpen = "dns.txt" section = "named.run" content = {} if Core.getSection(fileOpen, section, content): for line in content: if "zone 'RootServerInfo.': Designated Server is not available" in content[line]: return True return False ############################################################################## # Main Program Execution ############################################################################## if (SUSE.packageInstalled('novell-bind')): if( checkDNSStartFail() ): Core.updateStatus(Core.CRIT, "RootServerInfo DNS zone designated primary observed") else: Core.updateStatus(Core.IGNORE, "RootServerInfo DNS zone correctly missing designated primary") else: Core.updateStatus(Core.ERROR, "ERROR: novell-bind not installed, skipping test") Core.printPatternResults()
META_CATEGORY = "SLE" META_COMPONENT = "kgraft-patch" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_Security" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_Security=https://lists.opensuse.org/opensuse-security-announce/2018-05/msg00043.html" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) LTSS = True NAME = 'kgraft-patch' MAIN = '' SEVERITY = 'Important' TAG = 'SUSE-SU-2018:1243-1' PACKAGES = {} SERVER = SUSE.getHostInfo() if ( SERVER['DistroVersion'] == 12): if ( SERVER['DistroPatchLevel'] == 0 ): PACKAGES = { 'kgraft-patch-3_12_61-52_72-default': '10-2.1', 'kgraft-patch-3_12_61-52_72-xen': '10-2.1', } SUSE.securityAnnouncementPackageCheck(NAME, MAIN, LTSS, SEVERITY, TAG, PACKAGES) else: Core.updateStatus(Core.ERROR, "ERROR: " + NAME + " Security Announcement: Outside the service pack scope") else: Core.updateStatus(Core.ERROR, "ERROR: " + NAME + " Security Announcement: Outside the distribution scope") Core.printPatternResults()
############################################################################## # Overriden (eventually or in part) from SDP::Core Module ############################################################################## META_CLASS = "SUMA" META_CATEGORY = "Master TID" META_COMPONENT = "All" PATTERN_ID = os.path.basename(__file__) PRIMARY_LINK = "META_LINK_TID" OVERALL = Core.TEMP OVERALL_INFO = "NOT SET" OTHER_LINKS = "META_LINK_TID=https://www.suse.com/support/kb/doc.php?id=7012610|META_LINK_Docs=https://www.suse.com/documentation/suse_manager/" Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) ############################################################################## # Main Program Execution ############################################################################## if( SUSE.packageInstalled('susemanager') ): Core.updateStatus(Core.REC, "Consider TID7012610 - SUSE Manager Master TID") elif( SUSE.packageInstalled('susemanager-proxy') ): Core.updateStatus(Core.REC, "Consider TID7012610 - SUSE Manager Master TID") else: Core.updateStatus(Core.IGNORE, "SUMA not found, not applicable") Core.printPatternResults()