• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Extracting IP addresses from host

Scheduled Pinned Locked Moved
General
3
4
759
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    MikeAbbages
    last edited by Sep 21, 2023, 2:34 AM

    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-field

    I’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

    1 Reply Last reply Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Sep 24, 2023, 6:46 AM

      @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.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      P M 2 Replies Last reply Sep 25, 2023, 5:45 AM Reply Quote 0
      • P
        pep @Sebastian Roth
        last edited by pep Sep 24, 2023, 11:48 PM Sep 25, 2023, 5:45 AM

        @Sebastian-Roth @MikeAbbages

        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.

        1 Reply Last reply Reply Quote 0
        • M
          MikeAbbages @Sebastian Roth
          last edited by Sep 28, 2023, 6:19 AM

          @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?

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post

          177

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project