This file is indexed.

/usr/bin/fusioninventory-agent is in fusioninventory-agent 1:2.3.10.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

use strict;
use warnings;
use lib "/usr/share/fusioninventory/lib";

use English qw(-no_match_vars);
use Getopt::Long;
use Pod::Usage;

use FusionInventory::Agent;

Getopt::Long::Configure( "no_ignorecase" );

my $options = {};

GetOptions(
    $options,
    'additional-content=s',
    'backend-collect-timeout=s',
    'ca-cert-dir=s',
    'ca-cert-file=s',
    'conf-file=s',
    'config=s',
    'color',
    'daemon|d',
    'no-fork',
    'debug+',
    'delaytime=s',
    'force|f',
    'help|h',
    'html',
    'lazy',
    'list-tasks',
    'setup',
    'local|l=s',
    'logger=s',
    'logfile=s',
    'logfile-maxsize=i',
    'no-category=s',
    'no-httpd',
    'no-ssl-check',
    'no-task=s',
    'no-p2p',
    'password|p=s',
    'proxy|P=s',
    'httpd-ip=s',
    'httpd-port=s',
    'httpd-trust=s',
    'scan-homedirs',
    'scan-profiles',
    'server|s=s',
    'tag|t=s',
    'timeout=i',
    'user|u=s',
    'version',
    'wait|w=s',
    # deprecated options
    'stdout',
) or pod2usage(-verbose => 0);

pod2usage(-verbose => 0, -exitstatus => 0) if $options->{help};

if ($options->{version}) {
    print $FusionInventory::Agent::VERSION_STRING . "\n";
    exit 0;
}

my %setup = (
    confdir => "/etc/fusioninventory",
    datadir => "/usr/share/fusioninventory",
    libdir  => "/usr/share/fusioninventory/lib",
    vardir  => "/var/lib/fusioninventory-agent",
);

if ($options->{setup}) {
    foreach my $key (keys %setup) {
        print "$key: $setup{$key}\n";
    }
    exit 0;
}

if ($options->{'conf-file'}) {
    if ($options->{config}) {
        if ($options->{config} ne 'file') {
            print STDERR
                "don't use --conf-file with $options->{config} backend";
            exit 1;
        }
    } else {
        $options->{config} = 'file';
    }
}

my $agent = FusionInventory::Agent->new(%setup);

if ($options->{'list-tasks'}) {
    my %tasks = $agent->getAvailableTasks();
    foreach my $task (keys %tasks) {
        print "$task (v$tasks{$task})\n";
    }
    exit 0;
}

if ($options->{wait}) {
    my $time = int rand($options->{wait});
    sleep $time;
}

eval {
    $agent->init(options => $options);
    $agent->run();
};

if ($EVAL_ERROR) {
    print STDERR "Execution failure:.\n";
    print STDERR $EVAL_ERROR;
    exit 1;
}

exit(0);

__END__

=head1 NAME

fusioninventory-agent - FusionInventory agent For Linux/UNIX, Windows and MacOSX

=head1 SYNOPSIS

B<fusioninventory-agent> [options] [--server server|--local path]

  Target definition options:
    -s --server=URI                send tasks result to a server
    -l --local=PATH                write tasks results locally

  Target scheduling options:
    --delaytime=LIMIT              maximum delay before first target,
                                     in seconds (3600)
    --lazy                         do not contact the target before
                                   next scheduled time

  Task selection options:
    --list-tasks                   list available tasks and exit
    --no-task=TASK                 do not run given task

  Inventory task specific options:
    --no-category=CATEGORY         do not list given category items
    --scan-homedirs                scan user home directories (false)
    --scan-profiles                scan user profiles (false)
    --html                         save the inventory as HTML (false)
    -f --force                     always send data to server (false)
    --backend-collect-timeout=TIME timeout for inventory modules
                                     execution (30)
    --additional-content=FILE      additional inventory content file

  Package deployment task specific options:
    --no-p2p                       do not use peer to peer to download
                                     files (false)

  Network options:
    -P --proxy=PROXY               proxy address
    -u --user=USER                 user name for server authentication
    -p --password=PASSWORD         password for server authentication
    --ca-cert-dir=DIRECTORY        CA certificates directory
    --ca-cert-file=FILE            CA certificates file
    --no-ssl-check                 do not check server SSL certificate
                                     (false)
    --timeout=TIME                 connection timeout, in seconds (180)

  Web interface options:
    --no-httpd                     disable embedded web server (false)
    --httpd-ip=IP                  network interface to listen to (all)
    --httpd-port=PORT              network port to listen to (62354)
    --httpd-trust=IP               trust requests without authentication
                                     token (false)

  Logging options:
    --logger=BACKEND               logger backend (stderr)
    --logfile=FILE                 log file
    --logfile-maxsize=SIZE         maximum size of the log file in MB (0)
    --logfacility=FACILITY         syslog facility (LOG_USER)
    --color                        use color in the console (false)

  Configuration options:
    --config=BACKEND               configuration backend
    --conf-file=FILE               configuration file

  Execution mode options:
    -w --wait=LIMIT                maximum delay before execution,
                                     in seconds
    -d --daemon                    run the agent as a daemon (false)
    --no-fork                      don't fork in background (false)
    -t --tag=TAG                   add given tag to inventory results
    --debug                        debug mode (false)
    --setup                        print the agent setup directories
                                     and exit
    --version                      print the version and exit

=head1 DESCRIPTION

The F<fusioninventory-agent> agent is a generic multi-platform agent. It can
perform a large array of management tasks, such as local inventory, software
deployment or network discovery. It can be used either standalone, or in
combination with a compatible server (OCS, GLPI, OTRS) acting as a centralized
control point.

=head1 OPTIONS

Most of the options are available in a I<short> form and a I<long> form.  For
example, the two lines below are all equivalent:

    % fusioninventory-agent -s localhost
    % fusioninventory-agent --server localhost

=head2 Target definition options

=over

=item B<-s>, B<--server>=I<URI>

Send the results of tasks execution to given server.

If I<URI> doesn't start with http:// or https://, the agent assume the
parameter is a hostname and rewrite it as:

    % --server=http://servername/ocsinventory

In general, OCS Inventory server URL have this format:

    http://servername/ocsinventory

and FusionInventory for GLPI this one:

    http://servername/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php

Multiple values can be specified, using comma as a separator.

=item B<-l>, B<--local>=I<PATH>

Write the results of tasks execution locally.

Exact behaviour according to given path:

=over

=item *

if I<PATH> is a directory, a file will be created therein

=item *

if I<PATH> is a file, it will be used directly

=item *

if I<PATH> is '-', STDOUT will be used

=back

Multiple values can be specified, using comma as a separator.

=back

=head2 Target scheduling options

=over

=item B<--delaytime>=I<LIMIT>

Set an initial delay before the first target, whose value is computed randomly
between LIMIT / 2 and LIMIT seconds. This setting is ignored for server targets
after the initial contact, in favor of server-specified parameter
(PROLOG_FREQ).

=item B<--lazy>

Do not contact the target before next scheduled time.

This option is only available when the agent is not run as a server.

=back

=head2 Task selection options

=over

=item B<--list-tasks>

List available tasks and exit

=item B<--no-task>=I<TASK>

Do not run given task.

Multiple values can be specified, using comma as a separator. See option
I<--list-tasks> for the list of available tasks.

=back

=head2 Inventory task specific options

=over

=item B<--no-category>=I<CATEGORY>

Do not list given category items in inventory.

Multiple values can be specified, using comma as a separator. The available
categories are:

=over 4

=item

printer

=item

software

=item

environment

=item

process

=item

user

=back

=item B<--scan-homedirs>

Allow the agent to scan home directories for virtual machines.

=item B<--scan-profiles>

Allow the agent to scan user profiles for softwares.

=item B<--html>

Save the inventory as HTML.

This is only used for local inventories.

=item B<-f>, B<--force>

Send an inventory to the server, even if this last one doesn't ask for it.

=item B<--backend-collect-timeout>=I<TIME>

Timeout for inventory modules execution.

=item B<--additional-content>=I<FILE>

Additional inventory content file.

This file should be an XML file, using same syntax as the one produced by the
agent.

=back

=head2 Package deployment task specific options

=over

=item B<--no-p2p>

Do not use peer to peer to download files.

=back

=head2 Server target specific options

=over

=item B<-P>, B<--proxy>=I<PROXY>

Use I<PROXY> as HTTP proxy.

By default, the agent uses HTTP_PROXY environment variable.

=item B<-u> I<USER>, B<--user>=I<USER>

Use I<USER> for server authentication.

=item B<-p>, B<--password>=I<PASSWORD>

Use I<PASSWORD> for server authentication.

=item B<--ca-cert-dir>=I<DIRECTORY>

CA certificates directory.

=item B<--ca-cert-file>=I<FILE>

CA certificates file.

=item B<--no-ssl-check>

Do not check server SSL certificate.

=item B<--timeout>=I<TIME>

Timeout for server connections.

=back

=head2 Web interface options

=over

=item B<--no-httpd>

Disable the embedded web server.

=item B<--httpd-ip>=I<IP>

The network interface to use for the embedded web server (all).

=item B<--httpd-port>=I<PORT>

The network port to use for the embedded web server (62354).

=item B<--httpd-trust>=I<IP>

Trust requests from given addresses without authentication token (false).

For example: "192.168.0.0/24", "192.168.168.0.5" or an IP range like
"20.34.101.207 - 201.3.9.99". Hostnames are also accepted. See L<Net::IP>
documentation to get more example.

Multiple values can be specified, using comma as a separator.

=back

=head2 Logging options

=over

=item B<--logger>=I<BACKEND>

Logger backend to use.

Multiple values can be specified, using comma as a separator. The available
backends are:

=over 4

=item

stderr: log messages directly in the console.

=item

file: log messages in a file.

=item

syslog: log messages through the local syslog server.

=back

Multiple values can be specified, using comma as a separator.

=item B<--logfile>=I<FILE>

Log message in I<FILE> (implies File logger backend).

=item B<--logfile-maxsize>=I<SIZE>

Max logfile size in MB, default is unlimited. When the max size is reached, the
file is truncated. This is only useful if there is no log rotation mechanism on
the system.

=item B<--logfacility>=I<FACILITY>

Syslog facility to use (default LOG_USER).

=item B<--color>

Display color on the terminal, when the Stderr backend is used.

This options is ignored on Windows.

=back

=head2 Configuration options

=over


=item B<--config>=I<BACKEND>

Configuration backend to use.

The available backends are:

=over 4

=item

file: read configuration from a file (default anywhere else as Windows).

=item

registry: read configuration from the registry (default on Windows).

=item

none: don't read any configuration.

=back

=item B<--conf-file>=I<FILE>

Use I<FILE> as configuration file (implies file configuration backend).

=back

=head2 Execution mode options

=over

=item B<-w> I<LIMIT>, B<--wait>=I<LIMIT>

Wait a random delay whose value is computed randomly between 0 and LIMIT
seconds, before execution. This is useful when execution is triggered from some
kind of system scheduling on multiple clients, to spread the server load.

=item B<-d>, B<--daemon>

Run the agent as a daemon.

=item B<--no-fork>

Don't fork in background.

This is only useful when running as a daemon.

=item B<--tag>=I<TAG>

Add the given tag to every inventory results.

=item B<--debug>

Turn the debug mode on. You can use the parameter up to 3 times in a row
to increase the verbosity (e.g: B<--debug --debug>).

Level 3 turns on the debug mode of some external libraries like Net::SSLeay.
These messages will only be be printed on STDERR.

=item B<--setup>

Print the agent setup directories and exit.

=item B<--version>

Print the version and exit.

=back