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

    Change Full Host Registration / QuickImage

    Scheduled Pinned Locked Moved Solved
    Feature Request
    6
    13
    5.1k
    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.
    • Lee RowlettL
      Lee Rowlett Developer
      last edited by

      Hi All,

      i have made changes slightly to the full host registration, quickimage. In active task page, i have added “started by” which shows which user/engineer started the task. I’ve also added the “started by/created by” into the imaging log (for auditing purposes) and it also nice to easy check active tasks page and see which engineer’s imaging at the time. so these are the reasons behind these changes.

      1: Quickimage - when you use quickimage, it does not add into the sql database, who created the task even though it requests credentials before you can send the image request. i therefore changed it to pass this information and add it to the task information.

      1. Full Host Registration - instead of asking you to type “fog” to confirm imaging, i’ve changed it to use the same process as quickimage and request username and password (more secure i guess) but main reason is so it can pass the user who sent the task request and add it to the task information.

      When the machine exists - instead of stating that
      [B][I]machine already exists in the fog database![/I][/B]
      it states:
      [I][B]This Machine is already registed as: “HostName”[/B][/I]

      this makes it easier to identify the machine in the host list rather than getting the mac address and searching that way.

      These are simple changes but if everyone would find these useful i’d propose them to the developers to add to FOG. 🙂

      1 Reply Last reply Reply Quote 0
      • BigDawg986B
        BigDawg986
        last edited by

        I like this very much. Especially requiring credentials to image during registration and the “machine already registered as: hostname”

        1 Reply Last reply Reply Quote 0
        • Lee RowlettL
          Lee Rowlett Developer
          last edited by

          [B]“Machine already registered” change:[/B]

          change [I]man.hostexists.php[/I] under [I]/var/www/service[/I] and change it to this (it’s around line 57):
          [CODE]
          $sql = “select hostName, count(*) as cnt from hosts where hostMAC = '” . $mac . “'”;
          $res = mysql_query( $sql, $conn ) or die( mysql_error() );
          while( $ar = mysql_fetch_array( $res ) )
          {
          if ( $ar[“cnt”] == 0 )
          {
          echo “#!ok”;
          }
          else
          echo “”._(“This Machine is already registed as”).": " . $ar[“hostName”] . “”;
          }[/CODE]

          1 Reply Last reply Reply Quote 0
          • D
            djm79
            last edited by

            Works great man thanks

            1 Reply Last reply Reply Quote 0
            • C
              chad-bisd Moderator
              last edited by

              Cool. Blackout integrated this into the codebase moving forward. I have always thoroughly enjoyed the guessing game and lookup when a host exists but I don’t know which one it is. /sarcasm off


              If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

              1 Reply Last reply Reply Quote 0
              • BigDawg986B
                BigDawg986
                last edited by

                Yep, love it. Shared with the rest of the FOG evangelists I know.

                1 Reply Last reply Reply Quote 0
                • falkoF
                  falko Moderator
                  last edited by

                  is there anyway to add a similar idea to the ‘Quick Host Reg and inventory’ for when the machine is already registered to show what machine it is? at the moment it just shows host exists

                  1 Reply Last reply Reply Quote 0
                  • Lee RowlettL
                    Lee Rowlett Developer
                    last edited by

                    yes quite easy actually, without looking at the code, you should be able to use the same principle above but for auto.register.php

                    1 Reply Last reply Reply Quote 0
                    • falkoF
                      falko Moderator
                      last edited by

                      thanks will take a look when back at work

                      1 Reply Last reply Reply Quote 0
                      • falkoF
                        falko Moderator
                        last edited by

                        Lee (or anyone) are you able to help, I cant seem to find where to edit this?

                        1 Reply Last reply Reply Quote 0
                        • Lee RowlettL
                          Lee Rowlett Developer
                          last edited by

                          change auto.register.php line 77 (dependant on version you’ve got but it’s around there)
                          from:
                          [B]$sql = “select count() as cnt from hosts where hostMAC = ‘" . $mac . "’";[/B]
                          to:
                          [B]$sql = "select hostName, count(
                          ) as cnt from hosts where hostMAC = '” . $mac . “'”;[/B]
                          and then change output on line 264 (again might be diff line - version)
                          from:
                          [B]echo (“Exists”);[/B]
                          to:
                          [B]echo “”.
                          (“This Machine is already registed as”).": " . $ar[“hostName”] . “”;[/B]

                          i haven’t tested this but can’t see why it wouldn’t work 🙂

                          1 Reply Last reply Reply Quote 0
                          • falkoF
                            falko Moderator
                            last edited by

                            Thank you!! This works perfectly using FOG 0.32. This is so handy.

                            I would love to see this put into 0.33 code, I know the above patch has been (not sure if this part has).

                            Thanks again to everyone in thread

                            [quote=“Lee Rowlett, post: 9534, member: 28”]change auto.register.php line 77 (dependant on version you’ve got but it’s around there)
                            from:
                            [B]$sql = “select count() as cnt from hosts where hostMAC = ‘" . $mac . "’";[/B]
                            to:
                            [B]$sql = "select hostName, count(
                            ) as cnt from hosts where hostMAC = '” . $mac . “'”;[/B]
                            and then change output on line 264 (again might be diff line - version)
                            from:
                            [B]echo (“Exists”);[/B]
                            to:
                            [B]echo “”.
                            (“This Machine is already registed as”).": " . $ar[“hostName”] . “”;[/B]

                            i haven’t tested this but can’t see why it wouldn’t work :)[/quote]

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

                              Added this to quick inventory screen as it was very simple. Thanks Lee!

                              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

                              165

                              Online

                              12.0k

                              Users

                              17.3k

                              Topics

                              155.2k

                              Posts
                              Copyright © 2012-2024 FOG Project