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

    Hostname exists when it doesn't

    Scheduled Pinned Locked Moved
    FOG Problems
    3
    16
    4.8k
    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.
    • J
      jamesb
      last edited by

      I have a really weird issue. I recently imported a couple hundred of machines into FOG and I decided to run a Hostname and Users report, since the Host List report appears to be broken for me, to see if there were some errors with some of my hosts. Some of my hosts don’t have MAC addresses listed. When I go to search for the host FOG doesn’t find it, but when I try to add the host in it says it already exists. Is there somewhere else in FOG where I can clear out the hostname? I’m currently on version 2873.

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        What is the issue you’re seeing?

        Is it giving a white page when you try to list host?

        My guess is the hostMAC Table is slightly screwed up.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        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

        1 Reply Last reply Reply Quote 0
        • J
          jamesb
          last edited by

          When I try the host list report I do only get a white page. When I run the Host and User report I get a list of Hostnames and Mac addresses and a users login period like I should. The issue is that on some machine I have a hostname but no MAC address. FOG can’t find the hostname when I search for it and it won’t let me add that particular hostname.

          1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott
            last edited by

            Do you have a utility for editing the mysql database visually? Such as phpmyadmin?

            My guess is when adding the hosts through the import you stated, the mac’s were added, as well as the hostnames, but the related hostID’s weren’t pulled with the mac address associations.

            So the MAC’s exist in the hostMAC table, but the associated Host ID is probably 0. Because a host is not valid until a MAC address is associated, and the table only allows one MAC address, the association of the MAC to the Host needs to be corrected for.

            I can look at the import and just ensure that it is correct as well.

            My guess is many of your hostMACs have a hostID field of 0 which is what’s creating your problem.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            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

            1 Reply Last reply Reply Quote 0
            • J
              jamesb
              last edited by

              If the utility is built into ubuntu then I do have it, otherwise I should be able to get it easily enough. What file am I looking for to edit?

              1 Reply Last reply Reply Quote 0
              • J
                jamesb
                last edited by

                OK. I have phpmyadmin installed and I’m looking at the hostMAC table. I then sort the hmHostID column but nothing is set to zero in that column. Am I just sorting the wrong column or am I looking at the wrong table all together?

                1 Reply Last reply Reply Quote 0
                • Tom ElliottT
                  Tom Elliott
                  last edited by

                  I’m working on another theory.

                  Can you remove all the hosts you added before.

                  Open the file you exported.

                  The E column should be the imageID, however, i saw an issue with the Description. It was separating the date that’s inside the description as separate fields.

                  For example:

                  Created by FOG Reg on August 1, 2014, 9:58 am
                  Would actually set the D column to
                  Created by FOG Reg on August 1
                  E would then be:
                  2014 (imageID which is unlikely the expectation)
                  F would then be 9:58 am
                  And G would contain the actual imageID.
                  My guess, then, is this is where the problem is occurring. I’ve fixed this issue in 2932, but if your export file is separated in such a manner, you can just remove the e-f columns and all should work. Of course the description wouldn’t contain the proper date information, but I don’t think this is too much of a loss.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  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

                  1 Reply Last reply Reply Quote 0
                  • J
                    jamesb
                    last edited by

                    Part of the problem though is that FOG won’t let me see the imported hostname with no MAC tied to it. It’s only around 50 some machines that have this out of the ~400 that we imported. We also already have assigned about 3/4 to them into groups and I would prefer not to start over with that if possible, since deleting them will mean they will need to be re-added to groups. If I’m able to delete the host from the database and then just add them in manually through FOG that would be preferable. I just need to know where to look in the database so I know I’m deleting the correct one.

                    1 Reply Last reply Reply Quote 0
                    • Tom ElliottT
                      Tom Elliott
                      last edited by

                      The hostMAC hostID field should match the same hostID in the hosts table.

                      You can see if it really is the “not found mac address” is the issue by using this.

                      Basically you need a join possibly to find out what’s going on, but I’d rather just see two tabs side by side, one showing the hosts table
                      and one showing the hostMAC table.

                      Then, find the non mac assigned hosts based on that.

                      Just off the top of my head a method to find the non mac associated hosts in the DB could be:

                      SELECT * FROM hosts LEFT OUT JOIN hostMAC ON hosts.hostID != hostMAC.hostID

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      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

                      1 Reply Last reply Reply Quote 0
                      • J
                        jamesb
                        last edited by

                        After some more browsing around I found my host in the hosts table with an ID of 3003. I tried to find that hostID in the hostMAC table but it didn’t exist so the MAC doesn’t seem to exist at all. Could I simply delete the host from the hosts table since it doesn’t seem to be connected to anything else? I’m very new to databases and would just like verification from an expert.

                        1 Reply Last reply Reply Quote 0
                        • Tom ElliottT
                          Tom Elliott
                          last edited by

                          I’m no expert, but if the MAC Address doesn’t exist at all for the ID’s, then you should be safe to remove from the hosts table. But this doesn’t mean that the MAC Address for that host doesn’t exist in the hostMAC table, but rather the association between the two hasn’t occurred.

                          I’m currently testing a few SELECT statements to try providing you with all the hosts that have no associated hostMAC.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                          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

                          1 Reply Last reply Reply Quote 0
                          • J
                            jamesb
                            last edited by

                            I tried searching for the proper MAC address and got 0 results back. I also saw a search query that you posted in the Latest FOG Development forum and got a 0 result hit back. I think none of those MAC address were actually added to the table.

                            1 Reply Last reply Reply Quote 0
                            • Tom ElliottT
                              Tom Elliott
                              last edited by

                              SELECT hostID FROM hosts WHERE hostID NOT IN ( SELECT hostID FROM hostMAC )

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                              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

                              1 Reply Last reply Reply Quote 0
                              • Tom ElliottT
                                Tom Elliott
                                last edited by

                                Alright, then yes it should be safe to remove those hosts.

                                Before you attempt re-importing, can you verify that the E cell of the Table is not the Year the host was created?

                                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                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

                                1 Reply Last reply Reply Quote 0
                                • J
                                  jamesb
                                  last edited by

                                  I can confirm that the E column is the image id field.

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    ToniCapablo
                                    last edited by

                                    Hello people!

                                    Recently I had a similar problem. My FOG solution is:

                                    • FOG version 1.2.0 revision 3246
                                    • Ubuntu Desktop 13.10 i386

                                    Working with Hosts Management section, creating a host, erasing this host and again creating the host with same MAC I had the trouble that FOG said me that this hostname already exists. In the Host Management section did not appear the host.

                                    The solution is like Tom says. Thank you Tom!!

                                    For me, deleting the registers in fog database with the [I]wrong[/I] host ([I]wrong[/I] means the created, then deleted and then tried to create) in [I]host[/I] and [I]hostMAC[/I] table was the solution.

                                    1. I searched how to manipulate fog database.
                                    2. I used phpMyAdmin (searching directly with Ubuntu Software Center).
                                    3. Then I configure to get access to the fog database (I used blank password in mysql).
                                    4. Edit /etc/phpmyadmin/config.inc.php
                                      [INDENT=1]Uncomment this line:[/INDENT]
                                      [INDENT=1][COLOR=#3366ff][SIZE=4]$cfg[‘Servers’][$i][‘AllowNoPassword’] = TRUE;[/SIZE][/COLOR][/INDENT]
                                      [INDENT=1]Save file.[/INDENT]
                                    5. Finally, search the tables [I]host[/I] and [I]hostMAC[/I] and delete the [I]wrong[/I] host registers.

                                    I hope it helps. See you,

                                    T. Capablo.

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

                                    155

                                    Online

                                    12.0k

                                    Users

                                    17.3k

                                    Topics

                                    155.2k

                                    Posts
                                    Copyright © 2012-2024 FOG Project