Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0Beta

Forum dédié à la distribution du même nom et que vous pourrez télécharger sur http://www.contribs.org. La nouvelle version de cette distribution se nomme SME Server

Modérateur: modos Ixus

Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0Beta

Messagepar Cool34000 » 28 Sep 2009 19:19

Bonjour Ixus,

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 ! 8)
Dernière édition par Cool34000 le 13 Oct 2009 19:35, édité 1 fois au total.
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Un grand BRAVO mais...1 ptit détail

Messagepar gilgalad » 09 Oct 2009 19:12

Bravo!
superbe tuto, clair net et précis!
celà augure d'un nouveau smeserver-inventory rpm pour la version 8!
Cependant, je tiens à signaler un petit bug: celà tiens aux évolutions de GLPI depuis la 0.68: en effet il semblerait que le code ait changé dans la fonction uploadDocument depuis cette version, ce qui a pour effet d'empecher l'upload de fichiers quand on veut ajouter un fichier a une référence de document ( potential upload attack, ou plutot message $LANG('document'[27]).
Ma première réaction à été de chercher un problème de droits (chmod -R 777, oui je sais c'est mal! mais c'est pas en prod et on cherche un bug alors...) mais manifestement, ca ne semble pas venir de là.
Alors? pour l'instant je sais pas, je crois que je vais chercher du côté des variables d'environnement php!
Si quelqu'un trouve avant... merci d'avance
:wink:
gilgalad
Matelot
Matelot
 
Messages: 5
Inscrit le: 09 Oct 2009 19:02
Localisation: jura

Messagepar Cool34000 » 09 Oct 2009 22:29

Salut,

Je commencerais par ajouter l'accès à /tmp dans le template pour Apache...
Code: Tout sélectionner
php_admin_value open_basedir /usr/share/ocsinventory-reports/glpi/:/tmp


Si tu peux confirmer que ca marche :wink:
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Test effectué avec succes

Messagepar gilgalad » 13 Oct 2009 10:14

Bonjour ixus

Bravo, ca marche

donc pour résumer:
dans le fichier /etc/e-smith/templates/etc/httpd/conf/httpd.conf/98glpi
il faut bien ajouter /tmp à la ligne php_admin_value open_basedir /usr/share/ocsinventory-reports/glpi/

ce qui nous donne la ligne:
php_admin_value open_basedir /usr/share/ocsinventory-reports/glpi/ :/tmp

ou bien le contenu du fichier suivant:
#--------------------------------------------------------------
# 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>
#--------------------------------------------------------------

Bon ben encore bravo et merci a toi Cool3400 !
gilgalad
Matelot
Matelot
 
Messages: 5
Inscrit le: 09 Oct 2009 19:02
Localisation: jura

Messagepar Cool34000 » 13 Oct 2009 19:37

Salut,

Merci pour ta confirmation, j'ai modifié mon 1er post : ca évitera aux éventuels distraits de reposer la question :wink:
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Super

Messagepar pheslot » 06 Nov 2009 17:38

Salut,

Juste pour info, je viens de me faire une install sur une machine virtuelle avec SME 8bêta4 et ta procédure. Tout simplement nickel :D
pheslot
Matelot
Matelot
 
Messages: 1
Inscrit le: 06 Nov 2009 17:20

Genial

Messagepar Wali59 » 18 Nov 2009 13:30

Super tuto, tout simplement génial

Nouvelle install sur SME 8.0

J'ai simplement du ajouter à la première etape:

wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm

GLPI fonctionne sans problemes
OCSinventory, je ne l'utilise pas encore (je vais me documenter avant).

Encore merci
Wali59
Matelot
Matelot
 
Messages: 1
Inscrit le: 17 Août 2009 10:43

Messagepar Cool34000 » 21 Nov 2009 12:49

Salut,

Wali59 a écrit:J'ai simplement du ajouter à la première etape:

wget http://apt.sw.be/redhat/el5/en/i386/rpm ... noarch.rpm

Tiens, bizarre !
Plus dispo chez Contribs ?
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar peremanu » 19 Fév 2011 16:22

Bonjour,

merci pour ce tuto
mais je comprend pas j'ai installé ocs 1.02.3 ,ya t-il une différence car je n'arrive pas à importer
ma machine windows 7! quelqu un aurai t il une idée?je n'ai pas installé glpi encore mais normalement ça change rien
je suis un peu bloqué si quelqu un avai une idée
merci
peremanu
Quartier Maître
Quartier Maître
 
Messages: 11
Inscrit le: 19 Fév 2011 16:17

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar Cool34000 » 19 Fév 2011 17:23

Salut,

Effectivement, tu n'as pas besoin de GLPI !

Quel client utilises-tu pour inventorier ton poste en Win7 ?
Perso, j'utilise la vesion 4.0.5.4 qui marche très bien sous Win7 32 bits...


A+
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar peremanu » 19 Fév 2011 17:37

j'utilise la 4.0.6.1 et d'habitude elle fonctionne très bien peut être aije fai une erreur dans l'install
mais je pense que si ocs se lance ce que tous ce bien déroulé la je bloque
peremanu
Quartier Maître
Quartier Maître
 
Messages: 11
Inscrit le: 19 Fév 2011 16:17

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar Cool34000 » 19 Fév 2011 18:05

Re...

Regarde du coté des journaux de ton client OCS... (si installé en tant que service : C:\Program Files\OCS Inventory Agent\NOM_DU_PC.log ou racine de C: si lancé manuellement)
Tu peux aussi lancer un inventaire en ligne de commande... Parfois ça aide !
Avatar de l’utilisateur
Cool34000
Contre-Amiral
Contre-Amiral
 
Messages: 480
Inscrit le: 10 Sep 2006 10:45
Localisation: Nimes, France

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar peremanu » 19 Fév 2011 18:12

re

j' ai regardé le fichier log voici ce fichier:

OCS INVENTORY ver. 4061 Starting session for Device <CORE2> on Saturday, February 19, 2011 17:11:27...
Command line parameters: <</SERVER:192.168.0.5 /PNUM:80 /NP /DEBUG>>

HTTP SERVER: Connection WITHOUT proxy
WMI Connect: Trying to connect to WMI namespace root\cimv2 on device <Localhost>...OK.
Registry Connect: Trying to connect to HKEY_LOCAL_MACHINE on device <Localhost>...OK.
CHECKINGS: read <CORE2-2011-02-19-13-55-44> and <00:1D:60:3A:48:B408:00:27:00:40:D2> in ocsinventory.dat
IpHlpAPI GetNetworkAdapters...
IpHlpAPI GetNetworkAdapters: Calling GetIfTable to determine network adapter properties...OK
IpHlpAPI GetNetworkAdapters: Calling GetAdapterInfo to determine IP Infos...OK
IpHlpAPI GetNetworkAdapters: OK (2 objects).
CHECKINGS: write <CORE2-2011-02-19-13-55-44> and <00:1D:60:3A:48:B408:00:27:00:40:D2> in ocsinventory.dat
HTTP SERVER: Creating CInternetSession to get inventory parameters...OK.
HTTP SERVER: Getting HTTP Connection to server 192.168.0.5 port 80 using no authentication...OK.
HTTP SERVER: Sending prolog query...ERROR: HTERROR: HTTP status code 404
HTTP SERVER: Closing HTTP connection
WMI Disconnect: Disconnected from WMI namespace.
Writing last inventory state not required.
Execution duration: 00:00:04.

j'y comprend pas grand chose ^^
peremanu
Quartier Maître
Quartier Maître
 
Messages: 11
Inscrit le: 19 Fév 2011 16:17

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar peremanu » 19 Fév 2011 19:12

re
Apparemment j'ai une erreur 404, peut être que j'ai fai une erreur dans le tuto dans httpd.conf quelqu un serai t il comment editer un fichier dans smeserver car quand je passe en sftp le fichier est presque illisible!

merci
peremanu
Quartier Maître
Quartier Maître
 
Messages: 11
Inscrit le: 19 Fév 2011 16:17

Re: Tester OCS Inventory 1.02.1 et GLPI 0.72.21 sur SME 8.0B

Messagepar peremanu » 19 Fév 2011 19:26

bon je vai refaire le tuto peut être quelqu un aurai pu me dire à quel endroit du tuto sa aurai pu clocher
histoire que je refasse pas la même erreur svp
merci
peremanu
Quartier Maître
Quartier Maître
 
Messages: 11
Inscrit le: 19 Fév 2011 16:17

Suivant

Retour vers E-Smith / SME Server

Qui est en ligne ?

Utilisateur(s) parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité

cron