Quick Registration Hostname Variability?
-
Is there a way to have variable hostnames during quick registration based on the hardware? For instance, we have Dell 7730 laptops and have recently added intel NUCs to our enterprise.
If we wanted to quick reg the Dells as Dell-* and the Intel NUCs as NUC-* is this possible?
-
@neilasiii With quick registration I’d have to look into the code to see if you can hack your way to what you want. In principal it should be possible.
I have a tutorial for something similar for the full registration where the hostname is calculated based on the deployment site, if its a portable or desktop and the serial number of the device. https://forums.fogproject.org/topic/14278/creating-custom-hostname-default-for-fog-man-reg
In this post I call for the product name differently based on the manufacturer. https://forums.fogproject.org/post/82600 This is done via a call to dmidecode to get the system-manufacturer name with
dmidecode -s system-manufacturer
So all of the bits are available you just need to configure them in the right order.
-
@george1421 These are scripts that run during registration right?
-
@brakcounty For the custom host name yes. In the FOS Linux environment the fog.man.reg script is for registering the client computer with the FOG server. The tutorial I linked is how to inject a tweaked fog.man.reg script into a booting FOS Linux image.
-
@george1421 ok so I have created two files fog.man.reg and fog.customhostname containing their respective code as per your tutorial. I see this step “we need to copy the fixed fog.man.reg and (fog.auto.reg) file(s)”. Do I need to worry about the fog.auto.reg file or is the fog.man.reg file enough?
-
@brakcounty said in Quick Registration Hostname Variability?:
Do I need to worry about the fog.auto.reg file or is the fog.man.reg file enough?
the fog.auto.reg is for the quick registration function. The fog.man.reg is for the full/complete registration.
-
@george1421
So I got it working. The only thing I’d like to omit from the script is the site code function. I only need the serial number to be read from bios and set as hostname. Which parts of the script can I comment out to skip that step? -
@brakcounty said in Quick Registration Hostname Variability?:
So I got it working. The only thing I’d like to omit from the script is the site code function.
In the custom host name script at the very bottom.
# default host name is returned to the fog.man.reg script host_default_name="$zsitecode$zchtype$zserialno";
That is where I glue together all of the variables that I collected above. If you just want the serial number then the last line should look like this
# default host name is returned to the fog.man.reg script host_default_name="$zserialno";
Then the default host name will just be the serial number of the device.
-
@george1421 BOOM! That worked! Thanks!
-
@brakcounty said in Quick Registration Hostname Variability?:
BOOM! That worked! Thanks!
I’m detecting a hint of doubt in that statement…
Well done on the hack to get what you needed.
-
@george1421 There wasn’t any doubt on my end…but I can imagine you read that and said to yourself “of course it did…”.