


The time has come in our company to register computer equipment. The company is growing, expanding, and the memory of the IT department plus several XLS files is no longer enough for a quick and reliable answer about what we have and where it is.
What we have:
1) each user is provided with the necessary equipment (several monitors, a tablet, a printer, a scanner, a bespeerator etc);
2) everyone has a set of free software installed on the computer, plus paid programs;
3) there are several data centers, each of which has several racks filled with servers and active equipment;
')
What I wanted to achieve:
1) keep a record of components in each computer, the ability to see the upgrades and repairs;
2) have a complete list of purchased software, with serials and distributions;
3) to see which licenses were issued to whom, and on which machines they are installed;
4) the ability to build any reports, for example, Pyotr Ivanov is - a system unit in such a configuration, 2 monitors, a laptop, a workplace on the 99th floor, in room 9901, uses licenses Windows XP, Office 2007, WinRar, Total Commander; or how many licenses we have left for Photoshop and to whom the employees have been issued; or how many and which servers (serials and inventories such and such) are employed for such a project, what software is installed on them, how much the project costs (the cost of servers and licenses are entered); and so on and so forth.
PS Also, GLPI can be used as a HelpDesk application filing system, but we already use JIRA if I’m interested in telling, but haven’t planned it yet.
So, I would like to talk about how I completed the tasks. It would be interesting to tell how many products I tried before stopping at this, but maybe next time. In this post, I’ll start specifically on the necessary actions, with the help of which anyone will be able to install the same service at home (this will be a step-by-step guide for beginners with examples of commands and their output to the console, not counting heaps of pictures). Now we will consider only the installation and the necessary settings, in the future I want a little more practice (a bundle with OCS Inventory), and after probably a theory. In our company, Debian is selected among Linux systems, and we will customize it using his example.
Part 1: Installation
1. Install OS
Downloading the latest Debian image from the site:
www.debian.com/CD/netinst
I have this
debian-504-i386-netinst.iso We will have enough network installation, the rest we will deliver ourselves. After installation, install the following components:
apt-get install ssh, apache2, mysql-server, php5
2. We configure MySQL
2.1 Login as root, enter the password that we entered when installing MySQL:
mysql -uroot -p
inventory:/home/tyran# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.0.51a-24+lenny3 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
2.2 Create a database for our program:
create database glpidb;
mysql> create database glpidb;
Query OK, 1 row affected (0.00 sec)
2.3 Create a user, and give him the rights from the database created:
grant all privileges on glpidb. * to glpiuser @ localhost identified by 'Enter your password for it here';
mysql> grant all privileges on glpidb.* to glpiuser@localhost
-> identified by 'password';
Query OK, 0 rows affected (0.00 sec)
2. Installing GLPI
2.1 Downloading the latest stable version from the site
www.glpi-project.org/?article41&lang=en
I am installing
GLPI Version 0.72.42.2 Unpack the archive in / var / www /
tar xzvf glpi-0.72.4.tar.gz -C / var / www
2.3 Go to the folder, and issue the necessary rights to the folders:
cd / var / www / glpi
chown www-data: www-data config files files / * inc
3. Configure GLPI
Go to the address:
http: // server_ip_address / glpi
3.1 Choose a language

3.2 Accept the license agreement

3.3 Select the installation

3.4 Checking the environment

3.5 This is an example of an error if there are not enough rights to write to folders.

3.6 Enter the data to connect to MySQL

3.7 Choosing your GLPIDB database

3.8 Base successfully connected

3.9 Everything is ready, the default logins and passwords are listed here.

3.10 We can check and log in as super-admin (glpi: glpi)

3.11 to change the user interface to Russian, you must select the "Setting" in the upper right and select a language on the page. And you can choose as a global for all new users, and for the current account.

And so, on this installation is over. You can log in using default passwords and enter data.
Part 2.Setting
1. Configure LDAP
Now it would be more convenient for us to bind LDAP to our inventory system. We will be able to import users to us into the system, and then, after that, distribute the rights to them and attach the equipment to them.
1.1 Select the menu Setup -> Authentication

1.2 Next we need LDAP

1.3 And then we see the error

Install the missing
apt-get install php5-ldap
inventory:~# apt-get install php5-ldap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php5-ldap
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.2kB of archives.
After this operation, 102kB of additional disk space will be used.
Get:1 security.debian.org lenny/updates/main php5-ldap 5.2.6.dfsg.1-1+lenny6 [18.2kB]
Fetched 18.2kB in 2s (6613B/s)
Selecting previously deselected package php5-ldap.
(Reading database ... 18693 files and directories currently installed.)
Unpacking php5-ldap (from .../php5-ldap_5.2.6.dfsg.1-1+lenny6_i386.deb) ...
Setting up php5-ldap (5.2.6.dfsg.1-1+lenny6) ...
1.4 Apache Restart
./etc/init.d/apache2 restart
1.5 Update the page and add the LDAP server

1.5.1 Now more details on the fields that must be filled
(In version 0.72.4, an Active Directory button was added, by pressing which, AD-specific values will be substituted)
Name - What do you like and write
Server - Specify the domain controller to which we will contact ldap: //dc1.domain.com
LDAP Port - default 389
Basedn - where we will look for users, for example, all users of the domain dc = domain, dc = com
rootdn is the path to the user, on behalf of which an LDAP query will be made, I created a web user in the division, total cn = web, ou = allusers, dc = domain, dc = com
Pass - password from user web
Login Field - samaccountname
Connection filter - (& (objectClass = user) (objectCategory = person) (! (UserAccountControl: 1.2.840.113556.1.4.803: = 2))) (search only active users)
USE TLS - No
Time zone - GMT +3 Hour
HOw LDAP aliases should be handle - Never
I don't use groups.
GLPI / LDAP Links - Here we fill in the binding of AD fields to user fields in GLPI, so AD users are imported into GLPI with the fields first name, last name, email.
Surname - sn
Firstname - givenname
E-mail - mail
1.6 Here we can test the connection. If everything is ok, we will get the answer:

1.7 We can also add a second LDAP server, in case the first one fails, and we can also test it:

2. Backup settings
2.1 Create a
backup.sh file
with the following content
#!/bin/sh
user="-uroot"
pass="-pMySQL"
path="/var/www/glpi/files/_dumps"
date="`date +%Y-%m-%d`"
mysqldump $user $pass glpidb > $path/$date.glpidb.backup.sql
2.2 We set the scheduler to run our backup, for example, daily at 23 o'clock:
crontab -e
# mh dom mon dow command
0 23 * * * /home/tyran/backup.sh
Now in the Administration - Data menu we see the backup we have made, and we can restore it from there.

3. Export to PDF in Russian
Detailed instructions from the
young admin