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:
bash
chmod +x glpi-agent--x86_64.AppImage sudo ./glpi-agent--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 <manual-install>
.
Hint
On Ubuntu, starting with Ubuntu 22.04, fuse3 is installed, but AppImage requires libfuse2. So you should install it with:
bash
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:
bash
chmod +x glpi-agent--x86_64.AppImage sudo ./glpi-agent--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:
bash
sudo glpi-agent-uninstall
Or to also clean any data in /etc/glpi-agent
and /var/lib/glpi-agent
:
bash
sudo glpi-agent-uninstall --clean
Hint
You can retrieve all available parameters running:
bash
./glpi-agent--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
.--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.
All configuration options are documented in ../configuration
page and in the ../man/glpi-agent
man page.
Most importantly, at least one target definition option is mandatory when installing GLPI Agent.
-s --server=URI <server>
send tasks result to a server
-l --local=PATH <local>
write tasks results locally in a file
--delaytime=LIMIT <delaytime>
maximum delay before running target tasks the first time
--lazy <lazy>
do not contact the target before next scheduled time
--no-task=TASK[,TASK]... <no-task>
do not run given task
--tasks=TASK1[,TASK]...[,...] <tasks>
run given tasks in given order
--no-category=CATEGORY <no-category>
do not include given categories in inventory
--scan-homedirs <scan-homedirs>
scan user home directories
--scan-profiles <scan-profiles>
scan user profiles
--html <html>
save inventory as HTML
--json <json>
save inventory as JSON
--force <force>
always send data to server
--backend-collect-timeout=TIME <backend-collect-timeout>
timeout for inventory modules execution
--remote=REMOTE <remote>
setup remote for which request remote inventory
--no-p2p <no-p2p>
do not use peer to peer to download files
--proxy=PROXY <proxy>
proxy address
--user=USER <user>
user name for server authentication
--password=PASSWORD <password>
password for server authentication
--ca-cert-dir=DIRECTORY <ca-cert-dir>
CA certificates directory
--ca-cert-file=FILE <ca-cert-file>
CA certificate file
--ssl-cert-file=FILE <ssl-cert-file>
Client certificate file
--ssl-fingerprint=FINGERPRINT <ssl-fingerprint>
Fingerprint of SSL certificate to trust
--no-ssl-check <no-ssl-check>
do not check server SSL certificate
-C --no-compression <no-compression>
do not compress communication with server
--timeout=TIME <timeout>
connection timeout
--no-httpd <no-httpd>
disable embedded web server
--httpd-ip=IP <httpd-ip>
local network ip to listen on
--httpd-port=PORT <httpd-port>
network port to listen on
--httpd-trust=IP <httpd-trust>
trust given IPs and IP ranges
--listen <listen>
enable listener target if required
--logger=BACKEND <logger>
logger backend
--logfile=FILE <logfile>
log file
--logfile-maxsize=SIZE <logfile-maxsize>
maximum size of the log file
--logfacility=FACILITY <logfacility>
syslog facility
--color <color>
use color in the console
--debug <debug>
enable debug mode
--conf-reload-interval=TIME <conf-reload-interval>
number of seconds between two configuration reloading
-t --tag=TAG <tag>
add given tag to inventory results
--vardir=PATH <vardir>
use specified path as storage folder for agent persistent datas
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:
bash
./glpi-agent--x86_64.AppImage --appimage-extract
This will extract the content into a
squashfs-root
subfolder.Copy the squashfs-root folder to a dedicated place:
bash
[ -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:bash
sudo /opt/glpi-agent/AppRun --install --server <URL>
To uninstall after a manual install, you need to run:
bash
sudo /usr/local/bin/glpi-agent-uninstall sudo rm -rf /opt/glpi-agent
It is possible to use AppImage installer to create a portable linux glpi agent environment.
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:
bash
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.bash
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 <vardir>
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.
It is really simple to upgrade a portable installation:
- Remove old AppImage from the folder
- Download and copy the newer AppImage
Make AppImage executable
bash
sudo chmod +x glpi-agent*.AppImage