SYNOPSIS

ocsinventory-agent-fhilpruw ] [ --server server | --local /tmp ]...

EXAMPLES

    % ocsinventory-agent --server localhost
    # send an inventory to the OCS server

    % ocsinventory-agent --server http://localhost/ocsinventory2
    # send an inventory over http to a server with a non standard
    # virtual directory

    % ocsinventory-agent --server https://localhost/ocsinventory
    # send an inventory over https to the OCS server

    % ocsinventory-agent --local /tmp
    # write an inventory in the /tmp directory

    % ocsinventory-agent --server localhost --user=toto --password=pw --realm="Restricted Area"
    # send a report to a server protected by a basic authentication
    % ocsinventory-agent --lazy
    # send an inventory only if the a random delay between 0 and PROLOG_FREQ had been run over.

    % ocsinventory-agent --delaytime 60 -d
    # If NO PROLOG_FREQ has been preset, pick a time between execution and --delaytime for the agent to contact the server [default is 3600 seconds]

DESCRIPTION

ocsinventory-agent creates inventory and send or write them. This agent is the successor of the former linux_agent which was released with \s-1OCS\s0 1.01 and prior. It also replaces the Solaris/AIX/BSD unofficial agents. The detailed list of supported Operating System is available in the Wiki.

GNU/Linux
Solaris
FreeBSD
NetBSD
OpenBSD
\s-1AIX\s0
MacOSX
GNU/kFreeBSD

OPTIONS

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

% ocsinventory-agent -s localhost % ocsinventory-agent --server localhost

--backend-collect-timeout=SECONDS_BEFORE_KILL

Time before \s-1OCS\s0 kills modules processing which don't end before the timeout.

--basevardir=\s-1DIR\s0

Indicate the place where the agent should store its files.

-d, --daemon

Launch ocsinventory-agent in background. Proc::Daemon is needed.

--debug

Turn the debug mode on.

--devlib

This option is designed for backend module developer. With it enabled, ocsinventry-agent won't try to load the Backend module installed on the system. Instead it will scan the ./lib directory.

--delaytime=SECONDS_TO_WAIT

This option defaults to waiting a random() time between 0 and 3600 before initially contacting the server assuming \s-1NO\s0 \s-1PROLOG_FREQ\s0 has been set. Once \s-1PROLOG_FREQ\s0 has been set, it uses that number at the top end of it's random setting. Useful for pre-setting a deployed agent's initial start time (so you don't jam the server all at once, but don't have to wait an hour to make sure the deployment worked).

-f, --force

The agent will first contact the server during the \s-1PROLOG\s0 period. If the server doesn't know the machine or has outdated informations, it will ask for an inventory. With this option, the agent doesn't run the \s-1PROLOG\s0 with the server first but directly sends an inventory.

-i, --info

Turn the verbose mode on. The flag is ignored if --debug is enable.

--lazy

Do not contact the server more than one time during the \s-1PROLOG_FREQ\s0 and do an exit if there is nothing to do. Useful if you want to start the agent script regulary from the crontab but don't want to overload the server.

-l, --local=\s-1DIR\s0

Write an inventory in the \s-1DIR\s0 directory. A new file will be created if needed.

--logfile=\s-1FILE\s0

Log message in \s-1FILE\s0 and turn off \s-1STDERR\s0

-p, --password=\s-1PASSWORD\s0

Use \s-1PASSWORD\s0 for an \s-1HTTP\s0 identification with the server.

-P, --proxy=\s-1PROXY\s0

Use \s-1PROXY\s0 to specify a proxy \s-1HTTP\s0 server. By default, the agent uses \s-1HTTP_PROXY\s0 environment variable.

-r, --realm=\s-1REALM\s0

Use \s-1REALM\s0 for an \s-1HTTP\s0 identification with the server. For example, the value can be 'Restricted Area'. You can find it in the login popup of your Internet browser.

-s, --server=\s-1URI\s0

The uri of the server. If \s-1URI\s0 doesn't start with http:// or https://, the assume the parameter is a hostname and rewrite it like that: % http://servername/ocsinventory If you want to use https or another virtual directory you need to enter the full path. --server is ignored if --local is in use.

--stdout

Print the inventory on stdout. % ocsinventory-agent --stdout > /tmp/report.xml # prepare an inventory and write it in the /tmp/report.xml file. # A file will be created.

--scan-homedirs

Authorized \s-1OCS\s0 to scan home directories to increase the Virtual Machine inventory. \s-1WARNING:\s0 beware with user privacy by using this option because it may encounter private data scans (even if it's not designed for !).

--tag=\s-1TAG\s0

Mark the machine with the \s-1TAG\s0 tag. Once the initial inventory is accepted by the server this value is ignored and you've to change the information directly on the server. The server do so in order to centralize the administration of the machine.

-u \s-1USER\s0, --user=\s-1USER\s0

Use \s-1USER\s0 for the server authentication.

--version=\s-1USER\s0

Print the version and exit.

-w \s-1DURATION\s0, --wait=\s-1DURATION\s0

Wait before initializing the connexion with the server. If \s-1DURATION\s0 equal server the agent will use the \s-1PROLOG_FREQ\s0 of the server to determine the duration of this periode. Exactly like it would had done if it was in --daemon mode. Else if duration is a numerical value, it will be used directly. % ocsinventory-agent --wait 5 --server localhost

--nosoftware

Do not inventory the software installed on the machine. --nosoft also works but is deperecated.

--nolocal

Desactivate local mode even if it is set in config file or command line

CONFIG FILE

The agent try to initialize the settings from the ocsinventory-agent.cfg config file.

It looks for the file in these directories:

/etc/ocsinventory
/usr/local/etc/ocsinventory
/etc/ocsinventory-agent

AUTHORS

The maintainer is Guillaume \s-1PROTET\s0 <[email protected]>

Please read the \s-1AUTHORS\s0, Changes and \s-1THANKS\s0 files to see who is behind \s-1OCS\s0 Inventory Agent.

RELATED TO ocsinventory-agent…

OCS-Inventory website,

http://www.ocsinventory-ng.org/

LaunchPad project page,

http://launchpad.net/ocsinventory-unix-agent

forum,

http://forums.ocsinventory-ng.org/

and wiki

http://wiki.ocsinventory-ng.org/

BUGS

Please, use the forum as much as possible. You can open your own bug tickets. Patches are welcome. You can also use LaunchPad bugtracker or push your Bazaar branch on LaunchPad and do a merge request.

COPYRIGHT

Copyright (C) 2006-2011 \s-1OCS\s0 Inventory contributors

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA