For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Configuration

Configure how the agent runs, connects to the server, and handles deployment.

The agent uses a local configuration file in both local and remote modes.

Configuration details

Below is an example of the config.json content and a table explaining each option:

{
  "url": "https://server_ip:port",
  "username": "username",
  "password": "password",
  "mode": 1,
  "data_directory": "/var/lib/ocsinventory-data",
  "log_level": 3,
  "log_file": true,
  "log_file_path": "/var/log/ocsinventory-agent/ocsinventory-agent.log",
  "certificate": "/path/to/cert.pem",
  "bypass_certificate": false
}
Field
Type
Required
Description

url

string

Online modes only

OCS server API base URL. Example: http(s)://server_ip:port.

username

string

Online modes only

API username used for authentication.

password

string

Online modes only

API password used for authentication.

mode

int

Yes

Execution mode (see list below).

data_directory

string

Yes

Base directory for inventory files and deployment cache. Inventory JSON is written to this path.

log_level

int

No

Log verbosity: 0 Critical, 1 Error, 2 Warning, 3 Info, 4 Debug.

log_file

bool

No

Write logs to a file (true) or only to stdout (false).

log_file_path

string

No

Full path to the log file. Used only when log_file is true.

certificate

string

No

Path to a PEM certificate file.

bypass_certificate

bool

No

If true, TLS certificate validation is disabled.

Execution modes

Execution mode controls two things: where inventory goes (server (remote) vs disk (local)) and whether templates are used.

Mode values

  • 1 → Remote with template

  • 2 → Remote without template

  • 3 → Local with template

  • 4 → Local without template

Remote modes (1/2) require server access.

Local modes (3/4) are for offline workflows.

TLS / SSL configuration

  • HTTPS with a cert trusted by the OS: no extra config needed. Leave bypass_certificate: false.

  • HTTPS with a self‑signed or private CA:

    • Preferred: install the CA in the OS trust store and keep bypass_certificate: false.

    • Fallback: set bypass_certificate: true (accepts any cert; use only if you understand the risk).

Last updated