В этой статье мы рассмотрим пошаговую установку и настройку GLPI. GLPI (Gestionnaire Libre de Parc Informatique — франц.) – это полноценная open-source ITSM система для управления процессами, инвентаризации оборудования и софта, а также для управления заявками и инцидентами. GLPI это большой комбайн, в котором заложено большое количество функционала по управлению ИТ на предприятии. Некоторые из возможностей GLPI:
- Инвентаризация компьютеров, серверов, оргтехники (принтеры, мониторы, МФУ, картриджи и прочее)
- Инвентаризация установленных на компьютерах программ и лицензий
- Управление заявками и инцидентами (регистрация обращений пользоватетелей, HelpDesk)
- База знаний
- Ведение проектов
- Управление бюджетом
Содержание:
- Установка и настройка стека LAMP в Linux
- Установка GLPI
- Базовая настройка GLPI
- Обзор интерфейса GLPI
- Плагин FusionInventory — автоматическая инвентаризация серверов и компьютеров
- Статистика и отчеты в GLPI
Установка и настройка стека LAMP в Linux
GLPI это обычное веб приложение с базой данных, поэтому на сервере нужно развернуть LAMP стек (в данной статье GLPI будет установлен на apache, но возможна также установка на nginx).
Совет. В этом примере мы покажем, как установить GLPI на Ubuntu. Однако инструкция полностью подходит для развертывания GLPI на любом другом дистрибутиве Linux. Например, для CentOS используйте пакетный менеджер yum, вместо apt (или dnf в CentOS 8).
apt update
apt install mysql-server mysql-client apache2 php php-mysql libapache2-mod-php php-json php-gd php-curl php-mbstring php-cas php-xml php-cli php-imap php-ldap php-xmlrpc php-apcu
Создайте новую mysql базу данных (можно использовать и mariadb) и пользователя для GLPI:
mysql -u root -p
CREATE DATABASE glpi;
CREATE USER 'glpi'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON glpi.* TO 'glpi'@'localhost';
FLUSH PRIVILEGES;
exit;
Скачайте и распакуйте дистрибутив GLPI:
wget https://github.com/glpi-project/glpi/releases/download/9.4.5/glpi-9.4.5.tgz
tar xvf glpi-9.4.5.tgz
Примечание. На момент написания этой статьи, последняя версия GLPI была 9.4.5. Чтобы скачать последнюю версию, перейдите на GitHub https://github.com/glpi-project/glpi/releases/ и выберите последний релиз.
Скопируйте GLPI в веб директорию:
mkdir /var/www/glpi
cp -R glpi/* /var/www/glpi
chown -R www-data:www-data /var/www/glpi
Совет. Довольно часто при развертывании GLPI встречаются ошибки, связанные со стандартными настройками PHP, поэтому рекомендуем сразу увеличчить лимиты для PHP. Вставьте следующие параметры в конец файла /etc/php/7.2/apache2/php.ini:
max_execution_time = 120 memory_limit = 512M post_max_size = 80M upload_max_filesize = 80M
Создайте файл виртуал хоста:
touch /etc/apache2/sites-available/glpi.conf
И вставляем следующую конфигурацию Virtual Host:
<VirtualHost *:80> ServerName glpi.local DocumentRoot /var/www/glpi <Directory /var/www/glpi> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all AuthType Basic </Directory> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined ErrorLog ${APACHE_LOG_DIR}/glpi_error.log </VirtualHost>
Активируйте виртуалхост:
a2ensite glpi
service apache2 reload
Проверьте, что виртуалхост активен.
Откройте браузер и переходим по URL адресу, который вы указали в виртуал хосте. В моём случае это
glpi.local
.
Перед вами должно появится окно веб-установщика GLPI.
Установка GLPI
Сначала нужно выбрать язык интерфейса GLPI и принять лицензионное соглашение. На следующем шаге нажмите Install и убедитесь, чтобы все тесты прошли успешно.
Укажите данные для подключения к базе данных.
Выберите ранее созданную базу данных:
Нажмите Continue и дождитесь импорта данных. База данных может наполняться продолжительное время (несколько минут). Это можно проверить командой
show processlist;
в mysql.
После этого установка GLPI практически завершена. Зайдите в панель управления (по-умолчанию, логин и пароль – glpi).
Базовая настройка GLPI
Для начала необходимо изменить пароли для встроенных пользователей, это можно сделать на вкладке Administration -> Users.
Если вы не хотите использовать встроенных пользователей, можно их разом отключить.
Примечание. GLPI рекомендует удалить файл install/install.php в целях безопасности. Сделайте командой: rm /var/www/glpi/install/install.php
Обзор интерфейса GLPI
Пробежимся по интерфейсу GLPI и рассмотрим некоторые из возможностей системы.
Вкладка Assets
Эта вкладка отвечает за инвентаризацию оборудования и софта. В GLPI есть возможность создавать шаблоны. Вы можете создавать различные шаблоны для разных устройств (компьютеров, роутеров, мониторов и т.д). Удобство в том, что при создании новых объектов вам не нужно заново заполнять статические данные (например, расположение или тип объекта).
Механизм шаблонов поддерживается и другими функциями, не только инвентаризацией.
Вкладка Assistance
Вкладка отвечает за управление задачами, инцидентами и проектами. Если вы знакомы с Jira, то здесь такой же принцип.
Есть возможность кастомизировать некоторые поля тикетов и создавать шаблоны для них (в Setup -> Dropdowns).
Вкладка Management
Также относится к инвентаризации – можно вести бюджет, учитывать лицензии, поставщиков и т.д.
Вкладка Tools
Эта вкладка содержит в себе разные инструменты – проекты, напоминания, отчеты и базу знаний (wiki).
Управление базой знаний:
Вкладка Administration
Здесь вы можете управлять пользователями, группами и сущностями GLPI, также есть лог действий пользователей GLPi.
Вкладка Setup
Также отвечает за управление GLPI – настройка пунктов меню, изменение различных форм и полей.
Плагин FusionInventory — автоматическая инвентаризация серверов и компьютеров
Рассмотрим одно из применений GLPI в реальной жизни – обнаружение устройств в сети и автоматическое заполнение инвентаризационных данных по оборудованию и установленным программам.
В GLPI не предусмотрено автоматическое обнаружение, но с этим может помочь плагин FusionInventory.
Установка Fusion Inventory
- Скачайте плагин FusionInventory с GitHub https://github.com/fusioninventory/fusioninventory-for-glpi/releases . В моём случае это последняя версия fusioninventory-9.4+2.4.tar.bz2;
- Распакуйте архив (
tar xvf arch.tar.bz2
) в директорию plugins (в моём случае это /var/www/glpi/plugins); - На сайте GLPI перейдите в Setup -> Plugins и нажмите на иконку установки плагина;
- Активируйте плагин;
Теперь во вкладке Administration появился пункт FusionInventory.
Перед установкой агентов на компьютеры и сервера нужно сразу включить нужные модули агентов.
Перейдите в Administration -> FusionInventory -> General -> General Configuration
Включите модули:
- Computer Inventory
- Network inventory (SNMP)
- Network discovery
- Package deployment
- Collect data
Установка Fusion Agent в Windows
Установить Fusion Agent можно либо через графический интерфейс (инсталлятор), либо через командную строку. Мы будем рассматривать второй вариант, так как он легко масштабируется для разворачивания через групповые политики или SCCM.
- Скачайте агент https://github.com/fusioninventory/fusioninventory-agent/releases. В моём случае я качаю Windows 64-bit OS: fusioninventory-agent_windows-x64_2.5.2.exe (не портейбл);
- Скопируйте установочный .ехе файл fusioninventory на компьютер, с которого вы хотите собирать данные;
- Откройте командную строку с правами администратора и выполните:
fusioninventory-agent_windows-x64_2.5.2.exe /S /acceptlicense /add-firewall-exception /debug=2 /execmode=Service /installtasks=Full /timeout=30 /delaytime=5 /server="_http://glpi.local/plugins/fusioninventory/" /runnow
Рассмотрим основные параметры уставки
- /S – Silent установка, без графического интерфейса
- /debug=2 – для подробных логов. При боевых развертываниях убирайте этот ключ
- /execmode=Service – ставим агент как службу Windows
- /installtasks=Full – устанавливаем все возможные сборщики
- /delaytime=5 – Задержка перед первым обращения к серверу. Если разворачиваете на большое число компьютеров, ставьте число повыше
- /server – адрес сервера GLPI
Не забудьте отредактировать параметры под свои нужды. Полный список параметров можно найти тут https://documentation.fusioninventory.org/FusionInventory_agent/installation/windows/windows-installer-2.3.x-command-line/
Совет. После установки, в случае возникновения проблем, можно посмотреть лог агента по пути C:\Program Files\FusionInventory-Agent\logs. Параметры агента хранятся в реестре, по пути Computer\HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent.
Перейдите в Administration -> FusionInventory -> General -> Agent Management, здесь вы можете управлять агентами
Убедитесь, что данные с данного компьютера появились в GLPI. Перейдите в Assets -> Computers.
Здесь отображаются все компьютеры, на которые вы установили агенты FusionInventory с модулем Collect Data. Откройте один из компьютеров и посмотрите на собранные данные. Как вы видите, в базе данных GLPI появилась информация об версии и билде Windows с сервера с агентом.
Вся информация заполняется автоматически из данных, которые приходят с агента. Также эта информация сортируется по категориям. Например, при установке агента на обычный ПК, можно получить информацию о периферийных устройствах. На скриншоте ниже информация о мониторах, подключенных к компьютеру где установлен агент.
Также вы видит список установленного на компьютере ПО.
Установка Fusion Agent на Linux
Рассмотрим установку из пакета на Ubuntu Server 18.04. Установите необходимые зависимости
apt install dmidecode hwdata ucf hdparm perl libuniversal-require-perl libwww-perl libparse-edid-perl libproc-daemon-perl libfile-which-perl libhttp-daemon-perl libxml-treepp-perl libyaml-perl libnet-cups-perl libnet-ip-perl libdigest-sha-perl libsocket-getaddrinfo-perl libtext-template-perl libxml-xpath-perl libyaml-tiny-perl libnet-snmp-perl libcrypt-des-perl libnet-nbname-perl libdigest-hmac-perl libfile-copy-recursive-perl libparallel-forkmanager-perl
Скачиваем пакет
wget https://github.com/fusioninventory/fusioninventory-agent/releases/download/2.5.2/fusioninventory-agent_2.5.2-1_all.deb
Установите пакет:
dpkg -i fusioninventory-agent_2.5.2-1_all.deb
В конфигурационном файле агента (/etc/fusioninventory/agent.cfg) измените следующие параметры:
delaytime = 5 server = _http://glpi.local/plugins/fusioninventory/
Перезапустите агент:
systemctl restart fusioninventory-agent
Если всё сделано правильно, вы увидите ваш Ubuntu компьютер/сервер в Assets-> Computers.
Статистика и отчеты в GLPI
В GLPI есть встроенные отчеты.
Но скорее всего вам потребуются отчеты по собственным параметрам. Для этого в GLPI есть плагины:
- https://plugins.glpi-project.org/#/plugin/reports — довольно просто позволяет создавать свои отчеты через PHP
- https://plugins.glpi-project.org/#/plugin/metabase — плагин для интеграции с https://www.metabase.com/
Пример встроенного отчета из плагина Reports:
GLPI развивается более 15 лет и содержит в себе огромное количество возможностей для управления ИТ инфраструктуры, а сообщество развивает и поддерживает плагины для различных интеграций и функционала. Система имеет огромные возможности модификации своих элементов, поэтому каждая компания настраивает GLPI под себя.
Средний рейтинг
5 из 5 звезд. 1 голосов.
Привет. Использую для инвентаризации GLPI + Fusion Inventory (plugin).
Требуется установить агента для автоматического сбора информации на клиентах.
Здесь рассмотрен способ установки для ОС Windows из командной строки.
Установка агента.
Новая установка из командной строки на удаленном ПК (Windows):
fusioninventory—agent_windows—x86_2.5.1.exe /S /acceptlicense /installtype=from—scratch /tag=‘kab.36’ /execmode=Service /installtasks=Full /httpd—ip=‘192.168.0.4’ /httpd—trust=‘192.168.0.0/24’ /server=‘http://glpi.test.local/plugins/fusioninventory’ /runnow |
fusioninventory-agent_windows-x86_2.5.1.exe — зависит от разрядности ОС. В данном случае у меня ОС — 32-х битная,
/S — тихий режим (без графики),
/acceptlicense — принятие лицензионного соглашения (по умолчанию: no),
/installtype= — тип установки: новая (дословно — с нуля),
/tag — тэг,
/execmode=Service — режим работы, в данном случае как сервис,
/installtasks=Full — вариант инвентаризации. Можно указывать отдельные задачи или выбрать один из трех вариантов, но в данном случае выбрал полный,
/httpd-ip=’192.168.0.4′ — какой IP будет использоваться для веб-сервиса агента,
/httpd-trust=’192.168.0.0/24′ — разрешенные IP-адреса для подключения,
/server=’http://glpi.test.local/plugins/fusioninventory’ — сервер с GLPI и плагином «FusionInventory»,
/runnow — запустить после установки.
Установка из консоли — обновление агента (сохранение текущей конфигурации):
-
<strong>fusioninventory-agent_windows-x64_2.5.1.exe</strong> /S /acceptlicense /installtype=from-current-config
fusioninventory-agent_windows-x64_2.5.1.exe — зависит от разрядности ОС. В данном случае у меня ОС — 64-х битная,
/S — тихий режим (без графики),
acceptlicense — принятие лицензионного соглашения (по умолчанию: no),
installtype= — тип установки:
— если сохраняется старый конфиг (обновление агента).
Т.к. у меня были установлены агенты ранее, то мне хватило этих параметров.
Еще конфиг хранится в реестре:
[HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent]
мои параметры подключения
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent]
«backend-collect-timeout»=»180»
«ca-cert-dir»=»»
«ca-cert-file»=»»
«conf-reload-interval»=»0»
«debug»=»2»
«delaytime»=»3600»
«html»=»1»
«httpd-ip»=»192.168.0.21»
«httpd-port»=»62354»
«httpd-trust»=»192.168.0.0/24,127.0.0.1/32»
«local»=»»
«logfile»=»C:\\Program Files\\FusionInventory-Agent\\logs\\fusioninventory-agent.log»
«logfile-maxsize»=»16»
«logger»=»File»
«no-category»=»»
«no-httpd»=»0»
«no-p2p»=»0»
«no-ssl-check»=»0»
«no-task»=»»
«password»=»»
«proxy»=»»
«server»=»http://glpi.test.local/plugins/fusioninventory»
«scan-homedirs»=»1»
«scan-profiles»=»1″ »
tag»=»my_room»
«tasks»=»»
«timeout»=»180»
«user»=»»
[свернуть]
«httpd-ip»=»192.168.0.21» — ip-адрес для доступа к странице статуса агента.
«httpd-port»=»62354» — стандартный порт. Не меняел его.
В браузере можно набрать http://192.168.0.21:62354 и должна окрыться страница состояния плагина.
«httpd-trust»=»192.168.0.0/24,127.0.0.1/32» — ip-адреса, которым разрешен доступ к web-странце плагина,
«server»=»http://glpi.test.local/plugins/fusioninventory» — сервер с установленным GLPI и плагином FusionInventory.
Если по каким-то причинам недоступна страница:
- при наличии фаервола, проверьте, что он не блокирует порт. В противном случае сделайте правило, разрешающее подключение на данный порт,
- в реестре (как в примере выше) проверьте настройки: ip-адрес httpd, разрешенные ip-адреса, а так же порт, если вы ставили свой,
- проверьте, что служба агента запущена: а) через службы или б) из командной строки.
а) Пуск — Выполнить — cmd или WIN+R — cmd — если есть права администратора. Или же найти «Командная строка» и запустить от имени администратора. Расположение зависит от версии ОС. В консоли ввести services.msc. Далее, найти службу FusionInventoryAgent.
Либо: Панель управления — Администрирование — Службы. Так же необходимы права администратора.
Слева будет отображено состояние. Чтобы попасть в свойства надо 2 раза кликнуть на службе или ПравойКнопкой Мыши вызвать контекстное меню:
Убедитесь, что тип запуска установлен: Автоматически.
Т.к. я не сталкивался с проблемами при установке агента, то тут не будут описаны ошибки по причине того, что их не было.
б) sc query type= service | find «Fusion»
примерный вывод:
Имя_службы: FusionInventory-Agent Выводимое_имя: FusionInventory Agent |
Нас интересует имя службы. Посмотрим на состоние:
sc query FusionInventory-Agent Имя_службы: FusionInventory-Agent Тип : 10 WIN32_OWN_PROCESS Состояние : 4 RUNNING (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN) Код_выхода_Win32 : 0 (0x0) Код_выхода_службы : 0 (0x0) Контрольная_точка : 0x0 Ожидание : 0x0 |
Как видим — запущена.
Если у вас не так, то можно посмотреть в логи: C:\Program Files\FusionInventory-Agent\logs\fusioninventory-agent.log
Ссылки:
Home FUSION INVENTORY.
Documents.
HOW-TO Agent.
If you found an error, highlight it and press Shift + Enter or to inform us.
Время на прочтение3 мин
Количество просмотров100K
Понадобилось мне собрать инфу о конфигурации компьютеров в рабочей сети. В качестве базы была выбрана GLPI. Т.к. OCS Inventory уже описывали на хабре и в коментариях к той статье упоминалось про Fusion Inventroy, то его и будем устанавливать.
Основные задачи:
- прикрутить Fusion Inventory к GLPI, без использования OCS Inventory;
- скрипт сбора инфы запускать вручную, при необходимости (чтобы в памяти ничего лишнего не висело);
- собрать конфигурацию компьютеров, управляющих промышенным оборудованием (они не подключены к сети);
На сервере уже должен быть установлен и настроен LAMP( в моем случае — это FAMP).
Устанавливаем GLPI
# cd /usr/ports/www/glpi; make install clean
Создаём базу и пользователя (USER и PASSWORD заменить на свои):
# mysqladmin -uroot -p create glpi
# mysql -uroot -p -e"GRANT ALL ON glpi.* TO USERNAME@localhost IDENTIFIED BY 'PASSWORD'" glpi
Добавляем в настройки апача (httpd.conf или httpd-vhosts.conf):
Alias /glpi "/usr/local/www/glpi"
<Directory /usr/local/www/glpi>
AllowOverride Options FileInfo
</Directory>
Перезагружаем апач:
# apachectl restart
Идем на созданный сайт(http://{host.domain}/glpi/) и выбираем язык установки Russian, а дальше там всё понятно.
Устанавливаем FusionInventory (сервер)
Скачиваем FusionInventory плагин и распаковываем в папку плагинов GLPI:
# cd ~
# fetch http://forge.fusioninventory.org/attachments/download/120/fusioninventory-for-glpi-2.2.2-release.tar.gz
# cd /usr/local/www/glpi/plugins/
# rm remove.txt
# tar -xzvf /root/fusioninventory-for-glpi-2.2.2-release.tar.gz
Проверяем структуру папок, она должна выглядеть так:
|--- glpi
|--- plugins
|--- fusioninventory
|--- fusioninventory
| |--- index.php
| |--- hook.php
| |--- front
| |--- inc
|
|--- fusininventory
| |--- ...
|
|--- fusinvsnmp
|--- ...
etc...
Заходим в GLPI под админским аккаунтом, меню «настройки» -> «дополнения» -> в поле «FusionInventory» -> «обновить/установить» -> «включить». «Устанавливаем», а затем включаем все части плагина в таком порядке:
- FusionInventory
- FusionInventory INVENTORY
- FusionInventory SNMP
Устанавливаем FusionInventory (клиент)
Скачиваем и устанавливаем клиент:
forge.fusioninventory.org/projects/fusioninventory-agent/wiki/Agent_supportedplateforms
При установке указываем путь к серверу(у Win версии настройки задаются во время установки):
http://server_ip/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php
Если используется DNS, то:
http://glpi.mydomain/plugins/fusioninventory/front/plugin_fusioninventory.communication.php
Для Active Directory:
http://AD_DOMAIN\user:password@serverip/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php
Возможно придётся указать дополнительные настройки (proxy, etc) — чекбокс «Advanced» при установке.
После установки клиента, заходим в веб интерфейс GLPI -> «Дополнения» -> «FusionInventory» -> «Управление агентами» и смотрим появился ли компьютер в списке.
Чтобы агент не висел постоянно в памяти, то после установки:
Windows
- Скопировать папку установленного Fusion-Inventory
- В ней создать файл save_net.cmd с таким содержанием:
set PATH=%CD%\perl\;%CD%\perl\bin;%PATH%
perl.exe %CD%\perl\bin\fusioninventory-agent --debug -f --no-wakeonlan --scan-homedirs --logfile=%CD%agent-log.txt --share-dir=%CD%share —server=http://glpi.mydomain/plugins/fusioninventory/front/plugin_fusioninventory.communication.php
Не забываем изменить «glpi.mydomain» на свое имя/ip.
Для инвентаризации/обновления запускать созданный скрипт, а для сохранения конфигурации компьютера(на котором нет сети)в файл, создаём в папке с Fusion-Inventory каталог «xml» и файл save_local.cmd с таким содержанием:
set PATH=%CD%\perl\;%CD%\perl\bin;%PATH%
perl.exe %CD%\perl\bin\fusioninventory-agent --debug -f --no-wakeonlan --scan-homedirs --local=%CD%\xml --logfile=%CD%\agent-log.txt --share-dir=%CD%\share
После запуска этого скрипта конфигурация сохранится в каталог «xml». Для импорта конфигурации в базу — заходим в glpi -> «Дополнения» -> «FusionInventory» -> «Import agent XML file» и выбираем нужный файл из папки xml.
В итоге получим portable версию Fusion Inventory, которую можно запускать с флешки. Главное быть уверенным, что ни у кого нет какой либо живности на компьютере.
FreeBSD / Linux
- Скачиваем тарбол из раздела с пакетами (Для арча подходит тарбол от ubuntu) forge.fusioninventory.org/projects/fusioninventory-agent/wiki/Agent_supportedplateforms
- Правим конфиг agent.cfg,
- От root`a запускаем «fusioninventory-agent»
P.S. Если удалить оборудование/компьютер/etc из списка, а потом прислать агентом на сервер информацию о нём, то онa не появиться в соответствующем списке — нужно отменить удаление («Показать удалённые объекты» -> «Восстановить»)
The latest release is available from our github releases page.
Note
In the case you’re replacing FusionInventory agent with GLPI Agent, you should first uninstall FusionInventory agent
before installing GLPI Agent. You can use the same dedicated configuration if you placed it in conf.d configuration subfolder.
Windows
The installer integrates its native, although reduced but recent, version of Strawberry Perl including recent OpenSSL support.
You can download the lastest GLPI Agent installer or current nightly build. It is available for 64 bits systems and provides a graphical interface as well as command line facilities.
Note
Since GLPI-Agent 1.8, no more installer is provided for 32 bits systems. The latest version supporting 32 systems is 1.7.3.
By default, it will perform a graphical installation, unless you use the msiexec /i and /quiet options. All installer parameters are described in Windows installer dedicated page.
Note
All graphical installer options are related to a command line one. Check Windows installer if you need help.
Winget
You can also use Winget tool to install or update GLPI-Agent on Windows 10 and Windows 11.
Note
Winget provides 1.7.3 x64 & x86 packages. Starting from 1.8, only x64 package is provided.
You can check glpi-agent availability from the command line:
During first installation, you can trigger interactive installation running:
winget install -i glpi-agent
To install without configuration or update using current configuration, just run:
winget install glpi-agent
Note
As it is installed at machine level and requires administrative privileges, an UAC prompt should be triggered if you don’t start the installation from an administrative console.
During first installation, you can use —custom option to configure glpi-agent as expected, for example for a quiet installation. You can use all parameters described in Windows installer page:
winget install glpi-agent --custom="SERVER='https://my-glpi-server/' RUNNOW=1"
Note
If you didn’t configure during first installation, you still can edit configuration in registry under HKEY_LOCAL_MACHINE\SOFTWARE\GLPI-Agent registry key. Don’t forget to restart the service if installed as a service (by default, it is).
Large Installations
Consider a scenario where the GLPI Agent application needs to be installed on large and diverse range of Windows systems. A VBScript can be useful in this scenario to perform the following tasks:
-
Install it silently taking variables from the installation script previously configured.
-
Check for the presence of FusionInventory and OCS Inventory agents and uninstall them if you need it.
-
Configure application settings based on command line parameters that can be explored here.
-
Log installation progress and errors for review and analysis.
A VBScript (Visual Basic Script) is provided to deploy the installer on a network:
glpi-agent-deployment.vbs
.
In this script you’ll find some variables that can be changed to your environment needings (uncomment what is commented and you need. Comment what you don’t need.):
-
GLPI Agent Version hereby named
SetupVersion
-
Setup the Location from where the script will download the MSI hereby named
SetupLocation
. It can be a HTTP or HTTPS url, a CIFS or local folder. The default is to use the github release page url. -
Setup the Architecture of your systems (if you need it to be x86, x64, or if you want to let it be installed according to the system Architecture) hereby named
SetupArchitecture
-
Setup Options from the command line parameters:
-
It is recommended to keep the
/quiet
parameter so the user will not be bothered with wizard or command line messages or windows -
If you want to follow all the steps of installations, don’t add the
/quiet
parameter.
-
-
Reconfigure:
-
You will just set this up to Yes if the current installed agent has the same version you have configured on the
SetupVersion
above. This option, when activated, is going to reconfigure the new options for the same Agent. -
It’s useful when you just need to change a parameter like GLPI
SERVER
url, for example.
-
-
Repair:
-
This option will unregister and register the MSI service DLL, and reinstall it with the options selected on the script.
-
It works just when the Setup is still installed.
-
-
Verbose:
-
It Enables or Disables
-
-
Run uninstall:
-
Here you can uncomment the deprecated agents you want the script to uninstall (FusionInventory Agent or OCSInventory Agent)
-
Hint
Adding this VBS Script to a Computer GPO to run on startup of computers, usually works better, since there are some users with no installation rights.
The msi download should be accessible for every computer that needs to execute it. If you are using a local network sharing, or a regular Github URL, you must make sure the computers are able to download it from the original source.
Contributions
Glpi-Agent Monitor
Note
This application requires that you have enabled the embedded http server
Leonardo Bernardes published Glpi-Agent Monitor tool which provides a systray icon to survey the agent status and permit to ask a tasks run.
You can download it from the Glpi-Agent Monitor project release page.
You simply have to download the exe into any folder (the Glpi-Agent installation folder is just fine) and start it.
If you want to add it to all users auto-started softwares, you can directly install it into the C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp folder.
Hint
Glpi-Agent Monitor has been integrated into GLPI-Agent MSI installer and can be enabled using AGENTMONITOR=1 on the MSI commandline. When installed this way, you don’t need to copy it manually and it starts when a user is logs in.
MacOS
The installer integrates its native, although reduced but recent, version of Perl including recent OpenSSL support.
Get the latest .pkg
package from our releases page or the nightly build page. After installing it, you’ll have to configure the agent to your needs by creating a dedicated .cfg
file under the /Applications/GLPI-Agent/etc/conf.d
folder.
You can for example create a local.cfg
file and:
-
add the
server = GLPI_URL
line to point to your GLPI server, -
eventually set
debug = 1
to generate some debug in logs, -
set a
tag
liketag = MyLovelyTag
.
GNU/Linux
We support major distros as we provides generic packages for RPM and DEB based distros as well if they supports Snap packaging. You can install required packages after getting them from our github releases page or the nightly build page.
Hint
When possible, prefer to use our linux perl installer as it supports RPM and DEB based distros. There’s a version also including the Snap package.
The linux installer accepts few options to configure the agent so it can simplify manual or automatic installation.
It also can be handy for tools like Puppet or Ansible.
Linux AppImage installer
Snap
The Snapcraft Snap package integrates its native, although reduced but recent, version of Perl including recent OpenSSL support.
If your system support Snap, you can simply install the agent with the snap
command after getting the Snap package from our releases page or the nightly build page. Then, you just have to run:
snap install --classic --dangerous GLPI-Agent-|version|_amd64.snap
After installation, you can easily configure the agent with the set snap
sub-command:
snap set glpi-agent server=http://my-glpi-server/
Any supported glpi-agent option can be set this way. If you need to unset a configuration parameter, just set it empty:
Note
You won’t find the package in the Snapcraft store as their standard policies are too restrictive for GLPI Agent features and requirements.
Linux Perl Installer
Attention
The linux installer main requirement is the perl command.
It also requires one of the following command, depending on the targeted system:
dnf for recent RPM based systems
yum for previous generation of RPM based systems
apt for DEB based systems like Debian & Ubuntu
snap for other systems supporting Snapcraft Snap packages
We also provide a dedicated linux installer which includes all the packages we build (RPM & DEB) and eventually the snap one.
On supported distros (DEB & RPM based), the installer will also eventually try to enable third party repositories, like EPEL on CentOS if they are required.
The installer is a simple perl script. It supports various options to configure the agent during installation. If no options are specified, the default is for the installer to configure glpi-agent to not scan user home directories or profiles, to run inventory modules with a 30 minute timeout, to allow HTTP requests to port 62354 only from the GLPI server, to setup the glpi-agent as a service and to install only the Computer Inventory and Remote Inventory tasks. You can check all supported options by running:
perl glpi-agent-|version|-linux-installer.pl --help
or if you use the installer embedding snap package:
perl glpi-agent-|version|-with-snap-linux-installer.pl --help
If your GNU/Linux distro is not supported, you still can install it from sources.
Unofficial repositories
Attention
Unofficial repositories are not supported by GLPI-Agent editor. Use them at your own risk.
Thanks to ligenix, a COPR repository can be used to install glpi-agent on Fedora 35 & 36, CentOS Stream 8 & 9, EPEL 7, 8 & 9: ligenix/enterprise-glpi10
From sources
Note
We strongly recommend the use of GNU tar because some file path length are
greater than 100 characters. Some tar version will silently ignore those files.
First, you need to extract the source and change the current directory.
tar xfz GLPI-Agent-|version|.tar.gz cd GLPI-Agent-|version|
Executing Makefile.PL
will verify all the required dependencies are available
and prepare the build tree.
If you don’t want to use the default directory (/usr/local
), you can use the
PREFIX
parameter:
perl Makefile.PL PREFIX=/opt/glpi-agent
Note
At this point, you may have some missing required modules. See PERL Dependencies
section for installing them. Once this is done, run the same command again.
You now can finish the installation. Here again we recommend GNU make (gmake):
Tests
Note
The tests suite requires some additional dependencies like Test::More.
GLPI agent comes with a test-suite. You can run it with this command:
Perl dependencies
The easiest way to install perl dependencies is to use cpanminus script, running:
You can use the --notest
flag if you are brave and want to skip the tests suite execution for each install perl module.
Offline installations
Note
This requires the cpanminus script to be installed.
First grab the tarball from the website and extract it:
tar xzf GLPI-Agent-|version|.tar.gz cd GLPI-Agent-|version|
We use cpanm
to fetch and extract the dependencies in the extlib directory:
cpanm --pureperl --installdeps -L extlib --notest .
If this command fails with an error related to Params::Validate
, then just run
this last command:
cpanm --installdeps -L extlib --notest .
Now you can copy the directory to another machine and run the agent this way:
perl -Iextlib/lib/perl5 -Ilib glpi-agent
Other dependencies
On Solaris/SPARC, you must install sneep and record the Serial Number with it.
On Windows, we use an additional dmidecode
binary shipped in the windows MSI
package to retrieve many information not available otherwise, including
fine-grained multi-cores CPUs identification. Unfortunately, this binary is not
reliable enough to be used on Windows 2003, leading to less precise
inventories.
On Linux, lspci
will be used to collect PCI, AGP, PCI-X, … information.
Наш канал в Telegram
После того как мы установили и настроили менеджер IT-инфраструктуры — GLPI, необходимо собрать информацию о ПК сети. Для этого нам понадобится плагин fusioninventory.
Скачиваем плагин с официального сайта Fusioninventory — http://fusioninventory.org:
wget https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi090%2B1.3/fusioninventory-for-glpi_0.90.1.3.tar.gz
Распаковываем и помещаем в директорию /plugins, у меня это /var/www/support.itsch.ru/plugins:
ls /var/www/support.itsch.ru/plugins
fusioninventory remove.txt
Заходим в систему GLPI и переходим в раздел «Настройки» — «Дополнения»
И выполняем установку дополнения:
И включаем плагин:
После включения в главном меню появиться раздел «Дополнения» — «FusionInventory»:
Переходим в раздел «Организация» и указываем ссылку на менеджер IT-инфраструктуры. В нашем случае это http://support.itsch.ru:
Переходим «Дополнения» — «FusionInventory»:
Следующий этап — это установка клиента на ПК в локальной сети.
Для Ubuntu / Debian:
# apt-cache search FusionInventory
fusiondirectory-plugin-fusioninventory — FusionInventory plugin for FusionDirectory
fusiondirectory-plugin-fusioninventory-schema — LDAP schema for FusionDirectory fusioninventory plugin
fusioninventory-agent — Hardware and software inventory tool (client)
fusioninventory-agent-task-deploy — Software deployment support for FusionInventory
fusioninventory-agent-task-esx — ESX and ESXi inventory
fusioninventory-agent-task-network — Network device discovery for FusionInventory Agent
libfusioninventory-agent-task-deploy-perl — transitional dummy package
libfusioninventory-agent-task-esx-perl — transitional dummy package
libfusioninventory-agent-task-netinventory-perl — transitional dummy package
libfusioninventory-agent-task-network-perl — transitional dummy package
libfusioninventory-agent-task-snmpquery-perl — transitional dummy package
# apt-get install fusioninventory-agent
После установки редактируем конфигурационный файл:
mcedit /etc/fusioninventory/agent.cfg
Находим строку server = http://server.domain.com/glpi/plugins/fusioninventory
и меняем на: server = http://support.itsch.ru/plugins/fusioninventory , не забудьте раскомментировать строку. Сохраняем изменения и перезапускаем fusioninventory-agent:
service fusioninventory-agent restart
Для Windows:
Скачиваем агента: http://forge.fusioninventory.org/projects/fusioninventory-agent-windows-installer/files. Так как система на ПК оказалась 32-битная, то скачиваем fusioninventory-agent_windows-x86_2.3.17.exe и производим стандартную процедуру установки приложения:
Соглашаемся с лицензионным соглашением:
Выбираем настройки по умолчанию:
Указываем директорию для установки приложения:
Указываем url плагина на сервере. В нашем случае это http://support.itsch.ru/plugins/fusioninventory :
Наблюдаем процедуру копирования файлов:
Завершаем процесс установки:
Переходим в Главное меню и запускаем агента на исполнение:
Переходим в интерфейс менеджера IT-инфраструктуры (GLPI). «Оборудование» — «Компьютеры» и констатируем, что первый ПК у нас уже в системе:
И так со всеми ПК в сети.