Está en la página 1de 30

Instalación de OCS Inventory NG 2.5 en Ubuntu Server 18.

04

Descripción y objetivo:

OCS Inventory es un software para inventario de hardware y software de código libre, esta
aplicación nació en Francia a finales de 2005 y funciona sobre Apache, MySql y Perl. Utiliza un
ligero agente en los equipos cliente que se mantiene en comunicación periódica con el servidor
informando de los posibles cambios. Esto es posible tanto para equipos de nuestra red local como
para ordenadores remotos que dispongan de conectividad a Internet

En este documento instalaremos desde cero un servidor OCS Inventory NG versión 2.5 en un
Ubuntu Server 18.04, posteriormente instalaremos el programa cliente en un equipo y veremos
los primeros datos del inventario.

Resumen de los pasos que seguiremos:

1.- Instalaremos Ubuntu Server 18.04

2.- Instalaremos todos los requisitos y dependencias

3.- Instalaremos y configuraremos OCS Inventory NG 2.5

4.- Instalaremos el agente en un equipo y veremos el inventario

1.- Instalación de Ubuntu Server 18.04

La instalación de Ubuntu se ha simplificado mucho en las ultimas versiones, si bien ya era sencillo
en las versiones más antiguas, con la 18.04 es ya un juego de niños. Completaremos el asistente
teniendo en cuenta un par de puntos que es bueno recordar.

 Recomendación que no obligación instalar el sistema operativo en Inglés, puesto que en


caso de error nos sera mucho más fácil encontrar documentación.

 Configuramos la red, ip, puerta de enlace, servidores dns, dominio…. (La instalación
permite configurar esto de manera muy sencilla)

 Durante esta instalación yo crearé el usuario “ocs” pero si lo deseamos podemos utilizar
cualquier otro.

 Particionaremos el disco duro según recomendación

Una vez finalizada la instalación y verificado que tenemos conectividad a red e Internet (Haremos
ping a puerta de enlace y a dns de Internet), actualizaremos el sistema.
1 sudo apt-get update

1 sudo apt-get upgrade

Ponemos el equipo en la zona horaria correspondiente, consultar vuestra zona en esta


url: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

1 sudo timedatectl set-timezone Europe/Madrid

Nos aseguramos de que es correcto.

1 date

2.- Instalación y preparación de los requisitos y dependencias

2.1.- Instalamos todos los paquetes necesarios

sudo apt-get install wget build-essential apache2 php libapache2-mod-php7.2 php-gd libgd-dev
unzip libapache2-mod-perl2 mysql-server libdbd-mysql-perl php-mysql php-mbstring php7.2-
1
mbstring php-gettext php-soap php7.2-curl libxml-simple-perl libapache-dbi-perl libnet-ip-perl
libsoap-lite-perl

1 sudo cpan -i XML::Entities Compress::Zlib Archive::Zip Mojolicious::Lite Switch Plack::Handler

2.2.- Activamos el modulo mbstring en php

1 sudo phpenmod mbstring

2.3.- Cambiamos el password root del MySQL que acabamos de


1 sudo mysql_secure_i instalar
1 sudo mysql_secure_installation

1 Securing the MySQL server deployment.

3 Connecting to MySQL using a blank password.

5 VALIDATE PASSWORD PLUGIN can be used to test passwords

6 and improve security. It checks the strength of password

7 and allows the users to set only those passwords which are

8 secure enough. Would you like to setup VALIDATE PASSWORD plugin?

10 Press y|Y for Yes, any other key for No: y

11

12 There are three levels of password validation policy:

13

14 LOW Length >= 8

15 MEDIUM Length >= 8, numeric, mixed case, and special characters

16 STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

17

18 Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0

19 Please set the password for root here.

20

21 New password:
22

23 Re-enter new password:

24

25 Estimated strength of the password: 50

26 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No)
:y
27
By default, a MySQL installation has an anonymous user,
28
allowing anyone to log into MySQL without having to have
29
a user account created for them. This is intended only for
30
testing, and to make the installation go a bit smoother.
31
You should remove them before moving into a production
32
environment.
33

34
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
35
Success.
36

37

38
Normally, root should only be allowed to connect from
39
'localhost'. This ensures that someone cannot guess at
40
the root password from the network.
41

42
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n
43

44
... skipping.
45
By default, MySQL comes with a database named 'test' that
46
anyone can access. This is also intended only for testing,
47
and should be removed before moving into a production
48
environment.
49
50

51 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

52 - Dropping test database...

53 Success.

54

55 - Removing privileges on test database...

56 Success.

57

58 Reloading the privilege tables will ensure that all changes

59 made so far will take effect immediately.

60

61 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

62 Success.

63

64 All done!

2.4.- Creamos la base de datos, el usuario y el password que vamos a utilizar

Para ello nos conectamos al MySQL con el usuario root y el password que acabamos de definir. En
este caso a la base de datos la llamaré ocsweb, al usuario ocsuser y al password ocspassword

1 sudo mysql -u root -p

1 CREATE DATABASE ocsweb

2 DEFAULT CHARACTER SET utf8

3 DEFAULT COLLATE utf8_general_ci;


GRANT ALL PRIVILEGES ON `ocsweb` .* TO 'ocsuser'@'localhost' IDENTIFIED BY 'ocspassword'
1
WITH GRANT OPTION;

Para salir de Mysql ejecutamos “quit”

3.- Instalación y configuración del OCS Inventory NG

3.1.- Descargamos y descomprimimos

Para descargar podemos ir a la pagina web del ocs y buscar el paquete para Linux en el apartado
descargas

https://www.ocsinventory-ng.org

Con el botón derecho copiaremos la url de destino del paquete gz y lo descargaremos en la


carpeta tmp

1 cd /tmp

sudo wget https://github.com/OCSInventory-NG/OCSInventory-


1
ocsreports/releases/download/2.5/OCSNG_UNIX_SERVER_2.5.tar.gz

Precaución, la url de destino puede ser diferente

sudo wget https://github.com/OCSInventory-NG/OCSInventory-


1
ocsreports/releases/download/2.5/OCSNG_UNIX_SERVER_2.5.tar.gz

Precaución, el nombre del fichero gz puede ser diferente


1 sudo tar -zxvf OCSNG_UNIX_SERVER_2.5.tar.gz

Precaución, el nombre de carpeta puede ser diferente

1 cd OCSNG_UNIX_SERVER_2.5/

3.2.- Instalación

1 sudo ./setup.sh

Es necesario notar que durante la instalación se nos advierte sobre la falta de un módulo SOAP
(*** Warning: PERL module Apache2::SOAP is not installed !), he realizado muchas instalaciones
de este producto y nunca he conseguido no tener esta advertencia aún habiendo instalado dicho
módulo de todas las formas posibles. Consultando documentación, en la propia web de OCS y
dicho por uno de sus desarrolladores, este modulo no es necesario y no impide para nada el
correcto funcionamiento del programa, por lo que omitiremos, si alguno de ustedes es capaz de
evitar esta advertencia, estaré encantado de que me lo diga.

1 +----------------------------------------------------------+

2 | |

3 | Welcome to OCS Inventory NG Management server setup ! |

4 | |

5 +----------------------------------------------------------+
6

7 Trying to determine which OS or Linux distribution you use

8 +----------------------------------------------------------+

9 | Checking for Apache web server binaries ! |

10 +----------------------------------------------------------+

11

12 CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and

13 previous, please remove any Apache configuration for Communication Server!

14

15 Do you wish to continue ([y]/n)?y

16 Assuming Communication server 1.0 RC2 or previous is not installed

17 on this computer.

18

19 Starting OCS Inventory NG Management server setup from folder


/tmp/OCSNG_UNIX_SERVER_2.5
20
Storing log in file /tmp/OCSNG_UNIX_SERVER_2.5/ocs_server_setup.log
21

22
+----------------------------------------------------------+
23
| Checking for database server properties... |
24
+----------------------------------------------------------+
25

26
Your MySQL client seems to be part of MySQL version 5.7.
27
Your computer seems to be running MySQL 4.1 or higher, good ;-)
28

29
Which host is running database server [localhost] ?
30
OK, database server is running on host localhost ;-)
31

32
On which port is running database server [3306] ?
33
OK, database server is running on port 3306 ;-)
34

35

36 +----------------------------------------------------------+

37 | Checking for Apache web server daemon... |

38 +----------------------------------------------------------+

39

40 Where is Apache daemon binary [/usr/sbin/apache2ctl] ?

41 OK, using Apache daemon /usr/sbin/apache2ctl ;-)

42

43

44 +----------------------------------------------------------+

45 | Checking for Apache main configuration file... |

46 +----------------------------------------------------------+

47

48 Where is Apache main configuration file [/etc/apache2/apache2.conf] ?

49 OK, using Apache main configuration file /etc/apache2/apache2.conf ;-)

50

51

52 +----------------------------------------------------------+

53 | Checking for Apache user account... |

54 +----------------------------------------------------------+

55

56 Which user account is running Apache web server [www-data] ?

57 OK, Apache is running under user account www-data ;-)

58

59

60 +----------------------------------------------------------+

61 | Checking for Apache group... |


62 +----------------------------------------------------------+

63

64 Which user group is running Apache web server [www-data] ?

65 OK, Apache is running under users group www-data ;-)

66

67

68 +----------------------------------------------------------+

69 | Checking for Apache Include configuration directory... |

70 +----------------------------------------------------------+

71

72 Setup found Apache Include configuration directory in

73 /etc/apache2/conf-available.

74 Setup will put OCS Inventory NG Apache configuration in this directory.

75 Where is Apache Include configuration directory [/etc/apache2/conf-available] ?

76 OK, Apache Include configuration directory /etc/apache2/conf-available found ;-)

77

78

79 +----------------------------------------------------------+

80 | Checking for PERL Interpreter... |

81 +----------------------------------------------------------+

82

83 Found PERL interpreter at </usr/bin/perl> ;-)

84 Where is PERL interpreter binary [/usr/bin/perl] ?

85 OK, using PERL interpreter /usr/bin/perl ;-)

86

87

88 Do you wish to setup Communication server on this computer ([y]/n)?

89
90

91 +----------------------------------------------------------+

92 | Checking for Make utility... |

93 +----------------------------------------------------------+

94

95 OK, Make utility found at </usr/bin/make> ;-)

96

97 +----------------------------------------------------------+

98 | Checking for Apache mod_perl version... |

99 +----------------------------------------------------------+

100

101 Checking for Apache mod_perl version 1.99_22 or higher

102 Found that mod_perl version 1.99_22 or higher is available.

103 OK, Apache is using mod_perl version 1.99_22 or higher ;-)

104

105 +----------------------------------------------------------+

106 | Checking for Communication server log directory... |

107 +----------------------------------------------------------+

108

109 Communication server can create detailed logs. This logs can be enabled

110 by setting integer value of LOGLEVEL to 1 in Administration console

111 menu Configuration.

112 Where to put Communication server log directory [/var/log/ocsinventory-server] ?

113 OK, Communication server will put logs into directory /var/log/ocsinventory-server ;-)

114

115 +----------------------------------------------------------------------------+

116 | Checking for Communication server plugins configuration directory... |

117 +----------------------------------------------------------------------------+
118

119 Communication server need a directory for plugins configuration files.

120 Where to put Communication server plugins configuration files [/etc/ocsinventory-


server/plugins] ?
121
OK, Communication server will put plugins configuration files into directory
122
/etc/ocsinventory-server/plugins ;-)
123

124
+-------------------------------------------------------------------+
125
| Checking for Communication server plugins perl directory... |
126
+-------------------------------------------------------------------+
127

128
Communication server need a directory for plugins Perl modules files.
129
Where to put Communication server plugins Perl modules files [/etc/ocsinventory-
130 server/perl] ?

131 OK, Communication server will put plugins Perl modules files into directory
/etc/ocsinventory-server/perl ;-)
132

133

134
+----------------------------------------------------------+
135
| Checking for required Perl Modules... |
136
+----------------------------------------------------------+
137

138
Checking for DBI PERL module...
139
Found that PERL module DBI is available.
140
Checking for Apache::DBI PERL module...
141
Found that PERL module Apache::DBI is available.
142
Checking for DBD::mysql PERL module...
143
Found that PERL module DBD::mysql is available.
144
Checking for Compress::Zlib PERL module...
145
Found that PERL module Compress::Zlib is available.
146 Checking for XML::Simple PERL module...

147 Found that PERL module XML::Simple is available.

148 Checking for Net::IP PERL module...

149 Found that PERL module Net::IP is available.

150 Checking for SOAP::Lite Perl module...

151 Found that PERL module SOAP::Lite is available.

152 Checking for Archive::Zip Perl module...

153 Found that PERL module Archive::Zip is available.

154

155 +----------------------------------------------------------+

156 | Checking for optional Perl Modules... |

157 +----------------------------------------------------------+

158

159 Checking for Apache2::SOAP PERL module...

160 *** Warning: PERL module Apache2::SOAP is not installed !

161 This module is only required by OCS Inventory NG SOAP Web Service.

162 Do you wish to continue ([y]/n] ?

163 Checking for XML::Entities PERL module...

164 Found that PERL module XML::Entities is available.

165

166

167 Do you wish to setup Rest API server on this computer ([y]/n)?

168

169 +----------------------------------------------------------+

170 | Checking for REST API Dependencies ... |

171 +----------------------------------------------------------+

172

173 Found that PERL module Mojolicious::Lite is available.


174 Found that PERL module Switch is available.

175 Found that PERL module Plack::Handler is available.

176

177 +----------------------------------------------------------+

178 | Configuring REST API Server files ... |

179 +----------------------------------------------------------+

180

181 Where do you want the API code to be store [/usr/local/share/perl/5.26.1] ?

182 Copying files to /usr/local/share/perl/5.26.1

183

184 +----------------------------------------------------------+

185 | Configuring REST API Server configuration files ... |

186 +----------------------------------------------------------+

187

188

189 +----------------------------------------------------------+

190 | OK, looks good ;-) |

191 | |

192 | Configuring Communication server Perl modules... |

193 +----------------------------------------------------------+

194

195 Checking if your kit is complete...

196 Looks good

197 Generating a Unix-style Makefile

198 Writing Makefile for Apache::Ocsinventory

199 Writing MYMETA.yml and MYMETA.json

200

201 +----------------------------------------------------------+
202 | OK, looks good ;-) |

203 | |

204 | Preparing Communication server Perl modules... |

205 +----------------------------------------------------------+

206

207

208 +----------------------------------------------------------+

209 | OK, prepare finshed ;-) |

210 | |

211 | Installing Communication server Perl modules... |

212 +----------------------------------------------------------+

213

214

215 +----------------------------------------------------------+

216 | OK, Communication server Perl modules install finished;-)|

217 | |

218 | Creating Communication server log directory... |

219 +----------------------------------------------------------+

220

221 Creating Communication server log directory /var/log/ocsinventory-server.

222

223 Fixing Communication server log directory files permissions.

224 Configuring logrotate for Communication server.

225 Removing old communication server logrotate file /etc/logrotate.d/ocsinventory-NG

226 Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-server

227

228

229 +----------------------------------------------------------------------+
230 | OK, Communication server log directory created ;-) |

231 | |

232 | Creating Communication server plugins configuration directory... |

233 +----------------------------------------------------------------------+

234

235 Creating Communication server plugins configuration directory /etc/ocsinventory-


server/plugins.
236

237

238
+----------------------------------------------------------------------+
239
| OK, Communication server plugins configuration directory created ;-) |
240
| |
241
| Creating Communication server plugins Perl directory... |
242
+----------------------------------------------------------------------+
243

244
Creating Communication server plugins Perl directory /etc/ocsinventory-server/perl.
245

246

247
+----------------------------------------------------------------------+
248
| OK, Communication server plugins Perl directory created ;-) |
249
| |
250
| Now configuring Apache web server... |
251
+----------------------------------------------------------------------+
252

253
To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,
254
Setup can name Communication Server Apache configuration file
255
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
256
Do you allow Setup renaming Communication Server Apache configuration file
257
to 'z-ocsinventory-server.conf' ([y]/n) ?
258 OK, using 'z-ocsinventory-server.conf' as Communication Server Apache configuration file

259 Removing old communication server configuration to file /etc/apache2/conf-


available/ocsinventory.conf
260
Writing communication server configuration to file /etc/apache2/conf-available/z-
261
ocsinventory-server.conf
262

263
+----------------------------------------------------------------------+
264
| OK, Communication server setup successfully finished ;-) |
265
| |
266
| Please, review /etc/apache2/conf-available/z-ocsinventory-server.conf |
267
| to ensure all is good. Then restart Apache daemon. |
268
+----------------------------------------------------------------------+
269

270

271
Do you wish to setup Administration Server (Web Administration Console)
272
on this computer ([y]/n)?
273

274
+----------------------------------------------------------+
275
| Checking for Administration Server directories... |
276
+----------------------------------------------------------+
277

278
CAUTION: Setup now install files in accordance with Filesystem Hierarchy
279
Standard. So, no file is installed under Apache root document directory
280
(Refer to Apache configuration files to locate it).
281
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
282
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
283
root document directory.
284
If you choose to move directory, YOU MUST MOVE 'download' directory to
285
Administration Server writable/cache directory (by default
286 /var/lib/ocsinventory-reports), especially if you use deployment feature.

287

288 Do you wish to continue ([y]/n)?

289 Assuming directories 'ocsreports' and 'download' removed from

290 Apache root document directory.

291

292 Where to copy Administration Server static files for PHP Web Console

293 [/usr/share/ocsinventory-reports] ?

294 OK, using directory /usr/share/ocsinventory-reports to install static files ;-)

295

296 Where to create writable/cache directories for deployment packages,

297 administration console logs, IPDiscover and SNMP [/var/lib/ocsinventory-reports] ?

298 OK, writable/cache directory is /var/lib/ocsinventory-reports ;-)

299

300

301 +----------------------------------------------------------+

302 | Checking for required Perl Modules... |

303 +----------------------------------------------------------+

304

305 Checking for DBI PERL module...

306 Found that PERL module DBI is available.

307 Checking for DBD::mysql PERL module...

308 Found that PERL module DBD::mysql is available.

309 Checking for XML::Simple PERL module...

310 Found that PERL module XML::Simple is available.

311 Checking for Net::IP PERL module...

312 Found that PERL module Net::IP is available.

313
314 +----------------------------------------------------------+

315 | Installing files for Administration server... |

316 +----------------------------------------------------------+

317

318 Creating PHP directory /usr/share/ocsinventory-reports/ocsreports.

319 Copying PHP files to /usr/share/ocsinventory-reports/ocsreports.

320 Fixing permissions on directory /usr/share/ocsinventory-reports/ocsreports.

321 Creating database configuration file /usr/share/ocsinventory-


reports/ocsreports/dbconfig.inc.php.
322
Creating IPDiscover directory /var/lib/ocsinventory-reports/ipd.
323
Fixing permissions on directory /var/lib/ocsinventory-reports/ipd.
324
Creating packages directory /var/lib/ocsinventory-reports/download.
325
Fixing permissions on directory /var/lib/ocsinventory-reports/download.
326
Creating snmp mibs directory /var/lib/ocsinventory-reports/snmp.
327
Fixing permissions on directory /var/lib/ocsinventory-reports/snmp.
328
Creating Administration server log files directory /var/lib/ocsinventory-reports/logs.
329
Fixing permissions on directory /var/lib/ocsinventory-reports/logs.
330
Creating Administration server scripts log files directory /var/lib/ocsinventory-
331
reports/scripts.
332
Fixing permissions on directory /var/lib/ocsinventory-reports/scripts.
333
Configuring IPDISCOVER-UTIL Perl script.
334
Installing IPDISCOVER-UTIL Perl script.
335
Fixing permissions on IPDISCOVER-UTIL Perl script.
336
Writing Administration server configuration to file /etc/apache2/conf-
337 available/ocsinventory-reports.conf

338

339 +----------------------------------------------------------------------+

340 | OK, Administration server installation finished ;-) |

341 | |
342 | Please, review /etc/apache2/conf-available/ocsinventory-reports.conf

343 | to ensure all is good and restart Apache daemon. |

344 | |

345 | Then, point your browser to http://server//ocsreports

346 | to configure database server and create/update schema. |

347 +----------------------------------------------------------------------+

348

349

350 Setup has created a log file /tmp/OCSNG_UNIX_SERVER_2.5/ocs_server_setup.log. Please,


save this file.
351
If you encounter error while running OCS Inventory NG Management server,

we can ask you to show us his content !

DON'T FORGET TO RESTART APACHE DAEMON !

Enjoy OCS Inventory NG ;-)

3.3.- Creación de los links simbólicos

Este va a dar de alta la dirección de la web http://DireccioDeTuServer/ocsreports

sudo ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/sites-


1
enabled/ocsinventory-reports.conf

Este va a dar de alta la dirección donde se recogen los inventarios por parte del servidor
http://DireccioDeTuServer/ocsinventrory
sudo ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/sites-
1
enabled/z-ocsinventory-server.conf

Reiniciamos apache y probados desde un navegador la url : http://DireccioDeTuServer/ocsreports

1 sudo service apache2 restart

3.4.- Ampliar limite máximo de tamaño de archivo

La primera advertencia señala que tenemos un limite de 100MB, esto lo podemos ampliar si es
necesario editando el fichero de configuración ocsinventory-reports.conf
1 sudo vi /etc/apache2/conf-available/ocsinventory-reports.conf

Buscamos y modificamos las lineas, en el ejemplo amplio a 200M

A nosotros nos aplica la configuración php7 pero modificaremos las dos

1 # Uncomment following to force use of HTTPS in Administration Server

2 #SSLRequireSSL

4 # PHP tuning (not working on all distribution, use php.ini instead)

6 AddType application/x-httpd-php .php

7 php_flag file_uploads on

8 # Some PHP tuning for deployment feature up to 8 MB

9 # post_max_size must be greater than upload_max_filesize

10 # because of HTTP headers

11 php_value post_max_size 200m

12 php_value upload_max_filesize 200m

13 # You may have to uncomment following on errors

14 #php_value max_execution_time -1

15 #php_value max_input_time -1

16

17 # Uncomment following if you need to specify a mysql socket

18 #php_value mysql.default_socket "path/to/mysql/unix/socket"

19

20 #!! Mandatory !! : set magic_quotes_gpc to off (to make ocsreports works correctly)

21 php_flag magic_quotes_gpc off

22
23 # Duplicate for php7 compatibility

24

25 AddType application/x-httpd-php .php

26 php_flag file_uploads on

27 # Some PHP tuning for deployment feature up to 8 MB

28 # post_max_size must be greater than upload_max_filesize

29 # because of HTTP headers

30 php_value post_max_size 200m

31 php_value upload_max_filesize 200m

32 # You may have to uncomment following on errors

33 #php_value max_execution_time -1

34 #php_value max_input_time -1

35

36 # Uncomment following if you need to specify a mysql socket

37 #php_value mysql.default_socket "path/to/mysql/unix/socket"

38

39 #!! Mandatory !! : set magic_quotes_gpc to off (to make ocsreports works correctly)

40 php_flag magic_quotes_gpc off

3.5.- Eliminar advertencia de escritura en carpeta: /var/lib/ocsinventory-reports

Var lib dir should be writable : /var/lib/ocsinventory-reports

Para solucionar esto concedemos la propiedad de la carpeta al usuario www-data

1 sudo chown www-data:www-data -R /var/lib/ocsinventory-reports

3.6.- Finalizamos la instalación

Rellenamos los campos necesarios con los datos que hemos creado en el apartado 2.4
Ya podemos acceder con el usuario admin y password admin

3.7.- Eliminar el fichero install.php


SECURITY ALERT!

The install.php exists in ocsreports directory

sudo mv /usr/share/ocsinventory-reports/ocsreports/install.php /usr/share/ocsinventory-


1
reports/ocsreports/install.php_old

3.8.- Modificar el fichero de configuración z-ocsinventory-server.conf para que los inventarios


puedan subir a la base de datos.

De no modificar correctamente este archivo con los datos de conexión a nuestra base de datos, los
inventarios nunca van a subir al servidor.

1 sudo vi /etc/apache2/conf-available/z-ocsinventory-server.conf

1 # Which version of mod_perl we are using

2 # For mod_perl <= 1.999_21, replace 2 by 1 # For mod_perl > 1.999_21, replace 2 by 2

3 PerlSetEnv OCS_MODPERL_VERSION 2

5 # Master Database settings

6 # Replace localhost by hostname or ip of MySQL server for WRITE

7 PerlSetEnv OCS_DB_HOST localhost

8 # Replace 3306 by port where running MySQL server, generally 3306


9 PerlSetEnv OCS_DB_PORT 3306

10 # Name of database

11 PerlSetEnv OCS_DB_NAME ocsweb

12 PerlSetEnv OCS_DB_LOCAL ocsweb

13 # User allowed to connect to database

14 PerlSetEnv OCS_DB_USER ocsuser

15 # Password for user

16 PerlSetVar OCS_DB_PWD ocspassword

Reiniciamos servidor apache

1 sudo service apache2 restart

4.- Instalar agente

Nuevamente des de la web de OCS podemos descargar los diferentes agentes actualizados, en
este caso instalaremos el 2.4.0.0 primero de manera manual y posteriormente en modo
desatendido, muy útil para instalaciones masivas o recurrentes.

Web de descarga del agente: https://www.ocsinventory-ng.org/en/

4.1.- Instalación manual


4.2.- Instalación desatendida

Creamos un fichero .bat en la carpeta del instalador con los parámetros de servidor, ejecutar el
fichero bat tendrá el mismo efecto en el equipo que la instalación que hemos visto en el apartado
4.1

OCS-NG-Windows-Agent-Setup.exe /SERVER=http://192.168.1.113/ocsinventory /TAG= /NOW


1
/S

También podría gustarte