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

Change Full Host Registration / QuickImage

Scheduled Pinned Locked Moved Solved
Feature Request
6
13
5.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.
  • L
    Lee Rowlett Developer
    last edited by Aug 28, 2012, 9:41 PM

    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
    • B
      BigDawg986
      last edited by Aug 28, 2012, 10:47 PM

      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
      • L
        Lee Rowlett Developer
        last edited by Aug 29, 2012, 10:47 PM

        [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 Aug 30, 2012, 2:12 PM

          Works great man thanks

          1 Reply Last reply Reply Quote 0
          • C
            chad-bisd Moderator
            last edited by Aug 30, 2012, 2:17 PM

            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
            • B
              BigDawg986
              last edited by Aug 31, 2012, 8:29 PM

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

              1 Reply Last reply Reply Quote 0
              • F
                falko Moderator
                last edited by Nov 14, 2012, 7:38 AM

                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
                • L
                  Lee Rowlett Developer
                  last edited by Nov 14, 2012, 6:22 PM

                  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
                  • F
                    falko Moderator
                    last edited by Nov 14, 2012, 6:45 PM

                    thanks will take a look when back at work

                    1 Reply Last reply Reply Quote 0
                    • F
                      falko Moderator
                      last edited by Nov 15, 2012, 10:46 AM

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

                      1 Reply Last reply Reply Quote 0
                      • L
                        Lee Rowlett Developer
                        last edited by Nov 16, 2012, 12:00 AM

                        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
                        • F
                          falko Moderator
                          last edited by Nov 16, 2012, 7:46 AM

                          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
                          • T
                            Tom Elliott
                            last edited by Oct 16, 2013, 9:17 PM

                            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

                            189

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project