OCSINVE...Y-AGENT(1p)

✨ OCSINVE...Y-AGENT ✨ (section 1p, from the User Contributed Perl Documentation, bestie πŸ’…)

okay so welcome to the manual page for ocsinventory-agent, and yes it's in section 1p because it's a Perl thing and we're all just living in its world now 🫢


🌸 NAME 🌸

ocsinventory-agent β€” the Unified client for OCS-Inventory. one client to rule them all, fr fr πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

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

that's it, that's the whole vibe check. short, iconic, does numbers πŸ’…


πŸ¦‹ EXAMPLES πŸ¦‹

here's where it gets fun, bestie. look at what this baby can do:

% 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]

not me being obsessed with the --lazy one 😭 it's literally me but for servers.


πŸ’– DESCRIPTION πŸ’–

so like. ocsinventory-agent creates inventory and send or write them. that's the whole job, and it does it slayfully ✨

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. the way this thing ate and left no crumbs for the old agents πŸ’€

the detailed list of supported Operating System is available in the Wiki. and the roster is:

  • GNU/Linux
  • Solaris
  • FreeBSD
  • NetBSD
  • OpenBSD
  • AIX
  • MacOSX
  • GNU/kFreeBSD

main character energy across every single one of these platforms, no cap 🌈


πŸ‘‘ 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

now let's go down the list, one by one, no skipping, because every single one of these matters 🫑

  • --backend-collect-timeout=SECONDS_BEFORE_KILL β€” time before OCS kills modules processing which don't end before the timeout. it's giving "we're not waiting around" β³πŸ’€
  • --basevardir=DIR β€” indicate the place where the agent should store its files. your files, your home, your rules 🏠
  • -d, --daemon β€” launch ocsinventory-agent in background. Proc::Daemon is needed, so don't come crying if it's not installed 😀
  • --debug β€” turn the debug mode on. maximum yapping, and we love that πŸ”
  • --devlib β€” this option is designed for backend module developer. with it enabled, ocsinventory-agent won't try to load the Backend module installed on the system. instead it will scan the ./lib directory. devs only, this one's for you πŸ§‘β€πŸ’»
  • --delaytime=SECONDS_TO_WAIT β€” this option defaults to waiting a random() time between 0 and 3600 before initially contacting the server, assuming NO PROLOG_FREQ has been set. once PROLOG_FREQ 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). polite queen behavior, honestly πŸŽ€
  • -f, --force β€” the agent will first contact the server during the PROLOG period. if the server doesn't know the machine or has outdated information, it will ask for an inventory. with this option, the agent doesn't run the PROLOG with the server first but directly sends an inventory. no small talk, straight to business πŸ’…
  • -i, --info β€” turn the verbose mode on. the flag is ignored if --debug is enable. noted πŸ“
  • --lazy β€” do not contact the server more than one time during the PROLOG_FREQ 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. protecting the server's peace 😌✨
  • -l, --local=DIR β€” write an inventory in the DIR directory. a new file will be created if needed. local filesystem said "I got you" πŸ“
  • --logfile=FILE β€” log message in FILE and turn off STDERR. quiet mode activated 🀫
  • -p, --password=PASSWORD β€” use PASSWORD for an HTTP identification with the server. secrets stay secret πŸ—οΈ
  • -P, --proxy=PROXY β€” use PROXY to specify a proxy HTTP server. by default, the agent uses HTTP_PROXY environment variable. it's giving middleman 🧍
  • -r, --realm=REALM β€” use REALM for an HTTP identification with the server. for example, the value can be 'Restricted Area'. you can find it in the login popup of your Internet browser. yep, the popup, that one πŸͺŸ
  • -s, --server=URI β€” the uri of the server. if URI 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. read that again bestie, --local wins this fight πŸ₯Š

  • --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 OCS to scan home directories to increase the Virtual Machine inventory.
⚠️ WARNING: beware with user privacy by using this option because it may encounter private data scans (even if it's not designed for !). okay so this one is lowkey invasive, be careful and be kind about people's stuff πŸ™ˆπŸ”’
  • --ssl=0|1 β€” check SSL communications using a certificate. set to 0 if you want to disable certificate check or 1 to enable (needs CA certificates file path in this case). default is set to 1. safety first, periodt πŸ”
  • --ca=FILE β€” path to CA certificates file in PEM format, for server SSL certificate validation. set to <your server configuration directory>/cacert.pem by default. it's giving trust issues, but the healthy kind 🌱
  • --tag=TAG β€” mark the machine with the TAG 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. the server said "I'll handle it from here" πŸ’
  • -u USER, --user=USER β€” use USER for the server authentication. identity unlocked πŸͺͺ
  • --version=USER β€” print the version and exit. yes it takes =USER, no I don't make the rules 🀷
  • -w DURATION, --wait=DURATION β€” wait before initializing the connexion with the server. if DURATION equal server the agent will use the PROLOG_FREQ 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. use the long one, bestie, the short one is on its way out 🫢
  • --nolocal β€” deactivate local mode even if it is set in config file or command line. override the override, iconic 🎭

πŸ“ 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

three chances to be found, it's giving "I'll meet you wherever you are" πŸ˜­πŸ’–


πŸ’œ AUTHORS πŸ’œ

the maintainer is Guillaume PROTET <guillaume.protet@mortheres.info> β€” shoutout to the icon keeping this whole thing alive πŸ‘‘

please read the AUTHORS, Changes and THANKS files to see who is behind OCS Inventory Agent. it takes a village, and they're all in there 🫢


🌈 SEE ALSO 🌈

go click, go read, go be informed πŸ’…βœ¨


🧚 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. contributing is hot and I said what I said πŸ”₯


Copyright (C) 2006-2016 OCS 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

okay and that's the whole page bestie πŸŽ€ this was made with perl v5.40.1, dated 2025-06-07, in the section 1p of the User Contributed Perl Documentation β€” go forth and inventory everything, you've got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from