作業系統 : Centos 7
- 前置作業
- 關閉 selinux :
- vi /etc/selinux/config
- 關閉防火牆 :
- systemctl stop firewalld.service、systemctl disable firewalld.service
- 更新系統:
- yum update
- 關閉 selinux :
- 安裝Mariadb資料庫
- rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
- yum install mod_perl php-pclzip
- yum -y install mariadb-server mariadb
- systemctl start mariadb.service
- systemctl enable mariadb.servic
- mysql -u root -p
- DELETE FROM USER;
- GRANT ALL PRIVILEGES ON *.* TO ‘dbadmin’@’127.0.0.1’ IDENTIFIED BY ‘1234567890’ WITH GRANT OPTION;
- FLUSH PRIVILEGES;
- 安裝及更新php
- rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- yum install -y php php-pclzip
- yum repolist all
- yum search yum-config-manager
- yum install -y yum-utils
- yum-config-manager –enable remi
- yum-config-manager –enable remi-php71
- yum update -y php*
- 安裝相關套件
- yum install -y make gcc httpd php-mbstring php-gd php-xml php-pecl-memcached php-mysql php-soap perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-SOAP-Lite perl-Digest-SHA1 perl-Test-Simple httpd-devel
- systemctl enable httpd
- systemctl start httpd
- 安裝perl套件
- yum install -y mod_perl perl-CPAN perl-Archive-Zip perl-Net-IP perl-XML-Simple perl-SOAP-Lite.noarch perl-ExtUtils-Embed perl-XML-Entities
- yum install -y perl-XML-SAX perl-Apache-DBI perl-Apache2-SOAP
- cpan
- install YAML
- install ModPerl::MM
- install Apache2::SOAP
- install Apache::DBI
- exit
- 安裝OCS 2.3.1
- wget https://github.com/OCSInventory-NG/OCSInventory-Server/archive/2.3.1.tar.gz
- tar -zxvf 2.3.1.tar.gz
- cd OCSInventory-Server-2.3.1/
- ./setup.sh
- 創建OCS資料庫
- create database ocsweb;
- GRANT ALL PRIVILEGES ON ocsweb.* TO ‘ocs’@’127.0.0.1’ IDENTIFIED BY ‘ocs’;
- GRANT ALL PRIVILEGES ON ocsweb.* TO ‘ocs’@’localhost’ IDENTIFIED BY ‘ocs’;
- FLUSH PRIVILEGES;
- 開啟瀏覽器 http://Server-IP/ocsreports/
- 輸入上步驟所創建的OCS資料庫資訊
- 警告訊息
- 安裝中文語系
- tar -zxvf ocsreports_chinese.tgz
- mv lang_config.txt tchinese /usr/share/ocsinventory-reports/ocsreports/plugins/languag
- 警告訊息
- 安裝Glpi
- tar -zxvf 9.2.1.tgz
- mv glpi /var/www/html/
- chown -R apache:apache /var/www/html
- 開啟瀏覽器 http://Server-IP/glpi/
- 登入後,出現警告訊息
- mv /var/www/html/glpi/install/install.php /var/www/html/glpi/install/install.php.bak
- 重啟服務及整理網頁
- 配對OCSNG和GLPI,開啟OCSNG的刪除記錄功能(TRACE_DELETED)
- GLPI需要OCSNG的插件,注意的是看插件的GLPI版本是否和安裝的是一致的
- wget https://github.com/pluginsGLPI/ocsinventoryng/releases/download/1.4.2/glpi-ocsinventoryng-1.4.2.tar
- mv ocsinventoryng /var/www/html/glpi/plugins/
- 在GLPI的設置—>插件中,安裝並開啟這個插件
- 在工具中選中插件,配置OCSNG資料庫
- 導入OCSNG的數據
- Client安裝agent
- 開啟OCSNG
- 開啟GLPI,手動添加
- 查看資產