
###########
Environment
###########


****
NAME
****


Kernel::System::Environment - collect environment info


***********
DESCRIPTION
***********


Functions to collect environment info


****************
PUBLIC INTERFACE
****************


new()
=====


create environment object. Do not use it directly, instead use:


.. code-block:: perl

     my $EnvironmentObject = $Kernel::OM->Get('Kernel::System::Environment');



OSInfoGet()
===========


collect operating system information


.. code-block:: perl

     my %OSInfo = $EnvironmentObject->OSInfoGet();


returns:


.. code-block:: perl

     %OSInfo = (
         Distribution => "debian",
         Hostname     => "servername.example.com",
         OS           => "Linux",
         OSName       => "debian 7.1",
         Path         => "/home/znuny/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         => "znuny",
     );



ModuleVersionGet()
==================


Return the version of an installed perl module:


.. code-block:: perl

     my $Version = $EnvironmentObject->ModuleVersionGet(
         Module => 'MIME::Parser',
     );


returns


.. code-block:: perl

     $Version = '5.503';


or undef if the module is not installed.


PerlInfoGet()
=============


collect perl information:


.. code-block:: perl

     my %PerlInfo = $EnvironmentObject->PerlInfoGet();


you can also specify options:


.. code-block:: perl

     my %PerlInfo = $EnvironmentObject->PerlInfoGet(
         BundledModules => 1,
     );


returns:


.. code-block:: perl

     %PerlInfo = (
         PerlVersion   => "5.14.2",
 
     # if you specified 'BundledModules => 1' you'll also get this:
 
         Modules => {
             "Algorithm::Diff"  => "1.30",
             "Apache::DBI"      => 1.62,
             # ...
         },
     );



DBInfoGet()
===========


collect database information


.. code-block:: perl

     my %DBInfo = $EnvironmentObject->DBInfoGet();


returns


.. code-block:: perl

     %DBInfo = (
         Database => "otrsproduction",
         Host     => "dbserver.example.com",
         User     => "otrsuser",
         Type     => "mysql",
         Version  => "MySQL 5.5.31-0+wheezy1",
     )



OTRSInfoGet()
=============


collect OTRS information


.. code-block:: perl

     my %OTRSInfo = $EnvironmentObject->OTRSInfoGet();


returns:


.. code-block:: perl

     %OTRSInfo = (
         Product         => "OTRS",
         Version         => "3.3.1",
         DefaultLanguage => "en",
         Home            => "/opt/znuny",
         Host            => "prod.otrs.com",
         SystemID        => 70,
     );





