Kernel::System::Environment - collect environment info
Functions to collect environment info
create environment object. Do not use it directly, instead use:
my $EnvironmentObject = $Kernel::OM->Get('Kernel::System::Environment');
collect operating system information
my %OSInfo = $EnvironmentObject->OSInfoGet();
returns:
%OSInfo = ( Distribution => "debian", Hostname => "servername.example.com", OS => "Linux", OSName => "debian 7.1", Path => "/home/otrs/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", POSIX => [ "Linux", "servername", "3.2.0-4-686-pae", "#1 SMP Debian 3.2.46-1", "i686", ], User => "otrs", );
Return the version of an installed perl module:
my $Version = $EnvironmentObject->ModuleVersionGet( Module => 'MIME::Parser', );
returns
$Version = '5.503';
or undef if the module is not installed.
collect perl information:
my %PerlInfo = $EnvironmentObject->PerlInfoGet();
you can also specify options:
my %PerlInfo = $EnvironmentObject->PerlInfoGet( BundledModules => 1, );
returns:
%PerlInfo = ( PerlVersion => "5.14.2", # if you specified 'BundledModules => 1' you'll also get this: Modules => { "Algorithm::Diff" => "1.30", "Apache::DBI" => 1.62, ...... }, );
collect database information
my %DBInfo = $EnvironmentObject->DBInfoGet();
returns
%DBInfo = ( Database => "otrsproduction", Host => "dbserver.example.com", User => "otrsuser", Type => "mysql", Version => "MySQL 5.5.31-0+wheezy1", )
collect OTRS information
my %OTRSInfo = $EnvironmentObject->OTRSInfoGet();
returns:
%OTRSInfo = ( Product => "OTRS", Version => "3.3.1", DefaultLanguage => "en", Home => "/opt/otrs", Host => "prod.otrs.com", SystemID => 70, );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.