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

Feature Request: 'Rename Host in FOG database' option on the PXE menu

Scheduled Pinned Locked Moved
Feature Request
6
10
4.2k
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
    mr626
    last edited by Mar 25, 2012, 9:05 AM

    Hello,

    Would it be possible to have a ‘rename host in FOG’ option on the PXE menu?

    This would be really handy for us, mainly because our naming convention for computers reflects the physical location of the machine within our organisation. So, when I decommission / redeploy machines if I haven’t remember to edit or delete them in FOG first it can cause problems when I try and register them with FOG again.

    A few times I have been re-deploying old machines that already exist in the FOG database, and I can’t remember if I previously deleted them from FOG when they were deployed elsewhere (and had different hostnames). When I boot into the FOG menu and attempt to register the host with FOG, FOG correctly tells me that it can’t register the host, as there is already one with the same MAC address in FOG.

    What would be great is at this point, rather than just rebooting, if there was an option to change the hostname in FOG.

    I appreciate that the FOG devs are probably already quite busy, so I’ll probably attempt to add this functionality myself. Would anyone else find it useful?

    1 Reply Last reply Reply Quote 0
    • D
      Derek Boyer
      last edited by Apr 3, 2012, 6:07 PM

      I would absolutely love to have that feature as I name my machines in a similar fashion. There have been times when I have deployed a previously decommissioned machine to find out while trying to register that it is already in the database.

      1 Reply Last reply Reply Quote 0
      • N
        neodawg
        last edited by Apr 4, 2012, 4:38 PM

        I would like to +1 this feature request as well.

        1 Reply Last reply Reply Quote 0
        • M
          mr626
          last edited by Apr 4, 2012, 9:49 PM

          Cool, well I’m glad I’m not the only one who would value this.

          Depending on my workload I’ll attempt to start work on this soon.

          1 Reply Last reply Reply Quote 0
          • M
            mr626
            last edited by Apr 10, 2012, 11:39 PM

            I’m trying to start work on this, but I could use a hand in understanding how fog operates.

            I can see in the ‘default’ file that holds the configuration for the fog pxe menu that different fog functions are called from the menu like so:

            [CODE]LABEL fog.quickimage
            kernel fog/kernel/bzImage
            append initrd=fog/images/init.gz root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns= mode=quickimage keymap= web=192.168.1.1/fog/ loglevel=4 consoleblank=0
            MENU LABEL Quick Image
            TEXT HELP
            This mode will allow you to image this host quickly with
            it’s default assigned image.
            ENDTEXT[/CODE]

            In the above example, the ‘mode=quickimage’ is obviously what determines how fog will operate when that menu item is selected. What I’m not clear on is where the underlying code is located that receives this argument. In theory, we can then write a function for renaming the host (probably re-using lots of code from one of the existing functions, as we’ll be accessing similar parts of the fog database). Then, we can simply add a new entry to the ‘default’ pxe menu config file with ‘mode=renamehost’

            For the time being, I’ve left a grep -iR command running to see if I can find the code myself 😉

            1 Reply Last reply Reply Quote 0
            • B
              BryceZ
              last edited by Apr 11, 2012, 1:57 PM

              What you’re looking for is /etc/init.d/S99fog in the boot image (/tftpboot/fog/images/init.gz).
              [CODE]cp /tftpboot/fog/images/init.gz /tftpboot/fog/images/init.gz.BACKUP
              gunzip /tftpboot/fog/images/init.gz
              mkdir /mnt/init
              mount -o loop /tftpboot/fog/images/init /mnt/init[/CODE]
              That will get you into the mounted boot image to make whatever changes you like, and when you’re done…
              [CODE]umount /mnt/init
              gzip /tftpboot/fog/images/init[/CODE]

              You’ll most likely need to write a new php script on the web server side, something like the service scripts where you can POST the MAC address of the host and it’s new name.

              Best of luck!

              1 Reply Last reply Reply Quote 0
              • M
                mr626
                last edited by Apr 11, 2012, 10:02 PM

                Fantastic! Many thanks for the reply. I’ll try and get started on this soon

                1 Reply Last reply Reply Quote 0
                • H
                  Huck
                  last edited by Aug 2, 2012, 7:56 PM

                  This would be an awesome feature!! I’ve just searched the forums for a way to do this… Any updates MR626? Help needed? 🙂

                  1 Reply Last reply Reply Quote 0
                  • M
                    mr626
                    last edited by Aug 3, 2012, 12:03 AM

                    Sadly, I haven’t had the time to spend on this that I had hoped, sorry 😞

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by Sep 21, 2013, 1:17 AM

                      I already have a fix in place for this. In creating the pxe delete host option, I now know exactly where to go.

                      The file you’ll need to edit would be within the init.gz file, if you’ve already added the delete options, this will take just a couple lines of code:

                      When it says unable to register host as it already exists, call the fog.auto.del script, it should take over from that point, within the fog.auto.del post, it will ask if you want to re-inventory of where you can change the hostname. This should be useful, though I don’t have time to test all aspects.

                      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
                      • 1 / 1
                      • First post
                        Last post

                      169

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project