Aujourd'hui, je vous propose un howto consacré à OCS Inventory NG et GLPI...
Howto découpé en 3 étapes, toujours limité à SME 8.x seulement :
####################################################################################
### OCS INVENTORY NG SERVER
####################################################################################
## DEPENDENCIES
mkdir -p /root/OCS_Dep
cd /root/OCS_Dep
yum install perl-XML-Simple --enablerepo=* -y
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... f.i386.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
yum localinstall *.rpm --enablerepo=* -y
## INSTALL
wget http://downloads.sourceforge.net/projec ... or=surfnet
tar -xzf OCSNG_UNIX_SERVER-1.02.1.tar.gz
cd OCSNG_UNIX_SERVER-1.02.1
sh setup.sh
## DURING SETUP, LEAVE ALL BY DEFAULT (ENTER ENTER ENTER ENTER ENTER ENTER ...)
## CREATE MySQL DB & USER
mysqladmin -u root create ocs
mysqladmin -u root create ocsweb
mysql -e " grant all privileges on ocs.* to 'ocs'@'localhost' "
mysql -e " grant all privileges on ocsweb.* to 'ocs'@'localhost' "
mysql -u root -e " SET PASSWORD FOR ocs@localhost = PASSWORD( 'ocs' ) "
mysqladmin flush-privileges
## APACHE CONFIG
mv ocsinventory-reports.conf.local /etc/e-smith/templates/etc/httpd/conf/httpd.conf/98ocs-reports
mv /z-ocsinventory-server.conf /etc/e-smith/templates/etc/httpd/conf/httpd.conf/99ocs-comm_server
rm -f /ocsinventory-reports.conf
sed -i 's/AuthUserFile "APACHE_AUTH_USER_FILE"/# AuthUserFile "APACHE_AUTH_USER_FILE"/g' /etc/e-smith/templates/etc/httpd/conf/httpd.conf/99ocs-comm_server
sed -i 's/# # AuthUserFile "APACHE_AUTH_USER_FILE"/# AuthUserFile "APACHE_AUTH_USER_FILE"/g' /etc/e-smith/templates/etc/httpd/conf/httpd.conf/99ocs-comm_server
/sbin/e-smith/config setprop modPerl status enabled
/sbin/e-smith/config setprop mysqld InnoDB enabled
## APPLY CHANGES
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1
/sbin/e-smith/expand-template /etc/my.cnf
service mysqld restart 2>/dev/null >/dev/null
/sbin/e-smith/signal-event domain-modify
## CLEAN UP
cd /root
rm -rf /root/OCS_Dep
## SETUP
http://yourdomain.com/ocsreports/install.php
####################################################################################
### OCS INVENTORY NG AGENT
####################################################################################
## DEPENDENCIES
mkdir -p /root/OCSAGENT_Dep
cd /root/OCSAGENT_Dep
wget ftp://ftp.pbone.net/mirror/rpms.famille ... noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... f.i386.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm
yum localinstall *.rpm --enablerepo=* -y
## CONFIG
cat > /etc/ocsinventory/ocsinventory-agent.cfg << EOF
#
# OCS Inventory "Unix Unified Agent" Configuration File
#
# options used by cron job overides this (see /etc/sysconfig/ocsinventory-agent)
#
# Server URL, unconmment if needed
# server = your.ocsserver.name
server = 192.168.0.253
# Administrative TAG (optional, must be filed before first inventory)
tag = LAN
# How to log, can be File,Stderr,Syslog
logger = Stderr
logfile = /var/log/ocsinventory-agent/ocsinventory-agent.log
EOF
## LAUNCH 1ST INVENTORY
ocsinventory-agent
## CLEAN UP
cd /root
rm -rf /root/OCSAGENT_Dep
####################################################################################
### GLPI
####################################################################################
## DEPENDENCY
mkdir -p /root/GLPI_Dep
cd /root/GLPI_Dep
wget ftp://mirror.switch.ch/pool/1/mirror/ep ... 5.i386.rpm
yum localinstall *.rpm -y
## INSTALL
cd /usr/share/ocsinventory-reports
wget http://www.glpi-project.org/IMG/gz/glpi-0.72.21.tar.gz
tar -xzf glpi-0.72.21.tar.gz
cd /usr/share/ocsinventory-reports/glpi/plugins
wget https://forge.indepnet.net/attachments/ ... 3.0.tar.gz --no-check-certificate
tar -xzf glpi-massocsimport-1.3.0.tar.gz
chown -R root:www /usr/share/ocsinventory-reports/glpi
chmod -R 775 /usr/share/ocsinventory-reports/glpi/config
chmod -R 775 /usr/share/ocsinventory-reports/glpi/files
## CREATE MySQL DB & USER
mysqladmin -u root create glpi
mysql -e " grant all privileges on glpi.* to 'glpi'@'localhost' "
mysql -u root -e " SET PASSWORD FOR glpi@localhost = PASSWORD( 'glpi' ) "
mysqladmin flush-privileges
## APACHE CONFIG
cat > /etc/php.d/json.ini << EOF
; Enable json extension module
extension=json.so
EOF
cat > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/98glpi << EOF
#--------------------------------------------------------------
# GLPI
#--------------------------------------------------------------
Alias /glpi /usr/share/ocsinventory-reports/glpi
<Directory /usr/share/ocsinventory-reports/glpi>
AddType application/x-httpd-php .php .php3 .phtml
Options None
Options +Indexes
Options +Includes
order deny,allow
deny from all
allow from all
php_admin_value open_basedir /usr/share/ocsinventory-reports/glpi/:/tmp
php_value memory_limit 64M
<Files helpdesk.html>
ForceType text/html;charset=utf-8
</Files>
</Directory>
<Directory /usr/share/ocsinventory-reports/glpi/config>
order deny,allow
deny from all
</Directory>
<Directory /usr/share/ocsinventory-reports/glpi/files>
order deny,allow
deny from all
</Directory>
<Directory /usr/share/ocsinventory-reports/glpi/locales>
order deny,allow
deny from all
</Directory>
<Directory /usr/share/ocsinventory-reports/glpi/install/mysql>
order deny,allow
deny from all
</Directory>
#--------------------------------------------------------------
EOF
## APPLY CHANGES
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1
## CLEAN UP
cd /root
rm -rf /root/GLPI_Dep
rm -f /usr/share/ocsinventory-reports/glpi/plugins/glpi-massocsimport-1.3.0.tar.gz
rm -f /usr/share/ocsinventory-reports/glpi-0.72.21.tar.gz
## SETUP GLPI
http://yourdomain.com/glpi
Enjoy !