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

FOG 2.0 request: Advanced host naming

Scheduled Pinned Locked Moved
Feature Request
4
11
4.7k
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.
  • G
    george1421 Moderator
    last edited by Dec 8, 2015, 2:51 AM

    For clarity here the fragment of my fog post install script that was never put into production because of loosing functionality in fog.

      # need to find a way to get storage location set it manually for now
      sitecode="NYC";
    
      chassis=`dmidecode -s chassis-type`;
      chassis="${chassis%"${chassis##*[![:space:]]}"}";
      chassis="${chassis%,,}"; # Convert string to lower
    
      if [ "$chassis" = "laptop" ]
      then
        chtype="P";
      elif [ "$chassis" = "tablet" ]
      then
        chtype="T";
      else
        chtype="D";
      fi
    
      serialno=`dmidecode -s chassis-serial-number`;
      serialno="${serialno%"${serialno##*[![:space:]]}"}";  # Remove trailing whitespace
    
      # get the serial no from the baseboard if bios doesn't give it up
      if [ "$serialno" = "" ]
      then
        serialno=`dmidecode -s baseboard-serial-number`;
        serialno="${serialno%"${serialno##*[![:space:]]}"}";
      fi
    
      LEN=$(echo ${#serialno});
      if [ $LEN -gt 11 ]
      then
        # get the right most characters of the serial number (usually the most
        # unique characters)
        serialno=${serialno:(-11)};
      fi
    
      compname="$sitecode$chtype$serialno";
    
      echo Setting computer name to: $compname;
    
      sed -i -e "s#<ComputerName>\([^<][^<]*\)</ComputerName>#<ComputerName>$compname</ComputerName>#gi" /ntfs/Windows/System32/sysprep/Unattend.xml
    

    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!

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by george1421 Dec 7, 2015, 9:06 PM Dec 8, 2015, 3:01 AM

      Here are the examples on how to hack the old version of fog to produce a dynamic client host name (I can’t seem to find the actual instructions from long ago, but the code may spark an idea.)

      http://www.ehu.eus/fogenehu/doc/old/html/hosts_8inventory_8include_8php_source.html
      http://www.ehu.eus/fogenehu/doc/html/HostManagementPage_8class_8php_source.html

      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!

      F 1 Reply Last reply Dec 10, 2015, 6:11 PM Reply Quote 0
      • W
        Wayne Workman
        last edited by Dec 8, 2015, 3:42 AM

        I really like the idea - but it’s hard to write code that will accomidate for everyone’s naming convention.

        The convention my organization uses is vastly different from yours.

        Mine is:

        rAAAAABBBBBCCDD

        where r is… meaningless
        A is the room number, including leading zeros
        B is the last five digits of the asset tag.
        C is the type of computer

        • WD = Windows Desktop
        • WL = Windows Laptop
        • AD = Apple Desktop
        • AL = Apple Laptop
        • LD = Linux Desktop
        • LL = Linux Laptop
        • CD = Chrome/Chromium Desktop
        • CL = Chrome/Chromium Laptop

        DD is the building abbreviation.

        It’s impossible to write logic for that - because it’s not based on hardware. It’s based on stickers that get pealed off all the time, based on room numbers which equipment magically floats to and from all the time…

        This post is turning into a rant lol. </endRant>

        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!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        1 Reply Last reply Reply Quote 0
        • G
          george1421 Moderator
          last edited by Dec 8, 2015, 10:36 PM

          Well I guess I need to amend the request to only support machine based automated naming convention.

          The old 0.29 hack method allowed me to enter system variable names in the auto naming edit box to allow me to construct the machine calculated name. You can see the allowed variable names in the one link I posted.

          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!

          1 Reply Last reply Reply Quote 0
          • F
            Fernando Gietz Developer @george1421
            last edited by Dec 10, 2015, 6:11 PM

            @george1421 said:

            Here are the examples on how to hack the old version of fog to produce a dynamic client host name (I can’t seem to find the actual instructions from long ago, but the code may spark an idea.)

            http://www.ehu.eus/fogenehu/doc/old/html/hosts_8inventory_8include_8php_source.html
            http://www.ehu.eus/fogenehu/doc/html/HostManagementPage_8class_8php_source.html

            I am the developer of this fork of FOG 0.30 (fogenehu). This version is actually in production environment and works fine . We don’t assign dynamic names to the machines, we synchronize the machines with our own inventory database. In this way the name of the computers have our convention. I would wish to add this feature in FOG 2.0, import computers from a database.

            1 Reply Last reply Reply Quote 0
            • G
              george1421 Moderator
              last edited by george1421 Dec 10, 2015, 12:24 PM Dec 10, 2015, 6:24 PM

              First of all I have to say, well done!! This fix worked so well back in the day. 😃

              The thought was if the machine name is machine calculable as in our case, why not allow it in 2.0? I can do this today with my script (which I don’t use because I loose FOG functionality). But if the registration process would prepopulate that field based on a formula then all would be right with the world.

              Truthfully what we do today is a bit manual but it works. We key in the site OU, D, P, T, or what ever then use a barcode scanner to read the asset tag from the back/bottom of the dells. It does work, but it also the posibility for error and does make extra work.

              I understand what you are staying about just importing from a database, but then we have to collect the machine information key/scan it into a database, export and then upload info FOG. This seems like too much work for something that can be done is milliseconds on a computer, and not leave room for the IT tech to make a mistake.

              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!

              F 1 Reply Last reply Dec 10, 2015, 6:40 PM Reply Quote 0
              • F
                Fernando Gietz Developer @george1421
                last edited by Dec 10, 2015, 6:40 PM

                @george1421 said:

                First of all I have to say, well done!! This fix worked so well back in the day. 😃

                The thought was if the machine name is machine calculable as in our case, why not allow it in 2.0? I can do this today with my script (which I don’t use because I loose FOG functionality). But if the registration process would prepopulate that field based on a formula then all would be right with the world.

                Truthfully what we do today is a bit manual but it works. We key in the site OU, D, P, T, or what ever then use a barcode scanner to read the asset tag from the back/bottom of the dells. It does work, but it also the posibility for error and does make extra work.

                I understand what you are staying about just importing from a database, but then we have to collect the machine information key/scan it into a database, export and then upload info FOG. This seems like too much work for something that can be done is milliseconds on a computer, and not leave room for the IT tech to make a mistake.

                😃 For us is not hard work. The providers (DELL or HP) do this work, the administrators only setup the IP and their location, then the technicians can synchronize the computer data. The idea is if you have all data in a database, why not import them from FOG?

                1 Reply Last reply Reply Quote 0
                • J
                  jmeyer @george1421
                  last edited by jmeyer Dec 11, 2015, 6:53 AM Dec 11, 2015, 12:48 PM

                  Reading this topic title made me think of something.
                  Could it be possible to auto set name from selected group as default name if name is set to empty.

                  For exemple, we add a computer to group named “Laptop” and it end name “Laptop01”.
                  If “Laptop03” exist, automatically named “Laptop04”.

                  Maybe a page with “personalised fast registration” options and a new line on PXE menu could be what we need.
                  We could select what would be asked and what should be set automaticaly.
                  Default image, default naming, default group, default storage.

                  We name our computer “RoomNumber-ComputerNumber”. (Ex : 007-01 or Lavoisier-01)
                  Best automaticaly naming would be “Location/Storage-GroupName-Number”.

                  1 Reply Last reply Reply Quote 0
                  • G
                    george1421 Moderator
                    last edited by Dec 11, 2015, 1:58 PM

                    What was so great about the hack that ended up into the fork of FOG was you had these macro variable you could use to construct your computer name.

                    
                    PrimaryUser
                    Other Tag #1
                    Other Tag #2
                    System Manufacturer
                    System Product
                    System Version
                    System Serial Number
                    System Type
                    BIOS Vendor
                    BIOS Version
                    BIOS Date
                    Motherboard Manufacturer
                    Motherboard Product Name
                    Motherboard Version
                    Motherboard Serial Number
                    Motherboard Asset Tag
                    CPU Manufacturer
                    CPU Version                         
                    CPU Normal Speed
                    CPU Max Speed
                    Memory
                    Hard Disk Model
                    Hard Disk Firmware
                    Hard Disk Serial Number
                    Chassis Manufacturer
                    Chassis Version
                    Chassis Serial
                    Chassis Asset
                    

                    These macro variables could be combined with literals and the * to give you a unique machine calculable name. For example in the FOG_QUICKREG_SYS_NAME you could enter something like this. (the syntax is not exact but you’ll get the point)

                    FOG_QUICKREG_SYS_NAME = “USNYC”{System Type}{System Serial Number}-*

                    The auto name would be something like USNYCDesktopXXXXXXXXX-01

                    At the time this function was added to the fog fork there wasn’t storage nodes/groups/locations but I would be great (still wishing here) to add those macro names too.

                    @jmeyer Your naming would be possible too, just put your room number into the other tag #1 or 2 field. While the devs are not geeked about this feature, I am. 😆

                    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!

                    J 1 Reply Last reply Dec 11, 2015, 3:38 PM Reply Quote 0
                    • J
                      jmeyer @george1421
                      last edited by Dec 11, 2015, 3:38 PM

                      @george1421 Room number (or room name) is most of time in group. That was my point. If you ask group before name (I know it’s stupid), you will be able to find out name I need using concatenation of the group name and a split on other computer in group taking the max of “name” less “group”.

                      New Host Name = Group Name + (max (Group Name removed from the list of other computer in group))

                      I don’t know if you understand me… lol
                      Something like this if name is “create” during registration.
                      Other way is just rename every host in group during registration base on registration date. Oldest get the lowest number.

                      I think we both like geeking ! lol

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

                      171

                      Online

                      12.1k

                      Users

                      17.3k

                      Topics

                      155.3k

                      Posts
                      Copyright © 2012-2024 FOG Project