You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2009-11-23 18:42:03

jghake
Member
Registered: 2009-10-22
Posts: 3

Create rule to set Location

I have GLPI Set up with OCS Inventory and I was wondering if there was a way to get either system to automatically change the "Location" of each PC based on IP.

I have looked around in the Rules but dont see a way to do this. Is it possible?

I found the administrative Data and it looks like I might be able to use that. I will post in the OCS Inventory Forums also.

Last edited by jghake (2009-11-23 18:56:43)


GLPI 0.72.3 on IIS, Server 2003 Std SP2, PHP 5.3.1, MySQL 5.5

Offline

#2 2009-11-23 19:42:35

bwm367
Member
From: Maine, United States
Registered: 2009-01-06
Posts: 217
Website

Re: Create rule to set Location

Let us know what you find, I've been looking to do this also.


My Configuration: GLPI .72.3 running on XAMPP from a VMware Virtual Machine (Windows XP). PHP 5.2, Apache 2.2.3...

Offline

#3 2009-11-23 19:55:31

jghake
Member
Registered: 2009-10-22
Posts: 3

Re: Create rule to set Location

My post over at OCS can be viewed here:

http://forums.ocsinventory-ng.org/viewtopic.php?id=5255


GLPI 0.72.3 on IIS, Server 2003 Std SP2, PHP 5.3.1, MySQL 5.5

Offline

#4 2009-11-25 19:36:57

jghake
Member
Registered: 2009-10-22
Posts: 3

Re: Create rule to set Location

I was able to get this working! It isn't automatic (I may look at making it so in the future) all the details can be found here:

http://forums.devshed.com/mysql-help-4/ … 56355.html

I created a new Administrative Info within OCS (click on the two pages on the top right and name it Location)

Then basically I created a CSV file with:

Site Name*10.10.1.0*
Site Name 2*10.10.2.0*

Created a table in SQL to hold my Locations, imported the csv into SQL using the command:

LOAD DATA INFILE 'c:\\sites.csv' INTO TABLE locations FIELDS terminated BY '*' LINES terminated BY '\n' (name, ip, netmask);

Then I ran the following to update all computer records with the corresponding Site in my new locations table:

UPDATE networks n, accountinfo a, locations l
SET a.Location = l.name
WHERE n.IPSUBNET = l.ip
AND n.HARDWARE_ID = a.HARDWARE_ID


I hope this helps somebody.


GLPI 0.72.3 on IIS, Server 2003 Std SP2, PHP 5.3.1, MySQL 5.5

Offline

Board footer

Powered by FluxBB