inetprocess / libinventoryclient
This library provides various classes to get information about a SugarCRM Installation
Installs: 6 941
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 8
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.3
- guzzle/guzzle: ~3.9
- inetprocess/libsugarcrm: ^1.1-dev
- linfo/linfo: ^3.0
- psr/log: ~1
- ramsey/array_column: ^1.1
- symfony/finder: ~2
- symfony/process: ~2
Requires (Dev)
- phpunit/dbunit: ~1.3
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-05 19:09:55 UTC
README
PHP library to fetch information from the system and SugarCRM and send it to an inventory server (REST API)
Facter
Fetch informations about the system or a SugarCRM Instance and return a key, value PHP array.
Usage
System Facter
use Inet\Inventory\Facter\SystemFacter; $facter = new SystemFacter(); $facts = $facter->getFacts(); var_dump($facts);
array(20) {
'system_uptime' =>
array(4) {
'seconds' =>
int(2353764)
'hours' =>
double(653)
'days' =>
double(27)
'uptime' =>
string(40) "27 days, 5 hours, 49 minutes, 54 seconds"
}
'architecture' =>
string(6) "x86_64"
...
SugarCRM Facter
use Psr\Log\NullLogger; use Inet\SugarCRM\Application; use Inet\SugarCRM\Database\SugarPDO; use Inet\Inventory\Facter\SugarFacter; $app = new Application(new NullLogger(), 'path/to/sugarcrm'); $facter = new SugarFacter($app, new SugarPDO($app)); $facts = $facter->getFacts(); var_dump($facts);
array(17) {
'version' =>
string(7) "7.6.0.0"
'db_version' =>
string(7) "7.6.0.0"
'flavor' =>
string(3) "PRO"
'build' =>
string(4) "1552"
'build_timestamp' =>
string(18) "2015-06-05 03:29pm"
...
Combine facters
use Inet\Inventory\Facter\MultiFacterFacter; $facter = new MultiFacterFacter(array($system_facter)); $facter->addFacter($sugar_facter); $facts = $facter->getFacts();
Agent
Send information to a REST API. Three entities are used:
- Account : Client name.
- Server : Sugarcrm host and OS informations.
- SugarCRM instance: Installed SugarCRM instance. It is related to an account and a server.
The API is described in
src/InventoryService.json
.