Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glpi-agent netscan feature with ToolBox enhancement #516

Merged
merged 178 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
e7885d5
refacto: Use Parallel::ForkManager for netdiscovery task
g-bougard Nov 14, 2022
cf3dc71
test: netdiscovery task test no more required thread support
g-bougard Nov 15, 2022
3ad894d
fix: Cleanups
g-bougard Nov 15, 2022
f346862
refacto: Move netdiscovery queue logic in related job class
g-bougard Nov 15, 2022
4c8ab1b
feat: run netinventory after netdiscovery if NETSCAN is passed as tas…
g-bougard Nov 15, 2022
e92caae
fix: Update NetDiscovery task support
g-bougard Nov 16, 2022
7946c21
refacto: Use Parallel::ForkManager for netinventory task
g-bougard Nov 16, 2022
dace369
feat: Bump netdiscovery & netinventory tasks version to 6.0
g-bougard Nov 16, 2022
8923cdf
refacto: Remove dead code and related tests
g-bougard Nov 16, 2022
7aae031
test: Update netinventory tests
g-bougard Nov 16, 2022
bb3a79f
refacto: Refacto & updates for glpi-netdiscovery and glpi-netinventor…
g-bougard Nov 18, 2022
1a0c700
refacto: Preload mibsupport as optimization
g-bougard Nov 18, 2022
e1f54c3
refacto: Updates for netscan support
g-bougard Nov 25, 2022
cfaf33f
refacto: refacto _call_win32_ole_dependent_api funct to be used for a…
g-bougard Dec 1, 2022
b97485c
fix: Update GLPI::Agent::XML class to make calls in a dedicated threa…
g-bougard Dec 1, 2022
3b82641
refacto: Avoid to load XML::LibXML in tests
g-bougard Dec 2, 2022
5de8ae1
test: Update baseconfig for remoteinventory task tests
g-bougard Dec 2, 2022
b8c2d40
refacto: cleanup GLPI::Agent::XML library
g-bougard Dec 2, 2022
bc30ebf
fix: Update GLPI::Agent::XML threading support on win32
g-bougard Dec 2, 2022
d260dbb
refacto: Refacto esx inventory to avoid error on win32
g-bougard Dec 2, 2022
ebfbe1c
fix: Fix test with MacOS Tools
g-bougard Dec 2, 2022
2ce2a68
test: Fix t/tasks/netinventory.t test
g-bougard Dec 2, 2022
226ad7c
fix: Also start dedicated worker thread on win32 from glpi-netdiscove…
g-bougard Dec 5, 2022
2bfaa8e
refacto: Catch storage error for Listener target
g-bougard Dec 16, 2022
87edda4
feat: Update Toolbox credentials listing
g-bougard Dec 16, 2022
4d80663
fix:Keep snmp version between credential edit & list forms
g-bougard Dec 27, 2022
90981a7
feat: Update credentials edit form to support remote types
g-bougard Dec 27, 2022
4509ee2
feat: Update remote inventory credentials support
g-bougard Dec 28, 2022
be90748
feat: Use a toggle to show/mask passwords
g-bougard Dec 28, 2022
f5dd708
feat: Updated translation files
g-bougard Dec 29, 2022
e09fdcb
feat: Add credentials tooltip on iprange list & edit form
g-bougard Dec 29, 2022
a707b34
fix: Fix adding new credential after adding one on iprange
g-bougard Dec 30, 2022
7a75fd2
fix: keep iprange selected when adding or removing credentials
g-bougard Dec 30, 2022
720f8c2
fix: Avoid possible wrong credential preselection on new iprange
g-bougard Dec 30, 2022
3d02ed7
fix: Don't try to output inventory on handle opening failure
g-bougard Dec 30, 2022
dd67077
feat: Set inventory as failed on write failure
g-bougard Dec 30, 2022
73c3b5d
fix: Fix slider overlapping on text
g-bougard Dec 30, 2022
47b879e
fix: Add missing module requirement
g-bougard Jan 2, 2023
6cdbe1c
fix: Fix IPC_EVENT messages mixing with many NetDiscovery workers
g-bougard Jan 3, 2023
3f76665
fix: Update NetDiscovery task logging to report worker termination
g-bougard Jan 3, 2023
ae84f25
feat: Support to abort local inventory from ToolBox
g-bougard Jan 3, 2023
d5abcac
fix: Fix ToolBox progress bar status when run is failed or aborted
g-bougard Jan 3, 2023
48ca838
fix: Support setting ip_range as result property to have it in results
g-bougard Jan 3, 2023
a467bef
fix: missed few important uri escaping
g-bougard Jan 3, 2023
e9b1964
fix: update inventory ToolBox page to support update NetDiscovery task
g-bougard Jan 3, 2023
85a262a
feat: Update credential form to support port, snmp protocol & remotei…
g-bougard Jan 3, 2023
c49bae6
feat: Credentials port, protocol & mode support update
g-bougard Jan 4, 2023
67e800e
feat: Update credentials form to prevent autofill
g-bougard Jan 4, 2023
adf3cf9
fix: Add snmp port & protocol set on credential in netdiscovery task
g-bougard Jan 4, 2023
13dc581
refacto: Rework of agent events support
g-bougard Jan 5, 2023
88d489e
refacto: Update glpi-inventory script to use GLPI::Agent::Event api
g-bougard Jan 5, 2023
8b02522
fix: Avoid deadlock when running netscan from toolbox on windows agent
g-bougard Jan 6, 2023
f396f83
build: Update rpm packaging
g-bougard Jan 9, 2023
44a10b1
fix: Support forbid_not_trusted option for all httpd server plugins
g-bougard Jan 16, 2023
34c1dd3
fix: Update ToolBox inventory page WIP
g-bougard Feb 3, 2023
08abbdf
fix: Update and fix ToolBox
g-bougard Mar 8, 2023
8b3d74a
feat: Add visibility toggle button on task
g-bougard Mar 13, 2023
cac8f5c
feat: Update ToolBox inventory tasks list
g-bougard Mar 14, 2023
6e7b426
feat: Update tasks support
g-bougard Mar 15, 2023
002dd15
fix: Fix ip_range reference in jobs when renaming it
g-bougard Mar 16, 2023
57b2750
feat: Show job configuration
g-bougard Mar 17, 2023
8a340c9
feat: Update inventory list sub-row style
g-bougard Mar 29, 2023
d837ae4
fix: Fix credentials list tooltips in ip range edit
g-bougard Mar 29, 2023
9aefd7c
feat: update toolbox inventory task edit support
g-bougard Mar 29, 2023
e100fee
feat: Update toolbox inventory tasks support
g-bougard Mar 30, 2023
d6b2b0a
test: satisty whitespace check
g-bougard Mar 30, 2023
b13d148
fix: Update ip range renaming support
g-bougard Apr 5, 2023
fdb1dcf
fix: Update and cleanup renaming support
g-bougard Apr 5, 2023
0792304
fix: Fix ip range renaming support
g-bougard Apr 5, 2023
bb8bd12
fix: Update credentials renaming support
g-bougard Apr 5, 2023
2a40da4
fix: More toolbox support update
g-bougard Apr 5, 2023
88c4d78
fix: Fix task edit 'Add iprange' function
g-bougard Apr 6, 2023
0fcc81c
feat: Support tag configuration for netscan as required for remoteinv…
g-bougard Apr 6, 2023
de915d0
feat: Display agent deviceid & agentid in footer
g-bougard Apr 6, 2023
b97d7a8
feat: Add target configuration support on tasks
g-bougard Apr 6, 2023
22f35e5
fix: cleanup no more used template
g-bougard Apr 6, 2023
07ef7ee
fix: Update inventory & iprange form support
g-bougard Apr 6, 2023
33dc460
fix: Don't delete used iprange
g-bougard Apr 11, 2023
32398be
fix: Don't delete used credentials
g-bougard Apr 12, 2023
c1a4292
fix: Satisfy authors test
g-bougard Apr 13, 2023
fc10384
fix: errors translation update
g-bougard Apr 13, 2023
c02b7fa
fix: Add by column inventory tasks ordering support
g-bougard Apr 13, 2023
b59eea0
feat: [wip] Add scheduling management support
g-bougard Apr 14, 2023
ad5d526
feat: [wip] Updated scheduling support
g-bougard Apr 17, 2023
ce55e10
feat: Update title on scheduling select options
g-bougard Apr 18, 2023
ce89132
feat: Update scheduling configuration support
g-bougard Jun 7, 2023
da0b455
fix: Fix log freezer slider
g-bougard Jun 8, 2023
34128c8
feat: Bump ToolBox plugin version
g-bougard Jun 22, 2023
3b51de6
doc: Updated Changes
g-bougard Jun 22, 2023
b075b57
feat: Add event-driven job running support
g-bougard Jun 23, 2023
1de3943
test: Make AUTHOR tests happy
g-bougard Jun 23, 2023
2929636
fix: Fix footer CSS
g-bougard Jul 3, 2023
4fa2701
fix: Update few translations on scheduling edit
g-bougard Jul 3, 2023
61f5d47
fix: Fix placeholder html attribut usage
g-bougard Jul 3, 2023
ef83f79
fix: Fix info translation
g-bougard Jul 3, 2023
9375889
fix: update minimal cell padding to 3px
g-bougard Jul 3, 2023
647f357
fix: Use less html br
g-bougard Jul 3, 2023
8efd216
fix: Remove redundant title
g-bougard Jul 3, 2023
e073b9b
fix: Rename 'Inventory' tab to 'Inventory tasks'
g-bougard Jul 3, 2023
a086a60
fix: Fix tables top alignment
g-bougard Jul 3, 2023
b2a2098
fix: Fix secondary action buttons
g-bougard Jul 3, 2023
36b439d
update: Update Toolbox tasks support
g-bougard Jul 12, 2023
785eed7
feat: Include tabler-icons v2.24.0
g-bougard Jul 12, 2023
81fa68e
feat: Replace config png by settings tabler-icon
g-bougard Jul 12, 2023
8efcf3d
feat: Use chevron tabler-icons for list navigation
g-bougard Jul 13, 2023
e8f7e62
fix: Add list navigation support on inventory page
g-bougard Jul 13, 2023
583bb12
fix: Remove feature to reveal passwords from credentials list
g-bougard Jul 13, 2023
7282f1f
fix: Use a dedicated eye switch on each password fields for credentia…
g-bougard Jul 13, 2023
c07b7de
fix: Fix credentials type change not permits to edit user & pass for …
g-bougard Jul 13, 2023
75978b7
fix: Support switching credentials type from remote one to snmp
g-bougard Jul 13, 2023
52a0686
fix: use number input type for credentials port
g-bougard Jul 13, 2023
05409ea
feat: Support direct renaming of tasks, credentials or ip ranges
g-bougard Jul 13, 2023
6b9a632
fix: Be sure to re-schedule task on update
g-bougard Jul 13, 2023
5b1ed4d
fix: Fix buttons on configuration page
g-bougard Jul 13, 2023
9fee89e
fix: Don't require anymore status on disabled task
g-bougard Jul 17, 2023
0e8115f
feat: Remove ToolBox flatpickr dependency
g-bougard Jul 17, 2023
9a42d4c
fix: use/update hints style
g-bougard Jul 17, 2023
f4630ac
fix: Remove none option from delay list on task creation
g-bougard Jul 17, 2023
cc2695e
fix: Better inventory task form alignments
g-bougard Jul 17, 2023
3f58126
fix: Update inventory task form
g-bougard Jul 17, 2023
d84a7bd
fix: Update ip range support UI
g-bougard Jul 18, 2023
a5fd42f
fix: Update credentials support UI
g-bougard Jul 18, 2023
8614042
fix: Support scheduling renaming on update
g-bougard Jul 19, 2023
bf173af
fix: Fix scheduling list paging
g-bougard Jul 19, 2023
b3a4c50
fix: fix scheduling description encoding in inventory task list tooltips
g-bougard Jul 19, 2023
b8be0d1
fix: Update scheduling management support
g-bougard Jul 19, 2023
c3a8d3d
fix: Fix inventory tasks page
g-bougard Jul 19, 2023
5627799
fix: Update task progress bar & report integration in tasks list
g-bougard Jul 20, 2023
b5497fb
fix: fix debug level select alignment
g-bougard Jul 20, 2023
09d986f
fix: Fix french word translation
g-bougard Jul 25, 2023
61685f6
fix: Fix footer CSS
g-bougard Jul 25, 2023
a58b3d3
fix: Update helper text style
g-bougard Jul 25, 2023
fa65740
fix: Fix scheduling form
g-bougard Jul 25, 2023
e99c9d6
fix: Fix indentation in css
g-bougard Jul 28, 2023
a2e948e
fix: Fix line spacing in tooltips
g-bougard Jul 28, 2023
c753729
fix: Fix iprange select size to keep ui consistent
g-bougard Jul 28, 2023
8f8ba77
fix: don't reset task & scheduling forms on update
g-bougard Jul 28, 2023
7cddf8c
feat: Add icon to inventory task form buttons
g-bougard Jul 28, 2023
aa42cc2
feat: Add icons to navbar entries
g-bougard Jul 31, 2023
1203501
fix: Update buttons design and fix css issues
g-bougard Jul 31, 2023
9211b4f
fix: Update remote buttons
g-bougard Jul 31, 2023
11887d6
fix: Update configuration buttons
g-bougard Jul 31, 2023
7d0214a
fix: Add icon to yaml edition button
g-bougard Aug 2, 2023
599f67b
fix: Update addnavlink support
g-bougard Aug 2, 2023
0b21918
fix: update ip_range form buttons
g-bougard Aug 2, 2023
0eb32ca
fix: update credentials form buttons
g-bougard Aug 2, 2023
f163340
fix: add formnovalidate attribut on remote cancel button
g-bougard Aug 2, 2023
79806d1
fix: update scheduling form buttons
g-bougard Aug 2, 2023
bdcfae2
fix: update mibsupport forms buttons
g-bougard Aug 3, 2023
f6f2838
fix: Update infos displaying on mibsupport panel
g-bougard Aug 3, 2023
e45be1f
feat: Support configured target for netscan job defined in ToolBox
g-bougard Aug 3, 2023
8f1e73c
fix: fix syntax error
g-bougard Aug 3, 2023
c109871
fix: Update support of netscans run from results page
g-bougard Aug 4, 2023
4c9c72b
test: Fix AUTHOR tests
g-bougard Aug 4, 2023
d539abd
fix: Prepare support for esx, ssh & winrm netscan
g-bougard Aug 11, 2023
ce9fee4
test: Satisfy AUTHOR tests
g-bougard Aug 11, 2023
37c2c8b
fix: Store discovered snmp credentials and ip_range in dedicated stor…
g-bougard Sep 20, 2023
a07e3b3
fix: Support credentials without type set as given by glpiinventory p…
g-bougard Sep 20, 2023
e9910b6
fix: Skip normal attribute like _cleanup_expiration
g-bougard Sep 20, 2023
acf7d20
feat: Update for remote netscan support
g-bougard Sep 20, 2023
64abf1b
feat: Add support for ESX netscan
g-bougard Sep 21, 2023
5f7d0de
feat: Add ESX support to netscan
g-bougard Sep 21, 2023
a229b58
test: Skip new apps esx unittests on win32
g-bougard Sep 22, 2023
27cce25
fix: Don't fail on not existing returnval
g-bougard Sep 26, 2023
443fe1f
test: remove duplicated unuseful requirement
g-bougard Oct 3, 2023
82c8e64
feat: Run esx inventory after esx discovery
g-bougard Oct 3, 2023
f6e1b4b
fix: Fix credential text field name in results
g-bougard Oct 3, 2023
b3493ab
fix: don't fail esx inventory because of a vm missing an uuid
g-bougard Oct 3, 2023
929863e
feat: Refacto NetDisco-Devices target storage
g-bougard Oct 4, 2023
3ac867f
fix: deduplicate inventory & related netdiscovery xml for netscan res…
g-bougard Oct 4, 2023
8a78b97
fix: Manage to reconciliate inventory results against netdiscovery XML
g-bougard Oct 5, 2023
b0e16d5
feat: Add remoteinventory scanning support
g-bougard Oct 5, 2023
8fc5778
fix: Fix 'Add IP range' test button when editing a new ip range
g-bougard Oct 6, 2023
9ce7e9f
fix: Add check on accessed device results
g-bougard Oct 6, 2023
75c2d64
fix: Don't try to find remotely not supported registry key informatio…
g-bougard Oct 6, 2023
6d783bf
feat: Add remoteinventory scan support in netscan
g-bougard Oct 6, 2023
ca00885
fix: Use timeout not only for snmp during netscan
g-bougard Oct 6, 2023
fc49240
doc: Updated Changes
g-bougard Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Revision history for GLPI agent
1.6 not yet released

core:
* Rework of agent events support
* Add support for tasks cache & tasks events
* Support forbid_not_trusted option for all httpd server plugins. The option is set to "no"
by default to keep compatibility with older configurations. If set to "yes", only trusted
ips will be authorized to access related httpd plugin features.
* fix #434: Fix XML encoding when sent by OCS client code, thanks to Nikolay Chizhov (@nchizhov)
* fix #438: Fix forking when required on win32 for Proxy & ToolBox plugins, and so
this fixes IPC support on win32
Expand All @@ -11,6 +16,7 @@ core:
* Update getCanonicalSize() to recognize kibibyte, mebibyte, gibibyte, tebibyte
pebibyte and exbibyte units
* Always report first found route in unix getRoutingTable() API
* fix: Update GLPI::Agent::XML class to make calls in a dedicated thread on win32

inventory:
* Fix inventory failure due to Oracle database inventory on win32
Expand Down Expand Up @@ -41,13 +47,32 @@ netdiscovery/netinventory:
* Enhanced Cisco devices support
* Enhanced Citrix devices support
* PR #500: Enhanced Synology NAS support with drives & storages support
* Use Parallel::ForkManager for netdiscovery & netinventory tasks
* Preload mibsupport as optimization
* Add ESX & RemoteInventory scanning support to netdiscovery

esx:
* Refactoring to share more code between task & glpi-esx script and to support netscan
* Added --debug option support to glpi-esx
* fixed & updated unittests

proxy-server-plugin:
* fix #461: Fix XML content-type support for inventories sent by android agent

injector:
* Support --ssl-cert-file option to permit SSL client authentication

toolbox:
* Feature: Inventory is now a list of local inventory or netscan task job
* Feature: Support task job scheduling management in a dedicated page
* Feature: Support ESX & RemoteInventory as credentials type
* Feature: Support ESX & RemoteInventory credentials in IP range
* Feature: Inventory netscan job can be started to discover and inventory ESX or
RemoteInventory computers
* fix #254: Add credential to iprange not working after adding first one
* Use tabler-icons v 2.24.0
* Store discovered snmp credentials and ip_range in dedicated storage in place of netdisco XML

packaging:
* Update MacOSX packages to use OpenSSL 3.1.3 & zlib 1.3
* Install basic-authentication-server-plugin.cfg plugin default configuration on debian
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,3 @@ contains code from imvirt:
* author: Thomas Liske <[email protected]>
* copyright: 2008 IBH IT-Service GmbH <http://www.ibh.de/>
* License: GPLv2+

ToolBox HTTP daemon plugin uses flatpickr lightweight and powerful datetime picker js library.
* author: Gregory Petrosyan
* url: <https://flatpickr.js.org/>
* copyright: 2017 Gregory Petrosyan
* License: License MIT
92 changes: 58 additions & 34 deletions bin/glpi-esx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ use English qw(-no_match_vars) ;
use Getopt::Long;
use Pod::Usage;
use UNIVERSAL::require;
use File::Temp;

use GLPI::Agent::Task::ESX;
use GLPI::Agent::Logger;
use GLPI::Agent::Config;
use GLPI::Agent::Target::Local;
use GLPI::Agent::Version;

my $options = {
Expand All @@ -28,6 +31,7 @@ GetOptions(
'path=s',
'stdout',
'tag=s',
'debug+',
'help',
'version',
'dump',
Expand All @@ -46,12 +50,25 @@ if ($options->{version}) {
exit 0;
}

my $config = GLPI::Agent::Config->new(
options => { map { $_ => $options->{$_} } qw{debug tag json} }
);

my $logger = GLPI::Agent::Logger->new(config => $config);

my $esx = GLPI::Agent::Task::ESX->new(
target => {},
logger => $logger,
config => $config,
target => GLPI::Agent::Target::Local->new(
logger => $logger,
path => $options->{path},
json => $config->{json},
basevardir => File::Temp->newdir(CLEANUP => 1),
),
);

inventory_from_dump($options->{dumpfile})
if ($options->{dumpfile});
if $options->{dumpfile};

$options->{path} = '-' if $options->{stdout};
$options->{path} = $options->{directory} unless $options->{path};
Expand All @@ -74,13 +91,15 @@ if (!$esx->connect(
die "Connection failure: ".$esx->lastError()."\n";
}

my $hasError = 0;
my $hostIds = $esx->getHostIds();
foreach my $hostId (@$hostIds) {
$esx->serverInventory($options->{path}, $options->{dump} ? \&dump_from_hostfullinfo : undef);

exit($esx->lastError ? 1 : 0);

my $file = write_inventory($hostId);
sub dump_from_hostfullinfo {
my ($hostId, $file) = @_
or return;

next unless ($options->{dump});
return unless $esx;

my $host = $esx->{vpbs}->getHostFullInfo($hostId);
my $dumper = Data::Dumper->new([$host],["host"]);
Expand All @@ -93,57 +112,56 @@ foreach my $hostId (@$hostIds) {
if (open my $handle, '>', $file) {
print $handle $dumper->Dump();
close $handle;
print("ESX Host full info dump saved in $file\n");
} else {
$hasError = 1;
print("Can't write to $file: $ERRNO\n");
}
}
exit($hasError);

sub write_inventory {
my ($hostId, $file) = @_;

my $inventory = $esx->createInventory($hostId, $options->{tag});
$inventory->setFormat($options->{json} ? "json" : "xml");

$file = $inventory->save($options->{path}) unless $file;
if ($file) {
print STDERR "Inventory ".($file eq '-' ? "dumped\n" : "saved in $file\n");
print "ESX Host full info dump saved in $file\n";
} else {
$hasError = 1;
print STDERR "Can't write to $file: $ERRNO\n";
$esx->lastError("Can't save host full info dump");
print STDERR "Can't write to $file: $ERRNO\n" ;
}

return $file;
}

sub inventory_from_dump {
my ($file) = @_;

my $format = $options->{json} ? 'json' : 'xml';

$file =~ s/\-hostfullinfo.dump$/.$format/;
$file =~ s/\-hostfullinfo.dump(.gz)?$/.$format/;

die "dumpfile must be a *-hostfullinfo.dump file\n"
die "dumpfile must be a *-hostfullinfo.dump or *-hostfullinfo.dump.gz file\n"
if $file eq $options->{dumpfile};

our $host ;

do $options->{dumpfile}
or die "Can't load $options->{dumpfile}: $!\n";
my $fh;

# Support gzip compressed hostfullinfo.dump
my $mode = $options->{dumpfile} =~ /\.gz$/ ? "-|" : "<";
my $expr = $options->{dumpfile} =~ /\.gz$/ ? "gunzip -c $options->{dumpfile}" : $options->{dumpfile};
open $fh, $mode, $expr
or die "Can't open $options->{dumpfile}: $!\n";
my $dump = join("", <$fh>);
close($fh);

{
## no critic (ProhibitStringyEval)
local ${^MAX_NESTED_EVAL_BEGIN_BLOCKS} = 0;
eval($dump)
or die "Can't load $options->{dumpfile}: $!\n";
}

die "Can't load host full infos from $options->{dumpfile}\n"
unless $host;

$esx->{vpbs} = GLPI::Agent::Task::ESX::Dump->new($host);

write_inventory(undef, $file);
$esx->serverInventory($options->{path} // $file);

exit 0;
}

package GLPI::Agent::Task::ESX::Dump;
package
GLPI::Agent::Task::ESX::Dump;

use parent qw(GLPI::Agent::SOAP::VMware::Host);

sub new {
my ($class, $fullinfo) = @_;
Expand All @@ -155,6 +173,11 @@ sub getHostFullInfo {
return $self->{_fullinfo};
}

sub getHostIds {
my ($self) = @_;
return [ $self->getHostname() ];
}

__END__

=head1 NAME
Expand All @@ -167,6 +190,7 @@ glpi-esx --host <host> --user <user> --password <password> --path <directory or

Options:
--help this menu
--debug debug mode (false)
--host hostname ESX server hostname
--user username user name
--password xxxx user password
Expand Down
5 changes: 3 additions & 2 deletions bin/glpi-inventory
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use GLPI::Agent::Task::Inventory;
use GLPI::Agent::Target::Local;
use GLPI::Agent::Logger;
use GLPI::Agent::Config;
use GLPI::Agent::Event;
use GLPI::Agent::Version;

my $options = {
Expand Down Expand Up @@ -54,12 +55,12 @@ pod2usage(-verbose => 0, -exitval => 0) if $options->{help};

my $event;
if ($options->{partial}) {
$event = {
$event = GLPI::Agent::Event->new(
task => "inventory",
partial => 1,
category => $options->{partial},
name => "partial inventory",
};
);
}

my $config = GLPI::Agent::Config->new(
Expand Down
Loading