line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Remote_Mgmt::TeamViewer; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
129844851
|
use strict; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
74
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
726
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
523
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
1
|
|
|
1
|
0
|
408
|
return canRun('teamviewer'); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub doInventory { |
13
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
16
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
if ($logger) { |
19
|
0
|
|
|
|
|
|
$logger->debug('FusionInventory::Agent::Task::Inventory::Remote_Mgmt::TeamViewer'); |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
my $command = "teamviewer --info"; |
22
|
0
|
|
|
|
|
|
my $teamViewerID = _getID(command => $command, logger => $logger); |
23
|
0
|
|
|
|
|
|
$logger->debug('ID : ' . $teamViewerID); |
24
|
0
|
|
|
|
|
|
my $remoteMgmt = { |
25
|
|
|
|
|
|
|
ID => $teamViewerID, |
26
|
|
|
|
|
|
|
TYPE => 'teamviewer' |
27
|
|
|
|
|
|
|
}; |
28
|
0
|
|
|
|
|
|
$inventory->addEntry( |
29
|
|
|
|
|
|
|
section => 'REMOTE_MGMT', entry => $remoteMgmt |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _getID { |
35
|
0
|
|
|
0
|
|
|
my (%params) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return getFirstMatch( |
38
|
|
|
|
|
|
|
pattern => qr/TeamViewer ID:(?:\033\[0m|\s)*(\d+)\s+/, |
39
|
|
|
|
|
|
|
%params |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |