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

- NAME
- SYNOPSIS
- EXAMPLES
- DESCRIPTION
- OCS INVENTORY PROTOCOL

- First, The PROLOG
- Module execution
- Server mode (Windows service or Unix daemon)

- OPTIONS

- Target definition options
- Target scheduling options
- Task selection options
- Inventory task specific options
- Package deployment task specific options
- Server target specific options
- Web interface options
- Logging options
- Configuration options
- Execution mode options

- CONFIGURATION

# NAME

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

# SYNOPSIS

fusioninventory-agent [options] [--server server|--local directory|--sdout]

      Target definition options
        -s --server=URI     send tasks result to a server
        -l --local=DIR      write tasks results in a directory
        --stdout            write tasks result on STDOUT

      Target scheduling options
        --delaytime=DURATION        maximum initial delay before first target, in seconds (3600)
        -w --wait=DURATION          maximum delay between each target, in seconds
        --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     allow to scan use home directories (false)
        --html              save the inventory as HTML (false)
        -f --force          always send data to server (false)
        -t --tag=TAG        mark the machine with given tag
        --backend-collect-timeout   timeout for inventory modules execution (30)
        --additional-content=FILE   additional inventory content

      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=PWD   password for server authentication
        --ca-cert-dir=D     path to the CA certificates directory
        --ca-cert-file=F    path to the CA certificates file
        --no-ssl-check      do not check server SSL certificates (false)
        --timeout           connection timeout (180)

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

      Logging options
        --logger=BACKEND            logger backend [Stderr|File|Syslog] (Stderr)
        --logfile=FILE              log file
        --logfile-maxsize=X         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 [file|registry|none]
        --conf-file=FILE            configuration file

      Execution mode options
        -d --daemon                 run the agent as a daemon (false)
        --no-fork                   don't fork in background (false)
        --debug                     debug mode (false)
        --version                   print the version and exit

# EXAMPLES

        % fusioninventory-agent --server localhost
        # execute all available tasks required by a local server

        % fusioninventory-agent --server http://localhost/ocsinventory2
        # execute all available tasks required by a local server, using a specific
        # URI

        % fusioninventory-agent --server https://localhost/ocsinventory
        # execute all available tasks required by a local server, using a secure
        # connection

        % fusioninventory-agent --server localhost --user test --password s3cr3t
        # execute all available tasks required by a local server, using HTTP
        # authentication

        % fusioninventory-agent --local /tmp
        # execute all available tasks and write the result in /tmp directory

        % fusioninventory-agent --local /tmp --html
        # execute all available tasks and write the result in /tmp directory in
        # HTML format

# DESCRIPTION

fusioninventory-agent is an agent for OCS Inventory server and FusionInventory for GLPI servers. It creates local inventory of the machines (hardware and software) and send it to the server. It can also write it in a local XML file. This agent is the successor of the former linux_agent which was released with OCS 1.01 and prior. It also replaces the Solaris/AIX/BSD unofficial agents.

Supported systems:

Windows (since Windows 2000)
GNU/Linux
MacOSX
Solaris
FreeBSD
NetBSD
OpenBSD
AIX
HP-UX
GNU/kFreeBSD

# OCS INVENTORY PROTOCOL

FusionInventory Agent uses OCS Inventory protocol and is compatible with OCS Inventory server. The agent uses the same protocol with the FusionInventory For GLPI plugin.

The OCS protocol is basicly an exchange of XML file done over HTTP(S).

## First, The PROLOG

The agent send a first message to give it's ID (DEVICEID). The server send back to the agent an XML file with a list of parameter. It's the PROLOG RESP. You can see it if you're in Debug mode. In this PROLOG, the server send the PROLOG_FREQ. The agent will use it to know when it need to contact the server for the next time.

The agent compute the next query date this way:

         PROLOG_FREQ/2+RANDOM(PROLOG_FREQ/2)

## Module execution

The agent will launch each modules and pass the list of options found in the PROLOG RESP as parameter. The module can send information directly to the server (inventory, SNMP scan result, etc)

## Server mode (Windows service or Unix daemon)

In server mode, the agent wait during a period between the last PROLOG and PROLOG_FREQ. If PROLOG_FREQ is not set, it will use --delaytime value. The default value is 3600.

# OPTIONS

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

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

## Target definition options

-s, --server=URI

  Send results of tasks execution to given server.

  If 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.

-l, --local=DIR

  Write the results of tasks execution to given directory.

--stdout

  Write the results of tasks execution on stdout.

## Target scheduling options

--delaytime=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).

-w LIMIT, --wait=LIMIT

  Set a delay between each targets, whose value is computed randomly between 0 and LIMIT seconds.

--lazy

  Do not contact the target before next scheduled time.

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

## Task selection options

--no-task=TASK

  Disable the given task

--list-tasks

  List available tasks and exit

## Inventory task specific options

--no-category=CATEGORY

  Do not list given category items in inventory.

--scan-homedirs

  Allow the agent to scan home directories for virtual machines.

--html

  Save the inventory as HTML.

  This is only used for local inventories.

-f, --force

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

--tag=TAG

  Mark the machine with given tag.

--backend-collect-timeout=TIME

  Timeout for inventory modules execution.

## Package deployment task specific options

--no-p2p

  Do not use peer to peer to download files.

## Server target specific options

-P, --proxy=PROXY

  Use PROXY as HTTP proxy.

  By default, the agent uses HTTP_PROXY environment variable.

-u USER, --user=USER

  Use USER for server authentication.

-p, --password=PASSWORD

  Use PASSWORD for server authentication.

--ca-cert-dir=PATH

  Path to the CA certificates directory.

--ca-cert-file=FILE

  Path to the CA certificates file.

--no-ssl-check

  Do not check server SSL certificates.

  Hint: you can set HTTPS_DEBUG environment variable to get SSL error messages in the console.

## Web interface options

--no-httpd

  Disable the embedded web server.

--httpd-ip=IP

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

--httpd-port=PORT

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

--httpd-trust=RANGE

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

  For example: "192.168.0.0/24", "192.68.168.0.5" or an IP range like "20.34.101.207 - 201.3.9.99". See the Net::IP manpage documentation to get more example.

## Logging options

--logger=BACKEND

  Logger backend to use. It can be:

    Stderr: log messages directly in the console.

    File: log messages in a file.

    Syslog: log messages through the local syslog server

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

--logfile=FILE

  Log message in FILE (implies File logger backend)

--logfile-maxsize=FILE

  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.

--logfacility=FACILITY

  Syslog facility to use (default LOG_USER)

--color

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

  This options is ignored on Windows.

## Configuration options

--conf-file=FILE

  Use FILE as configuration file (implies file configuration backend)

--config=BACKEND

  Configuration backend to use. It can be:

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

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

    none: don't read any configuration

## Execution mode options

-d, --daemon

  Run the agent as a daemon.

--no-fork

  Don't fork in background.

  This is only useful when running as a daemon.

--debug

  Turn the debug mode on.

--setup

  Print the agent setup directories and exit.

--version

  Print the version and exit.

# CONFIGURATION

The agent is able to use multiple configuration backends. The registry backend is the default on Windows platform, and the file backend is the default everywhere else. Another backend can be specified using the --config option.

The file backend reads configuration directives from a configuration file, whose default location is determined at installation time as PREFIX/etc/agent.cfg. An alternative location can also be given with --conf-file option.

The registry backend reads configuration directives from the Windows registry, with an arch-dependant location:

- HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent for 32 bits machines
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\FusionInventory-Agent for 64 bits machines

The none backend doesn't read any configuration directive at all, allowing to isolate the agent execution from any installed configuration.