@Wayne-Workman I did end up figuring it out. It turns out that our data had left over data from a previous export/import. So that’s why not all of our entries in the both tables had corresponding entry’s while some did.
Posts made by ToxicFlyman
-
RE: Retrieving host inventory information directly from FOG Database
-
RE: Retrieving host inventory information directly from FOG Database
@Tom-Elliott Okay. I think I’ve figured out the problem. Some hosts had entries in the inventory but some did not. Some inventory entry’s had a corresponding host entry and some did not. That’s what was so confusing. Apparently when we first created our fog server we had some problems and had to export our DB and import it into a new fog install. The problem was when we started again we registered a lot of pcs again and fog left some of the unused inventory and host entries in the database. I’m not sure if that makes sense of if you’ve seen that before but we know what to do now. The hostID and IhostID fields were linked together in the end(except for the unused entries). Thank you for all the help.
-
RE: Retrieving host inventory information directly from FOG Database
@Tom-Elliott Alright. That makes sense. I understand that those fields are relating them together. I’m still not seeing how they’re tied together in my console though. When I look in the hosts table and check hostID: 80(for example). IhostID in inventory doesn’t match up with(or just isn’t there) the hostID(or mac address tied to the hostID). Are those fields normally suppose to be the same if they are related? When I’ve made a few relational databases in access and the fields had the same values between tables to keep things in order. Hopefully all of that made sense.
-
RE: Retrieving host inventory information directly from FOG Database
@Tom-Elliott On my hosts table I don’t see a <tablerelationHostID>(or any other table). I am looking the at DB through phpMyAdmin if that helps at all. I can see a hostID field that is labeled as a primary key but I can’t see it being linked anywhere. How can I see the relations betwee them?
-
RE: Retrieving host inventory information directly from FOG Database
@Tom-Elliott We are running fog 1.2.0. Does that version have that field connecting them?
-
RE: Retrieving host inventory information directly from FOG Database
@Wayne-Workman The hostMAC table fields are hmID, hmHostID, hm MAC, hmDesc. The hosts table fields are hostID, hostName, hostDesc, hostIP, hostImage, hostBuilding, hostCreateDate, hostLastDeploy, hostCreateBy, hostMAC, hostUseAD, hostADDomain, hostADOU, hostADUser, hostADPass, hostProductKey, hostPrinterLevel, hostKernalArgs, hostKernel, hostDevice
-
RE: Retrieving host inventory information directly from FOG Database
@Wayne-Workman We are currently running fog version 1.2.0
-
Retrieving host inventory information directly from FOG Database
I’'m trying to write a script that will update my computer inventory based on fogs database information. The problem is that the hostname/mac address and inventory information are stored in separate tables. I can’t seem to find a way to tie them together because all of the ids in them are different in each table. I have tried sifting through the php code that fog uses to find out how it identifies and joins that information together(like for making tasks or displaying all host info on the webpage). Does anyone know how I could query the database and get the info for both tables to match together to I can group hosts with their inventory information?