OCSNG+GLPI 資產管理系統安裝配置
環境:
系統 | CentOS Linux release 7.5.1804 (Core) |
核心 | 3.10.0-862.el7.x86_64 |
資料庫 | MySQL5.7 |
PHP | PHP5.6 |
軟體 | OCS server 2.4.1 GLPI 9.2.3 OCS-NG-Windows-Agent 2.3.1 glpi-ocsinventoryng-1.4.3 |
防火牆關一下
一:配置系統環境
1.1:配置YUM擴充套件源
[[email protected] ~]# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/epel-release-latest-7.noarch.rpm
[[email protected] ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
1.2:修改remi.repo 源 (預設安裝為php5.4 修改開啟此PHP5.6 , 新的客戶端最低支援5.6好像)
[[email protected] ~]# vim /etc/yum.repos.d/remi.repo [remi-php56] name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/ #mirrorlist=https://rpms.remirepo.net/enterprise/7/php56/httpsmirror mirrorlist=http://cdn.remirepo.net/enterprise/7/php56/mirror # NOTICE: common dependencies are in "remi-safe" enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
1.3:安裝依懶及LAMP
[[email protected] ~]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
[[email protected] ~]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
[[email protected] ~]# yum install mysql-server -y
[[email protected] ~]# yum install -y httpd php-mysql gcc gcc-c++ glibc-devel glibc-headers autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libXpm libX11 libxml2-devel gettext-devel pcre-devel php php-devel php-gd php-pecl-zip php-devel php-pear php-imap php-ldap php-odbc php-xml php-xmlrpc mod_perl php-mbstring perl mod_perl perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-Apache-DBI perl-Apache2-SOAP php-common perl-XML-Entities perl-Mojolicious
[[email protected] ~]# yum install http://rpmfind.net/linux/remi/enterprise/7/remi/x86_64/perl-Apache2-SOAP-0.73-13.el7.remi.noarch.rpm
[[email protected] ~]# yum -y install https://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/perl-Switch-2.16-7.el7.noarch.rpm
[[email protected] ~]# yum install http://rpmfind.net/linux/remi/enterprise/7/remi/x86_64/perl-Apache-DBI-1.12-1.el7.remi.noarch.rpm
[[email protected] ~]# yum -y install https://mirrors.aliyun.com/epel/7/aarch64/Packages/p/perl-Mojolicious-7.67-1.el7.noarch.rpm
1.4:驗證php版本(GLPI 9.2.3要求,一定要保證是5.6以上版本)
[[email protected] ~]# php -v
PHP 5.6.38 (cli) (built: Sep 12 2018 08:52:18)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
二:安裝OCSNG
2.1:下載並解壓安裝包
[[email protected] ~]# cd /opt/
[[email protected] opt]# wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.4.1/OCSNG_UNIX_SERVER_2.4.1.tar.gz
[[email protected] opt]# tar xvf OCSNG_UNIX_SERVER_2.4.1.tar.gz
2.2:安裝
[[email protected] opt]# cd OCSNG_UNIX_SERVER_2.4.1/
[[email protected] OCSNG_UNIX_SERVER_2.4.1]# ./setup.sh
一路回車即可,如有錯誤請檢查所有Perl模組是否安裝正確
[/usr/share/ocsinventory-reports] ?/var/www/html/ #此處需要手工輸入
最後這個提示說明沒問題了
DON'T FORGET TO RESTART APACHE DAEMON !
Enjoy OCS Inventory NG ;-)
2.3:啟動服務
[[email protected] ~]# chown -R apache. /var/www/html/
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
[[email protected] ~]# systemctl start mysqld
[[email protected] ~]# systemctl enable mysqld
2.4:OCSNG配置
瀏覽器訪問 http://ip/ocsreports 進行安裝配置
輸入mysql使用者名稱root密碼cherry123,如果是本機的mysql,地址是localhost
賬號密碼都是admin
安裝完成後把install.php刪除或重新命名並修改預設密碼,保證其安全性(預設/usr/share/ocsinventory-reports/ocsreports 下,如果安裝時指定則在指定目錄下,就我剛剛上面指定的資料夾)
[[email protected] ~]# cd /var/www/html/ocsreports/
[[email protected]er ocsreports]# mv install.php install.php.bak
三、安裝客戶端 (Windows 和 Linux)
Windows的客戶端: https://github.com/OCSInventory-NG/WindowsAgent/releases/download/2.3.1.1/OCSNG-Windows-Agent-2.3.1.1.zip
下載下來之後解壓安裝,點點點,點到server URL停,換個地址,別的都是點點點,一直到完成。
完成之後,點開剛剛的網頁,就出現了客戶端的電腦。
Linux的話我再開一個部落格,連結在此:https://blog.csdn.net/tiger199/article/details/83185636
四、配置GLPI
4.1:下載解壓安裝包
[[email protected] ocsreports]# cd /opt/
[[email protected] opt]# wget https://github.com/glpi-project/glpi/releases/download/9.2.3/glpi-9.2.3.tgz
[[email protected] opt]# tar xvf glpi-9.2.3.tgz -C /var/www/html/
4.2:更改屬主許可權
[[email protected] opt]# chown -R apache. /var/www/html/glpi/
4.3:配置GLPI 瀏覽器訪問http://serverip/glpi 進行安裝配置
檢測環境完成(確保結果全為綠色,如果有相應警告可忽略或手動安裝),選擇“繼續”
連線資料庫
選擇資料庫,如果之前沒有建立,選擇“建立新資料庫”並定義一個數據庫名,點選“繼續”
然後的東西,一頓猛點就得了
安裝完成後把install.php刪除或重新命名並修改預設密碼,保證其安全性
[[email protected] opt]# cd /var/www/html/glpi/install/
[[email protected] install]# mv install.php install.php.bak
五、配置OCSNG+GLPI協作,配個對。。。
5.1:下載解壓安裝包
[[email protected] install]# cd /opt/
[[email protected] opt]# wget https://github.com/pluginsGLPI/ocsinventoryng/releases/download/1.4.3/glpi-ocsinventoryng-1.4.3.tar.gz
[root[email protected] opt]# tar xvf glpi-ocsinventoryng-1.4.3.tar.gz -C /var/www/html/glpi/plugins/
5.2:設定許可權
[[email protected] opt]# chown -R apache. /var/www/html/glpi/plugins/ocsinventoryng/
5.3:設定GLPI為OCSNG方式
主頁→設定→外掛,安裝OCSNG外掛並啟用
工具→OCSNG,新增OCSNG Server
連線OCSNG資料庫
工具→OCS Inventory NG→Inventory Import→選擇“新增新計算機的匯入”
匯入成功後就可以在資產-電腦中檢視
應該算是完了,還有的話我再補充。。。。