i-doit console utility#
This document describes the usage of the i-doit console utility. The i-doit console utility allows for the automation of administrative tasks, data import, and the integration of i-doit into existing system landscapes.
Basics of the i-doit console utility#
The i-doit console utility commands are executed via the console.php
file located in the main directory of your i-doit installation.
Running the Console#
To run a command, you need to switch to the i-doit installation directory and execute the file with PHP. It is also possible to use the full path to the file, to run it from anywhere. It is important that the command is run with the permissions of the web server user (e.g., www-data
, wwwrun
or apache
) to avoid permission issues.
1 2 3 4 5 |
|
Authentication#
Almost every command requires authentication with i-doit. The following parameters are essential for this:
--user <USERNAME>
: The username of an i-doit user with the necessary permissions.--password <PASSWORD>
: The user's password.--tenantId <TENANT-ID>
: The ID of the tenant in which the command should be executed. The default ID is1
.
Security Note: Providing the password directly as a parameter can be a security risk, as it is visible in the process list and the shell history.
General (Global) Options#
These options can be combined with most commands:
Option | Alias | Description |
---|---|---|
--help | -h | Displays the help for a specific command. |
--quiet | -q | Suppresses all output except for error messages. |
--verbose | -v, -vv, -vvv | Increases the verbosity of the output (useful for debugging). |
--version | -V | Displays the version of the i-doit console. |
--no-interaction | -n | Disables interactive prompts (e.g., "Are you sure?"). |
Important Command Categories and Examples#
The i-doit console utility commands can be divided into logical groups.
Import and Synchronization#
These are the most frequently used commands for automating data maintenance.
import-csv#
Imports objects and their attributes from a CSV file. Requires an import profile pre-configured in the i-doit web interface.
- Syntax:
1
php console.php import-csv [AUTHENTICATION] --importFile <PATH_TO_CSV> --importProfileId <PROFILE_ID>
- Example:
1
sudo -u www-data php console.php import-csv --user=admin --password='secret' --tenantId=1 --importFile=/var/www/imports/idoit-Demo-CSV-Import.csv --importProfileId=1 --csvSeparator=";" --multiValueMode=column
ldap-sync#
Synchronizes users and groups from an LDAP directory (e.g., Microsoft Active Directory). The attribute mapping is configured via an INI file.
- Syntax:
1
php console.php ldap-sync [AUTHENTICATION] --config <PATH_TO_INI>
- Example: Tip: You can find an example configuration file here Configuration file
1
sudo -u www-data php console.php ldap-sync --user=admin --password='secret' --tenantId=1 --verbose
import-jdisc#
Imports data from the JDisc network discovery solution.
- Syntax:
1
php console.php import-jdisc [AUTHENTICATION] --server <JDISC_SERVER_ID>
- Example:
1
sudo -u www-data php console.php import-jdisc --user=admin --password='secret' --server=1 --tenantId=1
System Administration and Maintenance#
These commands assist in the maintenance and care of the i-doit instance.
search-index#
Rebuilds the search index. Necessary if the search in the web interface returns no or outdated results.
- Syntax:
1
php console.php search-index [AUTHENTICATION]
- Example:
1
sudo -u www-data php console.php search-index --user=admin --password='secret' --tenantId=1
system-categorycleanup#
Cleans up category data for objects that have been archived or deleted.
- Syntax:
1
php console.php system-categorycleanup [AUTHENTICATION] --categoryStatus <STATUSID>
- Example (cleans up archived objects):
1
sudo -u www-data php console.php system-categorycleanup --user=admin --password='secret' --categoryStatus=1 --tenantId=1 --no-interaction
Add-on and License Management#
Manages installed add-ons and licenses via the command line.
addon-list#
Lists all available add-ons and their status (enabled/disabled).
- Example:
1
sudo -u www-data php console.php addon-list --user=admin --password='secret'
addon-activate / addon-deactivate#
Activates or deactivates a specific add-on. The identifier is displayed by the addon-list command.
- Syntax:
1 2
php console.php addon-activate [AUTHENTICATION] --addon <ADDON_NAME> php console.php addon-deactivate [AUTHENTICATION] --addon <ADDON_NAME>
- Example:
1
sudo -u www-data php console.php addon-activate --user admin --password 'secret' --addon=document
license-key#
Adds a new license token to the i-doit installation.
- Syntax:
1
php console.php license-key [AUTHENTICATION] --key <LICENSETOKEN> --no-interaction
- Example:
1
sudo -u www-data php console.php license-key --user=admin --password='secret' --key=8z9hr12798g1ftg2p0o13ft3 --no-interaction
Automation#
Dedicated i-doit console utility User#
Set up a dedicated user in the i-doit web interface for automation tasks. Grant only the absolutely necessary permissions (e.g., import permissions) to this user instead of using the global admin
account.
Usage in Cronjobs#
The i-doit console utility commands are excellently suited for automation via cronjobs.
-
Example: Nightly CSV import and search index rebuild
Open the web server user's crontab with
sudo -u www-data crontab -e
and add the following lines:1 2 3 4 5
# Run the CSV import every day at 2:00 AM 0 2 * * * /usr/bin/php /var/www/html/console.php console.php import-csv --user=cli-user --password='secret' --tenantId=1 --importFile=/var/www/imports/idoit-Demo-CSV-Import.csv --importProfileId=1 --csvSeparator=";" --multiValueMode=column --quiet # Rebuild the search index every day at 2:30 AM 30 2 * * * /usr/bin/php /var/www/html/console.php search-index --user=cli-user --password='secret' --tenantId=1 --quiet
Finding a Command and its Options#
To list all available commands, run console.php
without any arguments:
1 |
|
To see the specific options and parameters for a single command, use the --help
or -h
option:
1 |
|
Available i-doit console utility commands without add-ons#
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 |
|