Extracting IP addresses from host
-
Hi all,
I see in this post that the IP address of the host was removed from the GUI but remains in the database.
https://forums.fogproject.org/topic/4465/ip-address-fieldI’m wanting to either extract a CSV of the IP and MAC Address of the clients or add the IP addresses back to the host table GUI.
How do I go about achieving this?
TIA
-
@MikeAbbages I am not sure the field for IP address is being populated in the database anymore. As clients will get an IP from the DHCP this is changing every so often anyway. The topic linked is many years old and things have changed a fair bit since. I don’t have access to a server at the moment as I am on travels. You can check your own database or ask @Tom-Elliott or @george1421 to have a look at it.
In general you can export a CSV style list from the hosts view in the FOG web UI but I doubt this will have the IPs in it.
-
First sorry for my level of english,
I use this with Python and the API, https://github.com/mechalas/fog-inventory-updater. Modify it and add for example to line 289 “inventory[‘other1’]=socket.gethostbyname(socket.gethostname())” and and this sent as a snapin, this will upload the client’s ip to the inventory section with other1 field, then you can extract a CSV report of the data.
-
@Sebastian-Roth perhaps I can achieve the same outcome with snap-ins?
I have batches of Ubuntu machines that I multicast image. I have a bash script in the image that essentially prefigures the machine but it currently need to be run manually as it require two user inputs unique to each machine.
The reason I wanted the IP of each machine was so I could write a script to SSH into each machine from my PC, run the script and populate the unique inputs from a CSV.
It’s not so clear to me the limitations of snap-ins - is this a correct use case?