设为首页 收藏本站
查看: 1171|回复: 0

[经验分享] IT资产管理解决方案 CentOS+OCS+GLPI-John.Jin的博客

[复制链接]
YunVN网友  发表于 2019-2-16 08:48:46 |阅读模式
  OCS Inventory NG(Open Computer and Software Inventory Next Generation)是一款系统管理软件
  主要功能

  •   Relevant inventory 资产清单管理.
  •   Powerfull deployment system 强大的部署系统,代理程序软件部署方便宜用。.
  •   Web Administration Console 基于Web的管理控制界面.
  •   Multiple operating systems support,多操作系统支持 Microsoft Windows, Linux, *BSD, Sun Solaris, IBM AIX, HP-UX, MacOS X.
  •   Lightweight bandwith usage: 轻量网络带宽使用,Windows系统的全部清单信息大约5 KB .
  •   High performance: 高性能,1 000 000 电脑每天做清单扫描,使用的服务器是bi-Xeon 3 GHz /4 GB RAM.
  •   3-Tier architecture 三层架构设计,支持http/https/xml等协议河标准.
  •   基于有名的开源产品实现, Apache web 服务器, MySQL 数据库服务器, PHP 和 PERL 脚本语言.
  •   Web service 提供 SOAP 接口的Web服务访问.
  •   Plugins support 通过API提供插件支持.
  1. 操作系统为CentOS5.2
  2. OCS Inventory 与GLPI 的web目录放在/var/www/html和/var/www/htmltwo(我建的目录),用chown –R apache:apache 目录,修改上面两个目录的权限。(我遇到问题:后面安装的GLPI无法访问。我的解决办法:分成两个目录后,我用虚拟主机的方式指定相同的IP,不同的端口访问。)
  #vi /etc/httpd/conf/httpd.conf
  添加:
  DocumentRoot /var/www/html/ocsreports
  DocumentRoot /var/www/html/glpi
  Options FollowSymLinks
  AllowOverride None
  Order alow,deny
  Allow from all
  安装准备:定义yum的非官方库
  #vi /etc/yum.repos.d/dag.repo
  [dag]
  Name=Dag RPM Repository for Red Hat Enterprise Linux
  Baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
  Gpgcheck=1
  Enabled=1
  Gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
  网络设置,设置网卡静态IP:
  Ifconfig eth0 192.168.1.7  netmask 255.255.255.0 (即时生效,系统重启后还是会读/etc/sysconfig/network-scripts/ifcfg-eth0)
  DNS 设置: /etc/resolv.conf  网关设置:/etc/sysconfig/network
  配置开发环境:
  #yum install -y 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 mysql mysql-server httpd php php-devel php-gd php-pecl-zip php-mysql php-devel php-pear php-imap php-ldap php-odbc php-xml php-xmlrpc mod_perl
  配置Perl环境
  #yum install –y perl mod_perl
  #yum install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-XML-SAX perl-Apache2-SOAP perl-Apache-DBI
  Perl需要手动安装的模块
  安装SOAP-Lite
  #tar –zxvf SOAP-Lite-0.69.tar.gz
  #cd SOAP-Lite-0.69
  #perl Makefile.PL
  #make
  #make test
  #make install
  安装XML-Entities
  #tar –zxvf XML-Entities-0.0307.tar.gz
  #cd XML-Entities-0.0307
  #perl Makefile.PL
  #make
  #make test
  #make install
  安装Digest-SHA1.2.02
  #tar –zxvf Digest-SHA1.2.02.tar.gz
  #cd Digest-SHA1.2.02
  #perl Makefile.PL
  #make test
  #make
  #make install
  数据库服务和Apache服务
  #service mysqld start     MySQL服务开启
  #service httpd start       Apache服务开启
  #chkconfig mysqld on      MySQL服务设为开机启动
  #chkconfig httpd on       Apache服务设为开机启动
  #vi /etc/httpd/conf/httpd.conf   配置Apache对PHP的支持
  添加如下两行:
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
  定位至:DirectoryIndex index.html
  修改为:DirectoryIndex index.php index.html
  #chown –R apache:apache /var/www/html
  Service httpd restart
  修改MySQL root 密码
  #/usr/bin/mysqladmin –u root password ‘123456’ 数据库管理员用户和密码设置
  iptables 设置     
  #vi /etc/sysconfig/iptables
  -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
  -A RH-Firewall-1-INPUT –m tcp –dport 8080 –j ACCEPT
  #service iptables restart
  安装OCS Inventory
  #tar –zxvf OCSNG_UNIX_SERVER-1.3.2-linvinus-with-utf8_patch.tar.gz
  #cd OCSNG_UNIX_SERVER-1.3.2
  #sh setup.shy
  注意事项:
  Where to copy Administration Server static files for PHP Web Console
  [/usr/share/ocsinventory-reports] ?/var/www/html/ 选择WEB文件存放的路径。
  浏览器地址栏输入:http://serverip/ocsreports/install.php,就可以配置了。
  安装GLPI
  Json和php-mbstring安装
  #yum install php-mbstring
  Wget http://percl.php.net/get/json -o json-1.2.1.tgz
  Tar –xf json-1.2.1.tgz
  Cd json-1.2.1
  Phpize
  ./configure
  Make
  Make install
  Echo “extenson=json.so” >> /etc/php.ini 或vi /etc/php.ini,在最后一行添加:extension=json.so
  Service httpd restart
  测试json是否安装成功
  #php –r ‘var_dump(function_exists(“json_encode”));’
  如果返回信息为bool(true),说明安装成功。
  #tar –zxvf plpi-0.78-RC2.tar.gz
  #cp –a glpi /var/www/html
  #chown –R apache:apache /var/www/html/glpi
  让GLPI支持中文
  0.78版进入glpi安装目录,修改/inc/dbmysql.class.php文件,定位到$this->dbenc 修改”latin1″为”utf8″ 即可
  0.74及以前版本在/inc/ocsng.class.php文件中修改
  配置GLPI
  浏览器输入http://serverip/glpi
  1.环境检测
  2.选择语言
  3.输入数据库帐号
  4.创建新的GLPI数据库
  5.完成
  默认管理员:glpi,密码:glpi
  linux客户端安装配置
  #yum install –y perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-LWP perl-Digest-MD5 PERL-Net-SSLeay perl-Crypt-SSLeay perl-XML-SAX perl-XML-LibXML perl-Proc-Daemon perl-PID-File
  No package perl-LWP available
  No package perl-Digest-MD5 available
  #perl -MCPAN –e ‘install Proc::Daemon’
  #perl-MCPAN –e ‘install Proc::PID::File’
  从镜像点下载下来的包会保存在以下目录
  #ll /root/.cpan/build
  下载:OCSNG_LINUX_AGENT
  #wget http://lwlp.googlecode.com/files/OCSNG_LINUX_agent_1.1.2.tar.gz
  #tar –zxvf OCSNG_LINUX_AGENT_1.1.2.tar.gz –C /opt/src
  #cd /opt/src/OCSNG_LINUX_AGENT_1.1.2
  #cp ipdiscover /usr/sbin/ipdisconver
  #perl Makefile.PL
  #make
  #make install
  以下提示一路回车
  Do you want to configure the agent
  Please enter 'y' or 'n'?> [y]
  Where do you want to write the configuration file?
  0 -> /etc/ocsinventory
  1 -> /usr/local/etc/ocsinventory
  2 -> /etc/ocsinventory-agent
  ?> 2 (选择配置文件存放目录)
  Do you want to create the directory /etc/ocsinventory-agent?
  Please enter 'y' or 'n'?> [y]
  [info] The config file will be written in /etc/ocsinventory/ocsinventory-agent.cfg,
  What is the address of your ocs server?> [ocsinventory-ng] 192.168.50.92(输入ocsinventory-server的ip地址)
  Do you need credential for the server? (You probably don't)
  Please enter 'y' or 'n'?> [n]
  Do you want to apply an administrative tag on this machine
  Please enter 'y' or 'n'?> [y] (该服务器是否使用管理标签)
  tag?> viong (显示在web管理控制界面中)
  ocsinventory agent presents: /usr/bin/ocsinventory-agent
  Where do you want the agent to store its files? (You probably don't need to change it)?> [/var/lib/ocsinventory-agent]
  Do you want to create the /var/lib/ocsinventory-agent directory?
  Please enter 'y' or 'n'?> [y]
  New settings written! Thank you for using OCS Inventory
  Should I remove the old linux_agent
  Please enter 'y' or 'n'?> [n]
  Do you want to use OCS-Inventory software deployment feature?
  Please enter 'y' or 'n'?> [y]
  Do you want to use OCS-Inventory SNMP scans feature?
  Please enter 'y' or 'n'?> [y]
  Do you want to send an inventory of this machine?
  Please enter 'y' or 'n'?> [y]
  [info] Accountinfo file doesn't exist. I create an empty one.
  -> Success!
  看到以上信息,说明安装成功
  [root@localhost Ocsinventory-Agent-2.0rc2]# ocsinventory-agent –debug
  ………………………………………….省略
  [debug] Calling handlers : `end_handler'
  Windows平台,分发OCS客户端
  http://www.renren.it/a/bianchengyuyan/PHP/20110618/75702.html
  设置GLPI用OCSNG方式
  http://www.opboy.com/archives/tag/ocsglpi
  参考:
  1. http://www.centospub.com/make/newenv.html
  2. http://www.opboy.com/archives/tag/ocsglpi
  3. http://viong.blog.运维网.com/844766/503694
  4. http://www.renren.it/a/bianchengyuyan/PHP/20110618/75702.html


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-672934-1-1.html 上篇帖子: centos6.0安装glpi0.78+ocs总结 下篇帖子: CentOS6修改时区、日期、时间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表