Skip to content

Commit e5fb02d

Browse files
committed
fix: Add support for SimpleHelp remote_management inventory
Closes #955
1 parent 9b9dac2 commit e5fb02d

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ inventory:
1818
* PR #1003: Add ESET Endpoint Antivirus for Linux support
1919
* PR #1010: Update vCpu support for Qemu virtualization
2020
* fix #957: Support Qemu virtualization inventory on windows
21+
* fix #955: Add support for SimpleHelp remote_management inventory
2122

2223
remoteinventory:
2324
* fix RedHat RHN systemid set as WINPRODID
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package GLPI::Agent::Task::Inventory::Generic::Remote_Mgmt::SimpleHelp;
2+
3+
use strict;
4+
use warnings;
5+
6+
use parent 'GLPI::Agent::Task::Inventory::Module';
7+
8+
use English qw(-no_match_vars);
9+
10+
use GLPI::Agent::Tools;
11+
12+
use constant sgalive_win32 => 'C:\ProgramData\JWrapper-Remote Access\JWAppsSharedConfig\sgalive';
13+
use constant sgalive_macos => '/Library/Application Support/JWrapper-Remote Access/JWAppsSharedConfig/sgalive';
14+
use constant sgalive_linux => '/opt/JWrapper-Remote Access/JWAppsSharedConfig/sgalive';
15+
16+
my $sgalive = OSNAME eq 'MSWin32' ? sgalive_win32 :
17+
OSNAME eq 'darwin' ? sgalive_macos : sgalive_linux;
18+
19+
sub isEnabled {
20+
return has_file($sgalive);
21+
}
22+
23+
sub doInventory {
24+
my (%params) = @_;
25+
26+
my $inventory = $params{inventory};
27+
my $logger = $params{logger};
28+
29+
my $SimpleHelpID = getFirstMatch(
30+
file => $sgalive,
31+
logger => $logger,
32+
pattern => qr/^ID=SG(?:_SG)?_(-?\d+)$/
33+
);
34+
35+
if (defined($SimpleHelpID)) {
36+
$SimpleHelpID = "SG_".$SimpleHelpID;
37+
$logger->debug('Found SimpleHelp ID : ' . $SimpleHelpID) if $logger;
38+
39+
$inventory->addEntry(
40+
section => 'REMOTE_MGMT',
41+
entry => {
42+
ID => $SimpleHelpID,
43+
TYPE => 'simplehelp'
44+
}
45+
);
46+
} else {
47+
$logger->debug('SimpleHelp ID not found in '.$sgalive) if $logger;
48+
}
49+
}
50+
51+
1;

0 commit comments

Comments
 (0)