Bsdadmin.ru

Записки администратора FreeBSD

Путь на сайте

Домашняя Программы под FreeBSD Инсталляция и настройка ocsinventory-ng для учета оборудования.

Инсталляция и настройка ocsinventory-ng для учета оборудования.

Пишу по памяти. По-этому возможны небольшие неточности !

MySQL необходимо использовать 4.1 или 5.0.
MySQL 5.1 - использовать нельзя - нет драйвера (по-моему, точно не помню,p5-DBI под MySQL5.1).
 У меня же стоит MySQL-5.0 и apache 2.2 и на них вертятся несколька сервисов, поэтому я буду ставить немного по-другому.Apache в связке с MySQL, PHP и PHP-extension у меня установлены.
Да и база должна быть переведена в InnoDB. (Кто не знает , меняйте в my.cnf).

Сначала доустановим mod_perl2( т.к. apache2)
#cd /usr/ports/www/mod_perl2
#make
#make install

 

  Далее редактируем файл httpd.conf.
#ee /usr/local/etc/apache22/httpd.conf
Добавляем строку:
LoadModule perl_module libexec/apache22/mod_perl.so
Раскомментируем строку, ибо сюда программа добавит конфигурационный файл:
Include etc/apache22/Includes/*.conf
Вручную доустанавливаем XML::Entities из CPAN. Его нет в зависимостях порта,
но программа потребует его установить.
#cpan -i XML::Entities
Ставим ocsinventory-ng
#cd /usr/ports/net-mgmt/ocsinventory-ng/
#make
#make install
# cd /usr/local/share/ocsinventory-ng
Создаем директории для программы:
# mkdir -p /etc/logrotate.d/ocsinventory-NG
# mkdir /usr/local/www/ocsinventory-NG
Запускаем установку.
# sh setup.sh

  Есть и другой вариант: результат тотже:
#cd /usr/ports/net-mgmt/ocsinventory-ng/
# mkdir -p /etc/logrotate.d/ocsinventory-NG
# mkdir /usr/local/www/ocsinventory-NG
#cd work/
#cd OCSNG_UNIX_SERVER-1.02.1/
#./setup.sh

Видим.
+----------------------------------------------------------+| |

 | Welcome to OCS Inventory NG Management server setup ! |

| |+----------------------------------------------------------+

 CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and
previous, please remove any Apache configuration for Communication Server!
Do you wish to continue ([y]/n)?y
Assuming Communication server 1.0 RC2 or previous is not installed
on this computer.
Starting OCS Inventory NG Management server setup from folder /usr/local/share/ocsinventory-ng
Storing log in file /usr/local/share/ocsinventory-ng/ocs_server_setup.log
+----------------------------------------------------------+
| Checking for database server properties... |
+----------------------------------------------------------+

Your MySQL client seems to be part of MySQL version 5.0.
Your computer seems to be running MySQL 4.1 or higher, good ;-)
Which host is running database server [localhost] ?
OK, database server is running on host localhost ;-)
On which port is running database server [3306] ?
OK, database server is running on port 3306 ;-)
+----------------------------------------------------------+

| Checking for Apache web server daemon... |

+----------------------------------------------------------+

Where is Apache daemon binary [/usr/local/sbin/httpd] ?
OK, using Apache daemon /usr/local/sbin/httpd ;-)
+----------------------------------------------------------+

| Checking for Apache main configuration file... |

+----------------------------------------------------------+

 Where is Apache main configuration file [/usr/local/etc/apache/httpd.conf] ?
Вот тут прописываем правильно, учитывая, что у нас Apache2.2 и находится он  в apache22:
OK, using Apache main configuration file /usr/local/etc/apache22/httpd.conf ;-)

 +----------------------------------------------------------+

| Checking for Apache user account... |

+----------------------------------------------------------+

 Which user account is running Apache web server [www] ?
OK, Apache is running under user account www ;-)

 +----------------------------------------------------------+

| Checking for Apache group... |

 +----------------------------------------------------------+
Which user group is running Apache web server [www] ?
OK, Apache is running under users group www ;-)

 +----------------------------------------------------------+

| Checking for PERL Interpreter... |

+----------------------------------------------------------+

Found PERL Intrepreter at </usr/bin/perl> ;-)
Where is PERL Intrepreter binary [/usr/bin/perl] ?
OK, using PERL Intrepreter /usr/bin/perl ;-)
Do you wish to setup Communication server on this computer ([y]/n)?
+----------------------------------------------------------+

| Checking for Make utility... |

+----------------------------------------------------------+

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

 | Checking for Apache Include configuration directory... |

 +----------------------------------------------------------+
Setup has found Apache Include configuration directory in.
If you are not using Include directive, please enter 'no'.
Where is Apache Include configuration directory [] ?/usr/local/etc/apache22/Include/
OK, Apache Include configuration directory /usr/local/etc/apache22/Include/ found ;-)
+----------------------------------------------------------+

 | Checking for Apache mod_perl version... |

 +----------------------------------------------------------+
Checking for Apache mod_perl version 1.99_22 or higher
Checking for Apache mod_perl version 1.99_21 or previous
Found that mod_perl2 version 2.9_21 or previous is available.
OK, Apache is using mod_perl2 version 2.9_21 or previous ;-)

 +----------------------------------------------------------+

| Checking for Communication server log directory... |

+----------------------------------------------------------+

 Communication server can create detailled logs. This logs can be enabled
by setting interger value of LOGLEVEL to 1 in Administration console
menu Configuration.
Where to put Communication server log directory [/var/log/ocsinventory-NG] ?
OK, Communication server will put logs into directory /var/log/ocsinventory-NG ;-)

+----------------------------------------------------------+

| Checking for required Perl Modules... |

 +----------------------------------------------------------+
Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache::DBI PERL module...
Found that PERL module Apache::DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
Found that PERL module Compress::Zlib is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.
Checking for SOAP::Lite PERL module...
Found that PERL module SOAP::Lite is available.
+----------------------------------------------------------+
| OK, looks good ;-) |

 | |

| Configuring Communication server Perl modules... |

 +----------------------------------------------------------+
WARNING: INSTALLSITESCRIPT is not a known parameter.
Checking if your kit is complete...
Looks good
'INSTALLSITESCRIPT' is not a known MakeMaker parameter name.
Writing Makefile for Apache::Ocsinventory
+----------------------------------------------------------+
| OK, looks good ;-) |

 | Preparing Communication server Perl modules... |

+----------------------------------------------------------+

+----------------------------------------------------------+

| OK, prepare finshed ;-) |

| Installing Communication server Perl modules... |

+----------------------------------------------------------+

+----------------------------------------------------------+

| OK, Communication server Perl modules install finished;-)|
| Creating Communication server log directory... |
+----------------------------------------------------------+
Creating Communication server log directory /var/log/ocsinventory-NG.
Fixing Communication server log directory files permissions.
Configuring logrotate for Communication server.
Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-NG
+----------------------------------------------------------+ъ
| OK, Communication server log directory created ;-) |
| Now configuring Apache web server... |

+----------------------------------------------------------+
Writing communication server configuration to file /usr/local/etc/apache22/Include/ocsinventory.conf

 +----------------------------------------------------------+

 | OK, Communication server setup sucessfully finished ;-)
| Please, review /usr/local/etc/apache22/Include/ocsinventory.conf
| to ensure all is good. Then restart Apache daemon.
+----------------------------------------------------------+

просят просмотреть файл ocsinventory.conf.
Do you wish to setup Administration server (web administration console)
on this computer ([y]/n)?
+----------------------------------------------------------+

| Checking for Apache root document directory... |

+----------------------------------------------------------+

Where is Apache root document directory [/usr/local/www/data] ?/usr/local/www/data/ocsinventory-NG
OK, Apache root document directory is /usr/local/www/ocsinventory-NG ;-)
+----------------------------------------------------------+

| Checking for required Perl Modules... |

+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.

+----------------------------------------------------------+

| Installing files for Administration server... |

+----------------------------------------------------------+

Creating directory /usr/local/www/ocsinventory-NG/download.
Creating directory /usr/local/www/ocsinventory-NG/ocsreports.
Copying files to /usr/local/www/ocsinventory-NG/ocsreports.
Fixing directories and files permissions.
Configuring IPDISCOVER-UTIL Perl script.
Installing IPDISCOVER-UTIL Perl script.
Fixing permissions on IPDISCOVER-UTIL Perl script.
+----------------------------------------------------------+

 | OK, Administration server installation finished ;-) |

| Point your browser to http://server/ocsreports to |

| configure database server and create/update schema. |

+----------------------------------------------------------+

 Setup has created a log file /usr/local/share/ocsinventory-ng/ocs_server_setup.log. Please, save this file.
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 ;-)
По вежливой просьбе мы перезапускаем APACHE т.к. OCS уже сам создал конфиг в директории    APACHE22. Необходимо добавить алиас в httpd.conf, если OCS не захотел нормально по предложенной схеме (http://server/ocsreports) стартовать. Однако рекомендую править /usr/local/etc/apache22/Include/ocsinventory.conf. По-моему там, по умолчанию, неправильно указаны опции директории, т.е:
<Directory /usr/local/www/ocsinventory-NG/ocsreports/>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Если же не хотите заморачиваться , создайте alias в httpd.conf:
# ocsinventory-NG
Alias /ocsreports "/usr/local/www/ocsinventory-NG/ocsreports/"
<Directory /usr/local/www/ocsinventory-NG/ocsreports/>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Теперь перезапускаем APACHE:
#apachectl restart
Некоторые пакеты, распространяемые при помощи OCSNG, могут иметь размер
больше 8 Мб, поэтому установим большее значение переменных post_max_size и upload_max_filesize в файле php.ini. Эти же установки следует изменить в ocsinventory-reports.conf:
php_value post_max_size 10m
php_value upload_max_filesize 10m

  Проверьте есть ли пароль у root MySQL. Если нет назначим.
# mysqladmin -u root password newpasswd
Набираем в браузере http://localhost/ocsreports/install.php и в появившемся окне
вводим логин и пароль для доступа к MySQL. По умолчанию в процессе
установки для доступа к базе ocsweb будет создана учетная запись “ocs” с паролем “ocs”.

Шаг 1

OCS inventory Installation

OCS Inventory Installation

 WARNING: You will not be able to build any auto deployment package with size greater than 8M.
You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.
MySql login : root
MySql password : newpasswd
MySql HostName : localhost

Шаг 2 

OCS inventory Installation2

 

OCS Inventory Installation

 WARNING: You will not be able to build any auto deployment package with size greater than 8M.

You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.

MySql config file successfully written

Please wait, database update may take up to 30 minutes...................................................................................................................................................................

Database successfully generated

Database engine checking........................

ERROR: InnoDB conversion failed, install InnoDB mysql engine support on your server

or you will experience severe performance issues.

(Try to uncomment "#skip-innodb" in your mysql config file.)

Reinstall when corrected.

ERROR: HEAP conversion failed, install HEAP mysql engine support on your server

or you will experience severe performance issues.

Database engine successfully updated (21 table(s) altered)

WARNING: files/ocsagent.exe missing, if you do not reinstall the DEPLOY feature won't be available

Table 'files' was empty

No subnet.csv file to import

Network netid computing. Please wait...

Network netid was computed=> 0 successful, 0 were already computed, 0 were not computable

Netmap netid computing. Please wait...

Netmap netid was computed=> 0 successful, 0 were already computed, 0 were not computable

Cleaning orphans.....................

0 orphan lines deleted

Cleaning netmap...

0 netmap lines deleted

Please enter the label of the windows client tag input box:

(Leave empty if you don't want a popup to be shown on each agent launch).

Введем название и нажмем кнопку "Отправить"

OCS Inventory Installation

WARNING: You will not be able to build any auto deployment package with size greater than 8M.

You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.

Label added

 Installation finished you can log in index.php with login=admin and pass=admin
Click here to enter OCS-NG GUI

Не забывая нажать на Российский флаг, вводим
Логин  по умолчанию - admin
пароль по умолчанию - admin

  OCS-NG GUI

И наблюдаем следующее:
OCS-NG GUI

Подключаем клиентов.
Скачиваем модуль клиента с OCS Inventory NG Agents http://www.ocsinventory-ng.org.
Распаковываем и ставим.

OCS Inventory NG Agents

Не забываем прописать адрес сервера OCS Inventory и порт 80.

Домашняя Программы под FreeBSD Инсталляция и настройка ocsinventory-ng для учета оборудования.