Linux AppImage Installer
Linux AppImage installer is another way to install glpi-agent on linux. It has the advantage to work on any linux supporting AppImage format (most linux distros since years).
To install the agent, just run:
chmod +x glpi-agent-1.11-x86_64.AppImage
sudo ./glpi-agent-1.11-x86_64.AppImage --install --server <URL>
At this point, if you obtain an error explaining AppImages require FUSE to run.
,
you still can try a manual install.
Hint
On Ubuntu, starting with Ubuntu 22.04, fuse3 is installed, but AppImage requires libfuse2. So you should install it with:
sudo apt install libfuse2
Caution
As reported by MarcSamD, if you have a message telling libcrypt.so.1 is missing
,
you will need to install a compatibility package providing that library. On RPM based distro, you probably just need to install libxcrypt-compat
package.
To upgrade the agent if you still installed glpi-agent linux appimage, just run:
chmod +x glpi-agent-1.11-x86_64.AppImage
sudo ./glpi-agent-1.11-x86_64.AppImage --upgrade
By default, the agent is installed under /usr/local/bin
and dedicated configuration is created under /etc/glpi-agent/conf.d
.
To uninstall the agent, you simply can run:
sudo glpi-agent-uninstall
Or to also clean any data in /etc/glpi-agent
and /var/lib/glpi-agent
:
sudo glpi-agent-uninstall --clean
Installer parameters
Hint
You can retrieve all available parameters running:
./glpi-agent-1.11-x86_64.AppImage --help
--install
Install the agent by coping AppImage to install path, creating binding scripts for GLPI Agent commands. It copies default configurations and creates dedicated configuration to setup the agent with configuration parameters.
-i --installpath=PATH
Define
PATH
as installation folder. (By default:/usr/local/bin
)--upgrade
Try to just upgrade the currently installed agent, keeping configuration and trying to restart the agent.
--upgrade
Like upgrade but involves
--clean
option to make a clean install, resetting the configuration.--uninstall
Try to uninstall currently installed Glpi Agent AppImage.
--config=PATH
When installing, copy the given configuration file in
/etc/glpi-agent/conf.d
--clean
Clean everything when uninstalling or before installing.
--runnow
Run agent tasks after installation.
--service
Install GLPI Agent AppImage as a service. This option is selected by default.
--no-service
Don't install GLPI Agent as a service.
--cron=SCHED
Install agent as cron task (no by default).
SCHED
can only be set todaily
orhourly
.--wait=DELAY
(available since GLPI-Agent v1.10)delay the tasks run by
DELAY
seconds when installed with--cron
option.--version
Output the installer version and exit.
-S --silent
Make installer silent.
-h --help
Output help and exit.
--script=SCRIPT
Run embedded script in place of installer.
--perl
Run embedded perl.
Configuration parameters
All configuration options are documented in Configuration page and in the glpi-agent man page.
Target options
Most importantly, at least one target definition option is mandatory when installing GLPI Agent.
- -s --server=URI
send tasks result to a server
- -l --local=PATH
write tasks results locally in a file
Scheduling options
- --delaytime=LIMIT
maximum delay before running target tasks the first time
- --lazy
do not contact the target before next scheduled time
Task selection options
- --no-task=TASK[,TASK]...
do not run given task
- --tasks=TASK1[,TASK]...[,...]
run given tasks in given order
Inventory task specific options
- --no-category=CATEGORY
do not include given categories in inventory
- --scan-homedirs
scan user home directories
- --scan-profiles
scan user profiles
- --html
save inventory as HTML
- --json
save inventory as JSON
- --force
always send data to server
- --backend-collect-timeout=TIME
timeout for inventory modules execution
Remote inventory task specific options
- --remote=REMOTE
setup remote for which request remote inventory
Deploy task specific options
- --no-p2p
do not use peer to peer to download files
Network options
- --proxy=PROXY
proxy address
- --user=USER
user name for server authentication
- --password=PASSWORD
password for server authentication
- --ca-cert-dir=DIRECTORY
CA certificates directory
- --ca-cert-file=FILE
CA certificate file
- --ssl-cert-file=FILE
Client certificate file
- --ssl-fingerprint=FINGERPRINT
Fingerprint of SSL certificate to trust
- --no-ssl-check
do not check server SSL certificate
- -C --no-compression
do not compress communication with server
- --timeout=TIME
connection timeout
Web interface options
- --no-httpd
disable embedded web server
- --httpd-ip=IP
local network ip to listen on
- --httpd-port=PORT
network port to listen on
- --httpd-trust=IP
trust given IPs and IP ranges
- --listen
enable listener target if required
Logging options
- --logger=BACKEND
logger backend
- --logfile=FILE
log file
- --logfile-maxsize=SIZE
maximum size of the log file
- --logfacility=FACILITY
syslog facility
- --color
use color in the console
- --debug
enable debug mode
General options
- --conf-reload-interval=TIME
number of seconds between two configuration reloading
- -t --tag=TAG
add given tag to inventory results
- --vardir=PATH
use specified path as storage folder for agent persistent datas
Manual install
In the case, FUSE is not installed on the system and you can't or don't want to install it, you still can install GLPI Agent manually by following these steps:
Extract AppImage content:
./glpi-agent-1.11-x86_64.AppImage --appimage-extract
This will extract the content into a
squashfs-root
subfolder.Copy the squashfs-root folder to a dedicated place:
[ -d /opt ] || sudo mkdir /opt sudo rm -rf /opt/glpi-agent sudo cp -r squashfs-root /opt/glpi-agent
Run the
AppRun
from copied folder as installer:sudo /opt/glpi-agent/AppRun --install --server <URL>
To uninstall after a manual install, you need to run:
sudo /usr/local/bin/glpi-agent-uninstall sudo rm -rf /opt/glpi-agent
Portable installation
It is possible to use AppImage installer to create a portable linux glpi agent environment.
Creation
Here are the step to install such environment:
Download glpi-agent-portable.sh
Download a GLPI Agent AppImage
Copy script and AppImage to a dedicated folder, for example at the root of an USB key or a network shared folder
Make script and AppImage executable with:
sudo chmod +x glpi-agent-portable.sh glpi-agent*.AppImage
Run one time
glpi-agent-portable.sh
to setup the environment. This will create aetc/
and avar/
subfolder and all scripts at the same level. Don't removeglpi-agent-portable.sh
and AppImage.sudo ./glpi-agent-portable.sh
Create a
.cfg
file underetc/conf.g
to configure your agent or create dedicated script which start expected glpi-agent scripts with expected parameters.
You're now ready to use the linux portable agent.
Note
As installed scripts are using --vardir=PATH option, agent deviceid will be defined depending on the current computer hostname. So you can safely run it on different computers. The deviceid will even be reused later if you run it again on a given computer.
Hint
You can also specify AppImage to use by defining APPIMAGE
environment variable.
Upgrade
It is really simple to upgrade a portable installation:
Remove old AppImage from the folder
Download and copy the newer AppImage
Make AppImage executable
sudo chmod +x glpi-agent*.AppImage