SDP::SUSE - The Support Diagnostic Pattern perl library for SUSE OS
use SDP::SUSE;
Provides necessary functions specific to patterns developed against supportconfig running on SUSE servers.
SUSE Linux Enterprise Server/Desktop kernel versions
Returns a hash containing host and OES information.
my %HOST_INFO = SDP::SUSE::getHostInfo(); if ( $HOST_INFO{'oes'} ) { SDP::Core::updateStatus(STATUS_SUCCESS, "OES Installed on $HOST_INFO{'hostname'}"); } else { SDP::Core::updateStatus(STATUS_WARNING, "OES NOT Installed on $HOST_INFO{'hostname'}"); }
None
Hash with host information.
None
architecture, hostname, kernel, distribution, patchlevel, oes, oesversion, oesmajor, oesdistribution, oespatchlevel, oesbuild, nows, nowsversion
Returns a hash containing loaded kernel module information.
my $DRIVER_NAME = 'zapi'; my %DRIVER_INFO = SDP::SUSE::getDriverInfo($DRIVER_NAME); if ( $DRIVER_INFO{'loaded'} ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Driver $DRIVER_NAME is loaded and supported = $DRIVER_INFO{'supported'}"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Driver $DRIVER_NAME is NOT loaded"); }
$DRIVER_NAME (The name of the driver about which you want information.)
Hash with load kernel driver information.
None
name, loaded, filename, version, license, description, srcversion, supported, vermagic
Returns a hash containing loaded kernel module information.
my $SERVICE_NAME = 'novell-nss'; my %SERVICE_INFO = SDP::SUSE::getServiceInfo($SERVICE_NAME); if ( $SERVICE_INFO{'running'} > 0 ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Service $SERVICE_INFO{'name'} is running"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Service $SERVICE_INFO{'name'} is NOT running"); }
$SERVICE_NAME (The system service about which you want information.)
Hash with service information information.
None
name (The service name)
running (-1=Unknown, 0=Unused or Dead, 1=Running)
bootlevels (A list of runlevel numbers in which the service is turned on for boot. An empty string means the service is turned off at boot for all runlevels.)
runlevel (The current system runlevel)
runlevelstatus (0=Service is turned off for the current runlevel, 1=Service is turned on for the current runlevel)
Gathers information about the service listening on $PORT_NUMBER
my $PORT_NUMBER = '22'; my %PORT_INFO = SDP::SUSE::portInfo($PORT_NUMBER); if ( %PORT_INFO ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Port $PORT_NUMBER Is listening"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Port $PORT_NUMBER Is NOT listening"); }
$PORT_NUMBER (The network port number to check)
Hash with port information
port, service
None
Identifies all IPv4 IP addresses bound to the server.
my $i = ''; my @BOUND_IP = (); my $TYPE = ''; my $PRI = 0; my $SEC = 0; my $ALL = 0;
if ( SDP::SUSE::getBoundIPs(\@BOUND_IP) ) { for $i ( 0 .. $#BOUND_IP ) { if ( $BOUND_IP[$i]{'issec'} ) { $TYPE = 'Secondary'; $SEC++;; } else { $TYPE = 'Primary'; $PRI++; } SDP::Core::updateStatus(STATUS_PARTIAL, "$TYPE $BOUND_IP[$i]{'interface'} addr:$BOUND_IP[$i]{'addr'}"); } $ALL = scalar(@BOUND_IP); SDP::Core::updateStatus(STATUS_ERROR, "Bound IP Addresses: Primary=$PRI, Secondary=$SEC, TOTAL=$ALL"); } else { SDP::Core::updateStatus(STATUS_ERROR, "Error: No IP addresses bound to the server"); }
Array address
Array of hashes containing the address details
interface, addr, bcast, mask, mac, irq, config, issec
None
Gathers information from the routing table.
my $i = ''; my @NETWORK_ROUTES = ();
if ( SDP::SUSE::netRouteTable(\@NETWORK_ROUTES) ) { for $i ( 0 .. $#NETWORK_ROUTES ) { SDP::Core::printDebug('ROUTE', "$i of $#NETWORK_ROUTES: $NETWORK_ROUTES[$i]{'gateway'} - $NETWORK_ROUTES[$i]{'flags'}"); } }
Array address
Array of hashes
destination, gateway, genmask, flags, mss, window, irtt, interface
None
Gets all fields from the mounted file systems and the fstab file. Information is returned as an array of hashes.
my @MOUNTS = SDP::SUSE::getFileSystems(); my $TMP; my $FOUND = 0; foreach $TMP (@MOUNTS) { if ( $TMP->{'MPT'} eq '/' ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Found root device $TMP->{'DEV'} mounted on $TMP->{'MPT'} with file system $TMP->{'TYPE'}"); $FOUND = 1; } } SDP::Core::setStatus(STATUS_CRITICAL, 'Root file system not found') if ( ! $FOUND );
None
Array of hashes
DEV, DEVM, DEVF, MPT, TYPE, OPTIONS, DUMP, FSCK, MOUNTED, SIZE, USED, AVAIL, USEPCT
DEV = The active device path DEVM = The device path from the mount command DEVF = The device path from /etc/fstab MPT = The mount point TYPE = File system type OPTIONS = Options used when mounted or mounting DUMP = /etc/fstab dump field, -1 if unknown FSCK = /etc/fstab fsck field, -1 if unknown MOUNTED = -1 Unknown, 0 Not mounted, 1 Mounted SIZE = -1 Unknown, file system size in bytes USED = -1 Unknown, file system space used in bytes AVAIL = -1 Unknown, file system space available in bytes USEPCT = -1 Unknown, file system percent used
None
Returns a hash containing supportconfig information.
my $REQUIRED_VERSION = '2.25-173'; my %SC_INFO = SDP::SUSE::getSCInfo(); if ( SDP::Core::compareVersions($SC_INFO{'version'}, $REQUIRED_VERSION) >= 0 ) { SDP::Core::updateStatus(STATUS_ERROR, "Supportconfig v$SC_INFO{'version'} meets minimum requirement"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Supportconfig v$SC_INFO{'version'} NOT sufficient, $REQUIRED_VERSION or higher needed"); }
None
Hash with supportconfig information.
None
version, scriptdate, cmdline, config, envalue, kernvalue, rundate
Uses SDP::Core::compareVersions to compare $test_version against the running kernel version. Only the most significant version components are compared. For example, if 2.6.5 is compared with 2.6.16.60-0.23, then only 2.6.5 and 2.6.16 will be used for the comparison.
if ( SDP::SUSE::compareKernel(SLE10SP1) >= 0 && SDP::SUSE::compareKernel(SLE10SP2) < 0) { SDP::Core::updateStatus(STATUS_SUCCESS, "Running SLES10 SP1 Kernel"); } else { SDP::Core::updateStatus(STATUS_ERROR, "ABORT: Outside the kernel scope"); }
$test_version (The version string to which the running kernel's version is compared.)
-1 if kernel_version < $test_version
0 if kernel_version == $test_version
1 if kernel_version > $test_version
None
Uses SDP::Core::compareVersions to compare the $DRIVER_NAME and $TEST_VERSION against the loaded driver version. Only the most significant version components are compared. For example, if 2.6.5 is compared with 2.6.16.60-0.23, then only 2.6.5 and 2.6.16 will be used for the comparison.
my $DRIVER_NAME = 'mptctl'; my $TEST_VERSION = '5.25'; if ( SDP::SUSE::compareDriver($DRIVER_NAME, $TEST_VERSION) >= 0 ) { SDP::Core::updateStatus(STATUS_SUCCESS, "$DRIVER_NAME version meets minimum requirement"); } else { SDP::Core::updateStatus(STATUS_WARNING, "$DRIVER_NAME version NOT sufficient, $TEST_VERSION or higher needed"); }
$DRIVER_NAME (The driver name that needs to be compared.)
$TEST_VERSION (The version string to which the loaded driver's version is compared.)
-1 if driver_version < $TEST_VERSION
0 if driver_version == $TEST_VERSION
1 if driver_version > $TEST_VERSION
None
Uses SDP::Core::compareVersions to compare $TEST_VERSION against the supportconfig version. Only the most significant version components are compared. For example, if 2.6.5 is compared with 2.6.16.60-0.23, then only 2.6.5 and 2.6.16 will be used for the comparison.
my $TEST_VERSION = '2.25-173'; if ( SDP::SUSE::compareSupportconfig($TEST_VERSION) >= 0 ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Supportconfig version meets minimum requirement"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Supportconfig version NOT sufficient, $TEST_VERSION or higher needed"); }
$TEST_VERSION (The version string to which supportconfig's version is compared.)
-1 if supportconfig_version < $TEST_VERSION
0 if supportconfig_version == $TEST_VERSION
1 if supportconfig_version > $TEST_VERSION
None
Uses SDP::Core::compareVersions to compare $test_version against the installed RPM version. Comparisons are only valid on a single installed RPM; the comparison is skipped if multiple RPMs of the same name are installed. Only the most significant version components are compared. For example, if 2.6.5 is compared with 2.6.16.60-0.23, then only 2.6.5 and 2.6.16 will be used for the comparison. Letters in version strings are compared as separate elements. So 2.6SP3 would be compared as 2.6.SP.3. Letters are compared as a string comparison, and are case sensitive.
my $RPM_NAME = 'autofs'; my $VERSION_TO_COMPARE = '1.1.2'; my $RPM_COMPARISON = SDP::SUSE::compareRpm($RPM_NAME, $VERSION_TO_COMPARE); if ( $RPM_COMPARISON == 2 ) { SDP::Core::updateStatus(STATUS_ERROR, "ERROR: RPM $RPM_NAME Not Installed"); } elsif ( $RPM_COMPARISON > 2 ) { SDP::Core::updateStatus(STATUS_ERROR, "ERROR: Multiple Versions of $RPM_NAME RPM are Installed"); } else { if ( $RPM_COMPARISON < 0 ) { SDP::Core::updateStatus(STATUS_WARNING, "The installed $RPM_NAME RPM version is less than version $VERSION_TO_COMPARE"); } else { SDP::Core::updateStatus(STATUS_ERROR, "The installed $RPM_NAME RPM version meets or exceeds version $VERSION_TO_COMPARE"); } }
$rpm_name (The RPM name you are testing)
$test_version (The RPM version string to which the installed RPM version is compared.)
-1 if installed_rpm_version < $test_version
0 if installed_rpm_version == $test_version
1 if installed_rpm_version > $test_version
2 if RPM is not installed
3 if Multiple RPM versions exist
None
Returns an array of hashes containing RPM information. If the RPM is not installed, then @RPM_INFO is not set.
my $RPM_NAME = 'kernel-xen'; my @RPM_INFO = SDP::SUSE::getRpmInfo($RPM_NAME); if ( $#RPM_INFO < 0 ) { SDP::Core::updateStatus(STATUS_ERROR, "ERROR: RPM $RPM_NAME Not Installed"); } elsif ( $#RPM_INFO > 0 ) { SDP::Core::updateStatus(STATUS_ERROR, "ERROR: Multiple $RPM_NAME RPMs Installed"); } else { SDP::Core::updateStatus(STATUS_SUCCESS, "RPM $RPM_INFO[0]{'name'}-$RPM_INFO[0]{'version'} installed on $RPM_INFO[0]{'installed'}"); }
$rpm_name
@RPM_INFO (An array of hashes containing RPM information)
None
name, version, vendor, installed
Confirms $PKG_NAME is installed on the system
my $PKG_NAME = 'supportutils'; if ( SDP::SUSE::packageInstalled($PKG_NAME) ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Package Installed: $PKG_NAME"); } else { SDP::Core::updateStatus(STATUS_CRITICAL, "Package NOT Installed: $PKG_NAME"); }
$pacakge_name (The package name to validate)
1 if Package is installed
0 if Package is NOT installed
None
Checks for a corosync.conf to show HAE is enabled.
if ( SDP::SUSE::haeEnabled() ) { SDP::Core::updateStatus(STATUS_SUCCESS, "HAE Enabled"); } else { SDP::Core::updateStatus(STATUS_ERROR, "HAE Disabled"); }
None
0 if HAE is disabled, corosync.conf missing
1 if HAE is enabled, corosync.conf found
None
Checks if the named package passed it's RPM validation check.
my $FILE_OPEN = 'fs-autofs.txt'; my $PKG_NAME = 'autofs'; my @EXCEPTION_LIST = (); if ( SDP::SUSE::packageVerify($FILE_OPEN, $PKG_NAME, \@EXCEPTION_LIST) > 1 ) { SDP::Core::updateStatus(STATUS_CRITICAL, "Failed RPM Validation: $PKG_NAME"); } else { SDP::Core::updateStatus(STATUS_SUCCESS, "Passed RPM Validation: $PKG_NAME"); }
$FILE_OPEN (The file in which the rpm -V was executed.)
$PKG_NAME (The package name to validate)
$EXCEPTION_LIST (An address to an array of files or directories to exclude from the check. OPTIONAL)
0 if Package is valid, no differences found
1 if Package is valid, or only docs or configuration files have been modified
2 if Package is not valid, non-doc or non-configuration files have been modified
3 if Package is not valid, binaries or library files have been modified
4 if Package is not valid, unknown reason
None
A function specific to checking packages in a Security Advisory type format. The function will trigger a script exit if the @rpms_to_check are not installed. It is assumed that the @rpms_to_check are different packages with the same $fixed_rpm_version for each. For example, @rpms_to_check might be cups and cups-devel, but the fix is version 1.1.0 for each (cups-1.1.0 and cups-devel-1.1.0). This function is not intended to check two different versions on the same server. For example, java-1_4_2 and java-1_5_0 on the same server should not be checked with this function because securityPackageCheck will abort if it finds any occurance of a package not installed.
SDP::SUSE::securityPackageCheck($title, $advisory_number, $advisory_description, \@rpms_to_check, $fixed_rpm_version);
$title (Short one or two word title of the Advisory; ie Kerberos, CUPS or IBM Java)
$advisory_number (The security advisory "Announcement ID," ie SUSE-SA:2009:007)
$advisory_description (The security advisory "Vulnerability Type," ie "Local privilege escalation")
\@rpms_to_check (An array of rpm packages with the same version that are affected by the security advisory; ie cups, cups-libs, cups-devel)
$fixed_rpm_version (The version of the @rpms_to_check in which the security vulnerabilty has been fixed, ie 1.1.23-40.38)
1 if Package is confirmed to be installed and fixed
0 if Package cannot be confirmed as installed and fixed
@PATTERN_RESULTS (Adds the CVE key value pair)
None
A function specific to checking packages in a Security Advisory type format. The function will trigger a script exit if the @rpms_to_check are not installed. It is assumed that the @rpms_to_check are different packages with the same $fixed_rpm_version for each. For example, @rpms_to_check might be cups and cups-devel, but the fix is version 1.1.0 for each (cups-1.1.0 and cups-devel-1.1.0). This function is not intended to check two different versions on the same server. For example, java-1_4_2 and java-1_5_0 on the same server should not be checked with this function because securityPackageCheck will abort if it finds any occurance of a package not installed.
SDP::SUSE::securitySeverityPackageCheck($TITLE, $SEVERITY, $VULNERABILITY_TYPE, \@RPMS_TO_CHECK, $FIXED_RPM_VERSION);
$PRODUCT (Short one or two word title of the Advisory; ie Kerberos, CUPS or IBM Java)
$SEVERITY (The CVSS v2 Base Score number)
$VULNERABILITY_TYPE (The security advisory "Vulnerability Type," ie "Local privilege escalation")
\@RPMS_TO_CHECK (An array of rpm packages with the same version that are affected by the security advisory; ie cups, cups-libs, cups-devel)
$FIXED_RPM_VERSION (The version of the @rpms_to_check in which the security vulnerabilty has been fixed, ie 1.1.23-40.38)
1 if Package is confirmed to be installed and fixed
0 if Package cannot be confirmed as installed and fixed
@PATTERN_RESULTS (Adds the CVE key value pair)
None
A function specific to checking packages in a Security Advisory type format. No script exists are triggered. SDP::Core::setStatus is not called. If no @rpms_to_check are found, then STATUS_PARTIAL is returned. It is assumed that the @rpms_to_check are different packages with the same $fixed_rpm_version for each. For example, @rpms_to_check might be cups and cups-devel, but the fix is version 1.1.0 for each (cups-1.1.0 and cups-devel-1.1.0).
SDP::SUSE::securityPackageCheckNoError($title, $advisory_number, $advisory_description, \@rpms_to_check, $fixed_rpm_version);
$title (Short one or two word title of the Advisory; ie Kerberos, CUPS or IBM Java)
$advisory_number (The security advisory "Announcement ID," ie SUSE-SA:2009:007)
$advisory_description (The security advisory "Vulnerability Type," ie "Local privilege escalation")
\@rpms_to_check (An array of rpm packages with the same version that are affected by the security advisory; ie cups, cups-libs, cups-devel)
$fixed_rpm_version (The version of the @rpms_to_check in which the security vulnerabilty has been fixed, ie 1.1.23-40.38)
1 if Package(s) is confirmed to be installed and fixed
0 if Package(s) cannot be confirmed as installed and fixed
@PATTERN_RESULTS (Adds the PKG key value pair)
SDP::Core::setStatus()
Goes here...
SDP::SUSE::securityAnnouncementPackageCheck($NAME, $SEVERITY, $TAG, %PACKAGES);
$NAME (The product name being checked, like PostgreSQL, Acroread, or Firefix)
$MAIN (The main rpm package name that must be installed to indicate $NAME is found OR leave empty to check all packages.)
$SEVERITY (Critical, Important, etc. A single word shown in the Rating field of the security announcement)
$TAG (The security announcement ID, like SUSE-SU-2013:0633-1)
%PACKAGES (A hash of packages and their version numbers in which this issue is fixed to be checked. The key is the package name and the value is the fixed version string)
1 if Package(s) is confirmed to be installed and fixed
0 if Package(s) cannot be confirmed as installed and fixed
A function specific to checking packages in a Security Advisory type format. No script exists are triggered. SDP::Core::setStatus is not called. If no @rpms_to_check are found, then STATUS_PARTIAL is returned. It is assumed that the @rpms_to_check are different packages with the same $fixed_rpm_version for each. For example, @rpms_to_check might be cups and cups-devel, but the fix is version 1.1.0 for each (cups-1.1.0 and cups-devel-1.1.0).
SDP::SUSE::securitySeverityPackageCheckNoError($title, $advisory_severity, $advisory_description, \@rpms_to_check, $fixed_rpm_version);
$title (Short one or two word title of the Advisory; ie Kerberos, CUPS or IBM Java)
$advisory_severity (The CVSS v2 Base Score Number)
$advisory_description (The security advisory "Vulnerability Type," ie "Local privilege escalation")
\@rpms_to_check (An array of rpm packages with the same version that are affected by the security advisory; ie cups, cups-libs, cups-devel)
$fixed_rpm_version (The version of the @rpms_to_check in which the security vulnerabilty has been fixed, ie 1.1.23-40.38)
1 if Package(s) is confirmed to be installed and fixed
0 if Package(s) cannot be confirmed as installed and fixed
@PATTERN_RESULTS (Adds the PKG key value pair)
SDP::Core::setStatus()
A function specific to checking kernel packages in a Security Advisory type format. The function returns a 1 if the system kernel is outside the scope specified.
SDP::SUSE::securityKernelCheck($kernelMin, $kernelMax, $kernelFix, $advisoryNumber, $advisoryDescription);
$kernelMin (The minimum kernel version in which the vulnerability is found. Provides the beginning scope in which to look.)
$kernelMax (The maximum kernel version in which the vulnerability is found. Provides the ending scope in which to look.)
$kernelFix (The kernel version in which the vulnerability is fixed.)
$advisoryNumber (The security advisory "Announcement ID," ie SUSE-SA:2009:007)
$advisoryDescription (The security advisory "Vulnerability Type," ie "Local privilege escalation")
0 if $kernelMin <= System Kernel < $kernelMax
1 if System Kernel is outside $kernelMin/$kernelMax scope
@PATTERN_RESULTS (Adds the CVE key value pair)
None
A function specific to checking kernel packages in a Security Advisory type format. The function returns a 1 if the system kernel is outside the scope specified.
SDP::SUSE::securitySeverityKernelCheck($kernelMin, $kernelMax, $kernelFix, $severityValue, $advisoryDescription);
$kernelMin (The minimum kernel version in which the vulnerability is found. Provides the beginning scope in which to look.)
$kernelMax (The maximum kernel version in which the vulnerability is found. Provides the ending scope in which to look.)
$kernelFix (The kernel version in which the vulnerability is fixed.)
$severityValue (The CVSS v2 Base Score Number)
$advisoryDescription (The security advisory "Vulnerability Type," ie "Local privilege escalation")
0 if $kernelMin <= System Kernel < $kernelMax
1 if System Kernel is outside $kernelMin/$kernelMax scope
@PATTERN_RESULTS (Adds the CVE key value pair)
None
A function specific to checking kernel packages in a Security announcement type format. The function returns a 1 if the system kernel is outside the scope specified.
SDP::SUSE::securitySeverityKernelAnnouncement($kernelMin, $kernelMax, $kernelFix, $severityValue, $advisoryID);
$kernelMin (The minimum kernel version in which the vulnerability is found. Provides the beginning scope in which to look.)
$kernelMax (The maximum kernel version in which the vulnerability is found. Provides the ending scope in which to look.)
$kernelFix (The kernel version in which the vulnerability is fixed.)
$severityValue (A severity string like "Important")
$announcementID (The security announcement ID, like "SUSE-SU-2012:0153-2")
0 if $kernelMin <= System Kernel < $kernelMax
1 if System Kernel is outside $kernelMin/$kernelMax scope
@PATTERN_RESULTS (Adds the CVE key value pair)
None
Checks if the daemon, boot or xinetd service is turned on at boot.
my $service_name = 'autofs'; if ( SDP::SUSE::serviceBootstate($service_name) ) { SDP::Core::updateStatus(STATUS_SUCCESS, "Turned on at boot: $service_name"); } else { SDP::Core::updateStatus(STATUS_WARNING, "Turned off at boot: $service_name"); }
$service_name (The daemon or service to check)
1 if Service is turned on at boot
0 if Service is turned off at boot
None
Checks if the specified service is currently running
my $file_name = 'fs-autofs.txt'; my $service_name = 'autofs'; if ( SDP::SUSE::serviceStatus($file_name, $service_name) > 0 ) { SDP::Core::updateStatus(STATUS_WARNING, "NOT Running: $service_name"); } else { SDP::Core::updateStatus(STATUS_ERROR, "Running: $service_name"); }
$file_name (The file in which the "$service_name status" command was run)
$service_name (The daemon or service to check)
0 if Service is running
1 if Service is unused
2 if Service is down or dead
3 if Service is in an unknown state
None
Checks the basic service health; checking RPM validation, run state and chkconfig state. Limited to specific services that have dedicated information files.
my $FILE_OPEN = "dns.txt"; my $CHECK_PACKAGE = "bind"; my $CHECK_SERVICE = "named"; my @EXCLUDES = (); if ( packageInstalled($CHECK_PACKAGE) ) { SDP::SUSE::serviceHealth($FILE_OPEN, $CHECK_PACKAGE, $CHECK_SERVICE, \@EXCLUDES); } else { SDP::Core::updateStatus(STATUS_ERROR, "Basic Service Health; Package Not Installed: $CHECK_PACKAGE"); }
$FILE_OPEN (The file that contains the basic service health information)
$CHECK_PACKAGE (The package name to check)
$CHECK_SERVICE (The service name to check)
@EXCLUDES (Array of files to exclude from an RPM validation check)
0 if Service is healthy
1 if Service is unhealthy
None
Identifies a Xen DomU virtual machine
if ( SDP::SUSE::xenDomU() ) { SDP::Core::updateStatus(STATUS_SUCCESS, "The server is a Xen DomU virtual machine"); } else { SDP::Core::updateStatus(STATUS_ERROR, "ABORT: Not a Xen DomU"); }
Non
0 if server is NOT a DomU
1 if server is a DomU
None
Identifies an installed Xen Dom0 virtual machine server
if ( SDP::SUSE::xenDom0installed() ) { SDP::Core::updateStatus(STATUS_SUCCESS, "The server has Xen Dom0 installed, buy may or may not be running."); } else { SDP::Core::updateStatus(STATUS_ERROR, "ABORT: The server does not have Xen Dom0 installed"); }
Non
0 if Xen Dom0 is NOT installed
1 if Xen Dom0 is installed
None
Identifies an installed Xen Dom0 virtual machine server
if ( SDP::SUSE::xenDom0running() ) { SDP::Core::updateStatus(STATUS_SUCCESS, "The server has Xen Dom0 running."); } else { SDP::Core::updateStatus(STATUS_ERROR, "ABORT: The server does not have Xen Dom0 running."); }
Non
0 if Xen Dom0 is NOT running
1 if Xen Dom0 is running
None
Returns the year, month and day that the supportconfig was run on the server. It also returns the number of days from 1970 Jan 01 to the run date.
my (undef, $SC_YEAR, $SC_MONTH, $SC_DAY) = split(/\t/, SDP::SUSE::getSupportconfigRunDate()); SDP::Core::updateStatus(STATUS_PARTIAL, "Supportconfig run date: $SC_YEAR $SC_MONTH $SC_DAY");
None
$DAYS
$YEAR
$MONTH
$DAY
None
Returns an array of hashes regarding application core file images found on the server.
my @APP_CORE_INFO = (); my $ROLE;
push(@APP_CORE_INFO, { filename => "/core.5083", month => "Aug", day => "14", year => "2009", days => "1427717.81125", application => "httpd" } ); if ( SDP::SUSE::appCores(\@APP_CORE_INFO) ) { for ( my $I=0; $I<=$#APP_CORE_INFO; $I++) { print(" ARRAY $I = "); for $ROLE ( keys %{ $APP_CORE_INFO[$I] } ) { print("'$ROLE' => '$APP_CORE_INFO[$I]->{$ROLE}' "); } print("\n"); } } else { SDP::Core::updateStatus(STATUS_ERROR, "Application core files NOT found"); }
Address to an array
Modifies the array reference given
None
Jason Record <lt>jrecord@suse.com
Copyright (C) 2013 SUSE Linux Products GmbH
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.