OCSNG
首先给大家介绍下OCSNG,最初接触这个系统是在Eisai。当初没觉得这系统有啥好用的,因为资产管理的工作也不都归我管,我只感觉用这个系统辅助找丢失的电脑还不错。来到RFS后整个这一摊子事全管后才发现这系统确实不错。用到现在我总结功能如下:
- 每日自动盘点安装有agent的IT资产,列出资产总数,今日上线数,今日资产信息更新数。
- 资产台帐,列出软硬件详细信息。
- TAG分类,安装agent时可根据资产属性自定义TAG,在台帐页面中一目了然。
- 硬件报表,使管理员简单明了得了解PC资产的性能,指定报废更新计划。
- OS报表,使管理员简单明了得了解公司内的OS版本,排除低版本OS风险。
- 软件报表,在某些公司内有大用,可监控各员工是否有私自安装IT制度禁用的软件。
以上是我使用到现在用到的功能,还有些我没用过的功能有待各位自己发觉。下面给大家介绍下具体安装方法。
其实OCSNG有windows端的服务端,而且是一键傻瓜式安装,但我安装完后server和agent始终无法通信,也懒得去研究了,所以心一横就在centos上装了个,应该也会比windows端稳定很多。
环境:Vmware workstation&Centos7.3
软件版本:OCSNG2.3.1
首先安装Centos7.3,这就不赘述了。
- 关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
- 关闭防火墙的开机自启
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
- 替换防火墙参数
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
- 查看防火墙状态
[root@localhost ~]# grep SELINUX=disabled /etc/selinux/config
SELINUX=disabled
- 关闭当前防火墙
[root@localhost ~]# setenforce 0
- 安装vim和wget
[root@localhost ~]# yum install openssh vim wget -y
- 系统更新(需要几分钟时间)
[root@localhost ~]# yum update
- 升级epel包
[root@localhost ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- 升级webtatic包
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
- 安装以上两个包
[root@localhost ~]# yum install mod_perl php-pclzip
- 安装mariadb数据库
[root@localhost ~]# yum -y install mariadb-server mariadb
- 启动数据库
[root@localhost ~]# systemctl start mariadb.service
- 配置数据库开机自启
[root@localhost ~]# systemctl enable mariadb.service
- 设置数据库密码第一个直接按回车,后面会提示让你设置数据库用户root的密码
[root@localhost ~]# /usr/bin/mysql_secure_installation
- 升级remi包
[root@localhost ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- 更新PHP
[root@localhost ~]# yum repolist all
[root@localhost ~]# yum search yum-config-manager
[root@localhost ~]# yum install yum-utils
[root@localhost ~]# yum-config-manager --enable remi
[root@localhost ~]# yum-config-manager --enable remi-php71
[root@localhost ~]# yum update php*
- 继续安装各种包
[root@localhost ~]# yum install php-mbstring php-gd php-xml php-pecl-memcached php-mysql php-soap -y
[root@localhost ~]# yum -y install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-SOAP-Lite mod_perl perl-Digest-SHA1 perl-Test-Simple
- 设置httpd开机自启
[root@localhost ~]# systemctl enable httpd
- 启动httpd
[root@localhost ~]# systemctl start httpd
- 安装perl相关包
[root@localhost ~]# yum install mod_perl perl-CPAN perl-Archive-Zip perl-Net-IP perl-XML-Simple perl-SOAP-Lite.noarch perl-ExtUtils-Embed perl-XML-Entities
[root@localhost ~]# yum install perl-XML-SAX perl-Apache-DBI perl-Apache2-SOAP
[root@localhost ~]# yum install httpd-devel
[root@localhost ~]# cpan
[local::lib] sudo
cpan[1]> install YAML
cpan[2]> install ModPerl::MM
cpan[3]> install Apache2::SOAP
cpan[4]> >install Apache::DBI
cpan[5]> exit
- 安装git
[root@localhost ~]# yum install git
[root@localhost home]# cd /home/ocsng
[root@localhost ocsng]# git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git OCSInventory-Server
[root@localhost ocsng]# cd OCSInventory-Server
[root@localhost OCSInventory-Server]# git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git ocsreports
- 安装OCSInventory
[root@localhost OCSInventory-Server]# ./setup.sh
- 一路回车即可,只在以下一处需手动指定路径
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?/var/www/html/
- 重启Apache
service httpd restart
- 至此服务器端安装基本完成,可在浏览器上打开该地址进行web配置:http://ocsserverIP/ocsreports/ (ocsserverIP为你的服务器IP地址)
进入页面需要配置四项:
Mysql login:root (你也可以单独配置一个mysql用户名,我比较懒就用root了)
Mysql password: (根据你自定义的密码填)
Name of database : ocsweb (这个是ocs数据库名称,会被自动创建)
Mysql Hostname:localhost
点击send后刷新网页即可登录(默认用户名密码都是admin),页面如下:
image.png
中间的两项告警可无视。