概述

iTop

iTop是使用PHP编写的开源ITSM系统,其名称为IT运营门户(IT Operation Portal)的简称,素以贴合ITSL理论而著名。它的老家在意大利。

OCSInverntoryNG

OCSinventoyNG 使用perl编写的开源资产管理软件,它通过agent上报相关信息来获取部署范围内的Windows、Unix、MacOS、andriod等资产信息。

GLPI

GLPI是一款由法国人开发的开源CMDB软件,GLPI是法语Gestionnaire libre de parc informatique的缩写,它使用PHP开发。

系统部署

基础设施

# 系统更新
dnf install -y epel-release dnf-utils
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf config-manager --set-enabled powertools
dnf makecache 
dnf update -y

# 安装依赖
dnf install -y cmake make autoconf gcc gcc-c++ unzip graphviz libzip-devel libzip-tools curl

# 安装PHP7.4
dnf module reset php
dnf module enable php:remi-7.4
dnf install -y php php-curl php-zip php-gd php-soap php-xml php-mbstring php-fpm php-ldap libmcrypt libmcrypt-devel php-pecl-apcu mhash
dnf install -y php-dom php-simplexml php-xmlreader php-curl php-date php-exif php-filter php-ftp php-gd php-hash php-iconv php-json php-libxml php-mbstring php-mysqlnd php-openssl php-pcre php-posix php-sockets php-spl php-tokenizer php-zlib
dnf install -y php-xmlrpc php-gd php-opcache php-mysqlnd php-json php-devel php-odbc php-mbstring php-snmp php-intl

# 安装Apache和MySQL
yum install -y mariadb mariadb-server

yum install -y httpd
systemctl enable httpd php-fpm mariadb --now

firewall-cmd --permanent --add-service={https,http}
firewall-cmd --reload

# PHP支持ZIP
vim /etc/php.ini
~~~~~~
269 zlib.output_compression = On
……
923 date.timezone = Asia/Shanghai
~~~~~~

# mysql安全强化
mysql_secure_installation

iTop部署

# 下载网站文件
wget https://udomain.dl.sourceforge.net/project/itop/itop/2.7.5-1/iTop-2.7.5-1-7770.zip
unzip iTop-2.7.5-1-7770.zip
cp web/* /var/www/html/ -R
chown -R apache:apache /var/www/html/

# 配置数据库
mysql -uroot -p
MariaDB [(none)]> create database itop character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on itop.* to itop@'localhost' identified by 'itop';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

OCSInventoryNG部署

# 依赖文件
dnf install -y perl-Archive-Zip perl-Compress-Zlib perl-DBD-MySQL perl-DBI perl-Mojolicious perl-Net-IP perl-Plack perl-SOAP-Lite perl-Switch perl-XML-Entities perl-XML-Simple perl-Apache-DBI perl-Digest-SHA1 perl-Apache2-SOAP

# 配置数据库
MariaDB [(none)]> create database ocsng character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on ocsng.* to ocsadmin@'localhost' identified by 'ocsadmin';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

# 下载和安装
cd /opt
git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git
cd OCSInventory-Server
git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git ocsreports
sh setup.sh
……
# 默认回车,完成安装
……
+----------------------------------------------------------------------+
|        OK, Administration server installation finished ;-)           |
|                                                                      |
| Please, review /etc/httpd/conf.d/ocsinventory-reports.conf
|          to ensure all is good and restart Apache daemon.            |
|                                                                      |
| Then, point your browser to http://server//ocsreports
|        to configure database server and create/update schema.        |
+----------------------------------------------------------------------+

Setup has created a log file /opt/OCSInventory-Server/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 its content !

DON'T FORGET TO RESTART APACHE DAEMON !

Enjoy OCS Inventory NG ;-)
……

# 修改站点文件
vim /usr/share/ocsinventory-reports/ocsreports/require/header.php
# 对31行注释
require_once(COMPOSER_AUTOLOAD)

# 500错误修改
# 因为用户名、数据库名和密码变更,会引起500内部错误
# 需要同步修改以下文件:
# z-ocsinventory-server.conf  
# zz-ocsinventory-restapi.conf
# 完成网页安装后删除install文件
rm -f /usr/share/ocsinventory-reports/ocsreports/install.php

# 部署客户端
# 客户端需要开启epel源
dnf install -y perl-Net-SNMP
rpm -Uvh https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el8.ocs.noarch.rpm
dnf makecache
dnf install ocsinventory-agent -y

# 修改配置
sed -i 's/local/# local/g' /etc/ocsinventory/ocsinventory-agent.cfg
sed -i 's/# server/server/g' /etc/ocsinventory/ocsinventory-agent.cfg
sed -i 's\your.ocsserver.name\192.168.79.11/ocsinventory\g' /etc/ocsinventory/ocsinventory-agent.cfg
ocsinventory-agent

# 定时上报
# 使用rpm安装会在/etc/cron.hourly建立上报文件,可按需配置或移动文件到cron.daily目录
echo '60 * * * * /usr/bin/perl /usr/sbin/ocsinventory-agent'>>/etc/crontab

GLPI部署

# 配置数据库
MariaDB [(none)]> create database glpidb character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on glpidb.* to glpiadmin@'localhost' identified by 'glpiadmin';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

# 获取软件包
wget https://github.com/glpi-project/glpi/releases/download/9.5.6/glpi-9.5.6.tgz
tar -zxvf glpi-9.5.6.tgz -C /var/www/html
chown -R apache:apache /var/www/html

WEB_GUI

  1. iTOP
  2. OCSInventoryNG(略)
  3. GLPI(略)