Skip to content

Commit f79c0c4

Browse files
committed
feat: Update glpi-agent script to support --full-inventory-postpone option
Also add --full option support to disable full-inventory-postpone
1 parent 9ec2834 commit f79c0c4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Changes

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ inventory:
1616
size most of the time. The option can only be used with GLPI 10 and its JSON format.
1717
* Update inventory to be generated in a consistent order as required by new
1818
'full-inventory-postpone' option to detect changes
19+
* Update glpi-agent script with --full-inventory-postpone option support
20+
* Update glpi-agent script with --full option support to force a full inventory
1921

2022
netdiscovery/netinventory:
2123
* Keep device mac address found via snmp during netdiscovery as this is the one

bin/glpi-agent

+19
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ GetOptions(
3333
'debug+',
3434
'delaytime=s',
3535
'force|f',
36+
'full',
37+
'full-inventory-postpone=i',
3638
'help|h',
3739
'html',
3840
'json',
@@ -118,6 +120,11 @@ if ($options->{daemon}) {
118120
}
119121
}
120122

123+
if ($options->{full}) {
124+
# Disable full inventory postpone if requested
125+
$options->{'full-inventory-postpone'} = 0;
126+
}
127+
121128
die "given '$options->{vardir}' vardir folder doesn't exist\n"
122129
if $options->{vardir} && ! -d $options->{vardir};
123130

@@ -265,6 +272,8 @@ glpi-agent [options] [--server server|--local path]
265272
--partial=CATEGORY make a partial inventory of given category
266273
items, this option implies --json
267274
--credentials set credentials to support database inventory
275+
--full-inventory-postpone=NUM set number of possible full inventory postpone (14)
276+
--full force inventory task to generate a full inventory
268277
269278
RemoteInventory task specific options:
270279
--remote=REMOTE[,REMOTE]... specify a list of remotes to process in place
@@ -551,6 +560,16 @@ Setup credentials for database inventory
551560
CREDENTIALS should be a list of "key:value" separated by commas like in:
552561
For example: --credentials="type:login_password,login:root,password:********,use:postgresql,params_id:0"
553562
563+
=item B<--full-inventory-postpone>=I<NUM>
564+
565+
Set the number of time the agent can decide to generate a partial inventory with only
566+
changed category before generating a full inventory.
567+
568+
=item B<--full>
569+
570+
Force inventory task to generate a full inventory even if B<full-inventory-postpone> option
571+
is set. Indeed this is equivalent to set B<--full-inventory-postpone=0>.
572+
554573
=item B<--scan-homedirs>
555574
556575
Allow the agent to scan home directories for virtual machines.

0 commit comments

Comments
 (0)